[LLVMbugs] [Bug 15919] LLVM can emit hidden undefined weak symbols which trip up Gold

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon May 6 12:04:30 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=15919

Rafael Ávila de Espíndola <rafael.espindola at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from Rafael Ávila de Espíndola <rafael.espindola at gmail.com> ---
It does look like a gold issue. It reproduces with no plugin at all:

$ cat test.s 
    .file    "test.bc"
    .text
    .globl    f
    .align    16, 0x90
    .type    f, at function
f:                                      # @f
    .cfi_startproc
# BB#0:
    pushq    %rax
.Ltmp1:
    .cfi_def_cfa_offset 16
    callq    _stdio_init
    popq    %rax
    ret
.Ltmp2:
    .size    f, .Ltmp2-f
    .cfi_endproc

    .hidden    _stdio_init
    .weak    _stdio_init

    .section    ".note.GNU-stack","", at progbits


Trying to link that into a shared library causes an error:

test.o: requires dynamic R_X86_64_PC32 reloc against '_stdio_init' which may
overflow at runtime; recompile with -fPIC
error: hidden symbol '_stdio_init' is not defined locally

The same link link line with the bfd linker works and produces a call to
address 0 since the weak symbol is undefined.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130506/52d459e4/attachment.html>


More information about the llvm-bugs mailing list