http://sourceware.org/bugzilla/show_bug.cgi?id=12430

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ccoutant at google dot com,
                   |                            |ian at airs dot com

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2011-01-22 05:01:16 
UTC ---
It is an LTO issue. In stage 2, linker sees:

 /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o
/usr/gcc-4.6/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/crtbegin.o
/tmp/ccsgGNAQ.obj-only.o /tmp/ccrzbXDQ.ltrans0.ltrans.o --no-whole-archive
/usr/gcc-4.6/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/libgcc.a
/usr/gcc-4.6/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../lib64/libgcc_s.so
/usr/lib/../lib64/libc.so --no-whole-archive
/usr/gcc-4.6/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/libgcc.a
/usr/gcc-4.6/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../lib64/libgcc_s.so
/usr/gcc-4.6/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/crtend.o
/usr/lib/../lib64/crtn.o

[hjl@gnu-6 pr12430]$ nm /tmp/ccrzbXDQ.ltrans0.ltrans.o
[hjl@gnu-6 pr12430]$ 

Since LTO doesn't see foo be called from main, LTO optimizes it out.
ld.hjl gives correct diagnostic.

Is there a way in LTO API for linker to inform LTO that a symbol is
referenced from an non-IR object?

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to