On 29/07/2025 18:45, Christophe JAILLET wrote:
Le 29/07/2025 à 08:49, Colin Ian King a écrit :Don't populate the read-only arrays on the stack at run time, instead make them static const. Also reduces overall size. before: text data bss dec hex filename367439 89582 5952 462973 7107d drivers/scsi/ scsi_debug.oafter: text data bss dec hex filename365847 90702 5952 462501 70ea5 drivers/scsi/ scsi_debug.oHi, out of curiosity, any idea why 'data' increase?
Because the arrays are being stored in the data section rather than on the stack.
All my constification patches lead to data reduction.(gcc 14.2.0, x86-64)(same kind of behavior with 15.1.1) CJ
Attachment:
OpenPGP_0x68C287DFC6A80226.asc
Description: OpenPGP public key
Attachment:
OpenPGP_signature.asc
Description: OpenPGP digital signature