https://sourceware.org/bugzilla/show_bug.cgi?id=29451
--- Comment #6 from Martin Liska <mliska at suse dot cz> --- (In reply to Mark Wielaard from comment #5) > >> So when this file is linked in with object files and these relocations are > >> resolved the correct values for the __x86.get_pc_thunk.bx symbol will be > >> installed into the .debug_info section, and everything should work. > > > > In https://sourceware.org/PR29450 we observed zero-size on a final > > executable. > > Maybe it is useful to attach the final binary to this bug and show how to > generate it. > > Given the code that introduced this issues (commit > 591cc9fbbfd6d51131c0f1d4a92e7893edcc7a28 see comment #1) it might also be > interesting to show the symbol table entry for _init. Note before the revision there was no debug info entry for _init: $ as --version && gcc /tmp/crti.S -c -g --verbose -dwarf4 && readelf --debug-dump crti.o GNU assembler (GNU Binutils; openSUSE Tumbleweed) 2.38.20220525-6 ... <0><c>: Abbrev Number: 1 (DW_TAG_compile_unit) <d> DW_AT_stmt_list : 0x0 <11> DW_AT_ranges : 0xc <15> DW_AT_name : (indirect string, offset: 0x0): /tmp/crti.S <19> DW_AT_comp_dir : (indirect string, offset: 0xc): /home/marxin <1d> DW_AT_producer : (indirect string, offset: 0x19): GNU AS 2.38 <21> DW_AT_language : 32769 (MIPS assembler) (no change with -dwarf4 option). And the symbol has size == 0 in symbol table: $ readelf -s crti.o Symbol table '.symtab' contains 11 entries: Num: Value Size Type Bind Vis Ndx Name ... 9: 0000000000000000 0 FUNC GLOBAL HIDDEN 5 _init With 2.39 one gets: $ as --version && gcc /tmp/crti.S -c -g --verbose -dwarf4 && readelf --debug-dump crti.o GNU assembler (GNU Binutils; home:marxin:branches:devel:gcc / openSUSE_Factory) 2.39.0.20220808-0 ... <0><c>: Abbrev Number: 1 (DW_TAG_compile_unit) <d> DW_AT_stmt_list : 0x0 <11> DW_AT_ranges : 0xc <15> DW_AT_name : (indirect string, offset: 0x0): /tmp/crti.S <19> DW_AT_comp_dir : (indirect string, offset: 0xc): /home/marxin/Programming/binutils <1d> DW_AT_producer : (indirect string, offset: 0x2e): GNU AS 2.39.0 <21> DW_AT_language : 32769 (MIPS assembler) <1><23>: Abbrev Number: 2 (DW_TAG_subprogram) <24> DW_AT_name : (indirect string, offset: 0x3c): _init <28> DW_AT_external : 1 <28> DW_AT_low_pc : 0x0 <30> DW_AT_high_pc : 0 <1><31>: Abbrev Number: 2 (DW_TAG_subprogram) <32> DW_AT_name : (indirect string, offset: 0x42): __x86.get_pc_thunk.bx <36> DW_AT_external : 1 <36> DW_AT_low_pc : 0x0 <3e> DW_AT_high_pc : 2 <1><3f>: Abbrev Number: 0 and the symbol size is also 0 in the table: $ readelf -s crti.o Symbol table '.symtab' contains 11 entries: Num: Value Size Type Bind Vis Ndx Name ... 9: 0000000000000000 0 FUNC GLOBAL HIDDEN 5 _init -- You are receiving this mail because: You are on the CC list for the bug.