https://sourceware.org/bugzilla/show_bug.cgi?id=18599
Bug ID: 18599 Summary: Use .strtab section for section names in ELF object files Product: binutils Version: 2.26 (HEAD) Status: NEW Severity: normal Priority: P2 Component: gas Assignee: unassigned at sourceware dot org Reporter: hjl.tools at gmail dot com Target Milestone: --- [hjl@gnu-6 xxx]$ cat x.S #define GLOBAL(x) \ .section .data.##x,"aw",%progbits; \ .globl x; x: .byte 0 GLOBAL(xxxxxxxxxxxxxxxxx1) GLOBAL(xxxxxxxxxxxxxxxxx2) GLOBAL(xxxxxxxxxxxxxxxxx3) GLOBAL(xxxxxxxxxxxxxxxxx4) [hjl@gnu-6 xxx]$ make gcc -B./ -c -o x.o x.S ./ld -shared -o x.so x.o readelf -x .strtab -x .shstrtab x.o Hex dump of section '.shstrtab': 0x00000000 002e7379 6d746162 002e7374 72746162 ..symtab..strtab 0x00000010 002e7368 73747274 6162002e 74657874 ..shstrtab..text 0x00000020 002e6461 7461002e 62737300 2e646174 ..data..bss..dat 0x00000030 612e7878 78787878 78787878 78787878 a.xxxxxxxxxxxxxx 0x00000040 78787831 002e6461 74612e78 78787878 xxx1..data.xxxxx 0x00000050 78787878 78787878 78787878 32002e64 xxxxxxxxxxxx2..d 0x00000060 6174612e 78787878 78787878 78787878 ata.xxxxxxxxxxxx 0x00000070 78787878 7833002e 64617461 2e787878 xxxxx3..data.xxx 0x00000080 78787878 78787878 78787878 78783400 xxxxxxxxxxxxxx4. Hex dump of section '.strtab': 0x00000000 00787878 78787878 78787878 78787878 .xxxxxxxxxxxxxxx 0x00000010 78783100 78787878 78787878 78787878 xx1.xxxxxxxxxxxx 0x00000020 78787878 78320078 78787878 78787878 xxxxx2.xxxxxxxxx 0x00000030 78787878 78787878 33007878 78787878 xxxxxxxx3.xxxxxx 0x00000040 78787878 78787878 78787834 00 xxxxxxxxxxx4. [hjl@gnu-6 xxx]$ If we use .strtab, instead of .shstrtab, for section names in object files, it will reduce file size for object files compiled with "-ffunction-sections -fdata-sections". -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils