I am trying to do LTO with llvm and the gold plugin to test the case in http://llvm.org/releases/2.6/docs/LinkTimeOptimization.html
Almost everything works, but foo4 from main.o is not removed. It is interesting that gold claims to have removed it: $ LD_LIBRARY_PATH=. ld --eh-frame-hdr -m elf_x86_64 --hash-style=both -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o main /usr/lib/gcc/x86_64-linux-gnu/4.2.4/../../../../lib/crt1.o /usr/lib/gcc/x86_64-linux-gnu/4.2.4/../../../../lib/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.2.4/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/4.2.4 -L/usr/lib/gcc/x86_64-linux-gnu/4.2.4 -L/usr/lib/gcc/x86_64-linux-gnu/4.2.4/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.2.4/../../.. a.o main.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/4.2.4/crtend.o /usr/lib/gcc/x86_64-linux-gnu/4.2.4/../../../../lib/crtn.o -plugin=LLVMgold.so --gc-sections --print-gc-sections .... ld: removing unused section from '.text.foo4' in file 'main.o' .... but objdump -d main | grep foo4 -A 6 0000000000400490 <foo4>: 400490: 55 push %rbp 400491: 48 89 e5 mov %rsp,%rbp 400494: bf d0 05 40 00 mov $0x4005d0,%edi 400499: 5d pop %rbp 40049a: e9 61 01 00 00 jmpq 400600 <p...@plt> -- Summary: gc not as effective when using a plugin Product: binutils Version: unspecified Status: NEW Severity: normal Priority: P2 Component: gold AssignedTo: tmsriram at google dot com ReportedBy: espindola at google dot com CC: bug-binutils at gnu dot org GCC build triplet: x86_64-linux-gnu GCC host triplet: x86_64-linux-gnu GCC target triplet: x86_64-linux-gnu http://sourceware.org/bugzilla/show_bug.cgi?id=11604 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils