[llvm-bugs] [Bug 36923] New: R_X86_64_32S: error while loading shared libraries: unexpected reloc type 0x0b

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Mar 27 13:29:13 PDT 2018


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

            Bug ID: 36923
           Summary: R_X86_64_32S: error while loading shared libraries:
                    unexpected reloc type 0x0b
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: shenhan at google.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 20136
  --> https://bugs.llvm.org/attachment.cgi?id=20136&action=edit
test.cc that reproduces the problem

Lld generated binary has R_X86_64_32S in dynamic relocation section, which is
wrong and rejected by dynamic loader at launch time:

"error while loading shared libraries: unexpected reloc type 0x0b"

I have an attachment that reproduces:

>> clang++ -fuse-ld=lld -O2 -pie -Wl,-z,notext -O2 test.cc
>> readelf -WDr a.out 

'RELA' relocation section at offset 0x550 contains 288 bytes:
    Offset             Info             Type               Symbol's Value 
Symbol's Name + Addend
... ...
0000000000001150  0000000a0000000b R_X86_64_32S           0000000000001280
closedir at GLIBC_2.2.5 + 0
0000000000001177  0000000a0000000b R_X86_64_32S           0000000000001280
closedir at GLIBC_2.2.5 + 0

>> ./a.out 
./a.out: error while loading shared libraries: unexpected reloc type 0x0b

-- 
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/20180327/d761df2a/attachment.html>


More information about the llvm-bugs mailing list