http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47183
Jan Hubicka <hubicka at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED CC| |hubicka at gcc dot gnu.org Resolution| |FIXED --- Comment #3 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-01-05 22:44:57 UTC --- j...@evans:/abuild/jh/trunk-3/build-inst2/gcc> ./g++ -B ./ -O2 t.C -save-temps -flto -fuse-linker-plugin [Leaving LTRANS /abuild/jh/tmp//ccoul7Xo.args] [Leaving LTRANS /abuild/jh/tmp//ccT1KSUO.ltrans.out] [Leaving LTRANS /abuild/jh/tmp//ccOM6q7y.args] [Leaving LTRANS /abuild/jh/tmp//ccT1KSUO.ltrans0.o] j...@evans:/abuild/jh/trunk-3/build-inst2/gcc> cat *.s .file "ccT1KSUO.ltrans0.o" .section .text.startup,"ax",@progbits .p2align 4,,15 .globl main .type main, @function main: .LFB0: .cfi_startproc xorl %eax, %eax ret .cfi_endproc .LFE0: .size main, .-main .ident "GCC: (GNU) 4.6.0 20110105 (experimental)" .section .note.GNU-stack,"",@progbits it is optimized out. With GNU LD I however get j...@evans:/abuild/jh/trunk-3/build-inst2/gcc> nm a.out 0000000000600748 d _DYNAMIC 0000000000600910 d _GLOBAL_OFFSET_TABLE_ 000000000040067c R _IO_stdin_used w _Jv_RegisterClasses 0000000000400582 W _ZTI1S 0000000000400582 W _ZTS1S U _ZTVN10__cxxabiv117__class_type_infoE@@CXXABI_1.3 U _ZdlPv@@GLIBCXX_3.4 0000000000600728 d __CTOR_END__ 0000000000600720 d __CTOR_LIST__ 0000000000600738 D __DTOR_END__ 0000000000600730 d __DTOR_LIST__ 0000000000400700 r __FRAME_END__ 0000000000600740 d __JCR_END__ 0000000000600740 d __JCR_LIST__ 0000000000600940 A __bss_start 0000000000600930 D __data_start 0000000000400630 t __do_global_ctors_aux 00000000004004f0 t __do_global_dtors_aux 0000000000600938 D __dso_handle w __gmon_start__ 0000000000600720 d __init_array_end 0000000000600720 d __init_array_start 0000000000400590 T __libc_csu_fini 00000000004005a0 T __libc_csu_init U __libc_start_main@@GLIBC_2.2.5 0000000000600940 A _edata 0000000000600950 A _end 000000000040066c T _fini 0000000000400460 T _init 00000000004004a4 T _start 00000000004004d0 t call_gmon_start 0000000000600940 b completed.5822 0000000000600930 W data_start 0000000000600948 b dtor_idx.5824 0000000000400560 t frame_dummy 00000000004004a0 T main With gold I get: 0000000000401720 d _DYNAMIC 00000000004018f8 d _GLOBAL_OFFSET_TABLE_ 000000000040063c R _IO_stdin_used w _Jv_RegisterClasses w _ZTI1S w _ZTS1S v _ZTVN10__cxxabiv117__class_type_infoE U _ZdlPv 0000000000401930 d __CTOR_END__ 0000000000401928 d __CTOR_LIST__ 0000000000401940 d __DTOR_END__ 0000000000401938 d __DTOR_LIST__ 00000000004006d8 r __FRAME_END__ 0000000000401948 d __JCR_END__ 0000000000401948 d __JCR_LIST__ 0000000000401950 A __bss_start 0000000000401918 D __data_start 0000000000400600 t __do_global_ctors_aux 00000000004004b0 t __do_global_dtors_aux 0000000000401920 d __dso_handle w __gmon_start__ 0000000000000000 a __init_array_end 0000000000000000 a __init_array_start 0000000000400560 T __libc_csu_fini 0000000000400570 T __libc_csu_init U __libc_start_main 0000000000401950 A _edata 0000000000401960 A _end 0000000000400658 T _fini 0000000000400640 T _init 0000000000400460 T _start 000000000040048c t call_gmon_start 0000000000401950 b completed.5822 0000000000401918 W data_start 0000000000401958 b dtor_idx.5824 0000000000400520 t frame_dummy 0000000000400550 T main I think both linker are buggy to insert those entries into final symbol table when they are not appearing in the output from the linker plugin. Closing this as GCC bug and will fill it in as linker PR.