[llvm-bugs] [Bug 30984] New: [ELF] - Relocatable output incorrectly handles __tls_get_addr

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Nov 11 04:31:31 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=30984

            Bug ID: 30984
           Summary: [ELF] - Relocatable output incorrectly handles
                    __tls_get_addr
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: grimar at accesssoftek.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

cad/iverilog fails to link under FreeBSD with next error:

/usr/bin/ld: error: relocation R_X86_64_PLT32 cannot refer to absolute symbol
__tls_get_addr

Seems we have a problem with -r.
getp.o file has:
9: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND __tls_get_addr

After running -r LLD converts it to hidden absolute:
root at freebsd:/usr/ports/cad/iverilog # ld -r -o test getp.o
root at freebsd:/usr/ports/cad/iverilog # readelf -s test
Symbol table '.symtab' contains 11 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
...
     8: 0000000000000000     0 NOTYPE  GLOBAL HIDDEN  ABS __tls_get_addr

ld.bfd in the same sutuation leaves it as is:
root at freebsd:/usr/ports/cad/iverilog # ld.bfd -r -o test getp.o 
root at freebsd:/usr/ports/cad/iverilog # readelf -s test
Symbol table '.symtab' contains 16 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
...
    11: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND __tls_get_addr

I am going to fix that.

-- 
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/20161111/0149b660/attachment.html>


More information about the llvm-bugs mailing list