<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - R_X86_64_32S: error while loading shared libraries: unexpected reloc type 0x0b"
href="https://bugs.llvm.org/show_bug.cgi?id=36923">36923</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>R_X86_64_32S: error while loading shared libraries: unexpected reloc type 0x0b
</td>
</tr>
<tr>
<th>Product</th>
<td>lld
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>shenhan@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=20136" name="attach_20136" title="test.cc that reproduces the problem">attachment 20136</a> <a href="attachment.cgi?id=20136&action=edit" title="test.cc that reproduces the problem">[details]</a></span>
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:
<span class="quote">>> clang++ -fuse-ld=lld -O2 -pie -Wl,-z,notext -O2 test.cc
>> readelf -WDr a.out </span >
'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
<a href="mailto:closedir@GLIBC_2.2.5">closedir@GLIBC_2.2.5</a> + 0
0000000000001177 0000000a0000000b R_X86_64_32S 0000000000001280
<a href="mailto:closedir@GLIBC_2.2.5">closedir@GLIBC_2.2.5</a> + 0
<span class="quote">>> ./a.out </span >
./a.out: error while loading shared libraries: unexpected reloc type 0x0b</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>