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

           Summary: undefined references produced by linker plugin are
                    silently ignored
           Product: binutils
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: unassig...@sources.redhat.com
        ReportedBy: j...@suse.cz


Compiling memcpy-asm testcase from GCC testsuite with current GCC mainline and
-O2 -flto results in call to my_memcpy that is not defined:

./xgcc -B ./ -O2 memops-asm*.c 
/abuild/jh/trunk-3/gcc/testsuite/gcc.c-torture/execute/builtins/lib/main.c  -g
-O0 -flto --save-temps -fdump-ipa-all-details    -save-temps
evans:/abuild/jh/trunk-3/build-inst2/gcc/:[0]# grep memcpy *.s
ccNd9GvG.ltrans0.s:     .globl  memcpy
ccNd9GvG.ltrans0.s:     .type   memcpy, @function
ccNd9GvG.ltrans0.s:memcpy:
ccNd9GvG.ltrans0.s:     call    my_memcpy.2055
ccNd9GvG.ltrans0.s:     .size   memcpy, .-memcpy
ccNd9GvG.ltrans0.s:     .type   my_memcpy.2055, @function
ccNd9GvG.ltrans0.s:my_memcpy.2055:
ccNd9GvG.ltrans0.s:     .size   my_memcpy.2055, .-my_memcpy.2055
ccNd9GvG.ltrans0.s:     call    my_memcpy
ccNd9GvG.ltrans0.s:     call    my_memcpy
ccNd9GvG.ltrans0.s:     .string "memcpy"
ccNd9GvG.ltrans0.s:     .string "my_memcpy"

this is GCC bug where my_memcpy is once defined as alias and once as normal
function and declarations are not merged. 
This however should result in linktime error instead of producing binary.
In the binary the call to my_memcpy is linked to bogus destination:

   400a41:       e8 9c fb ff ff          callq  4005e2 <a>

I assume this is caused by fact that my_memcpy appears in original LTO symbol
tables.

Honza

-- 
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