<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:i@maskray.me" title="Fangrui Song <i@maskray.me>"> <span class="fn">Fangrui Song</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Cannot use a regular plt entry for R_386_PC32 with -pie/-shared"
href="https://bugs.llvm.org/show_bug.cgi?id=36678">bug 36678</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>CONFIRMED
</td>
<td>RESOLVED
</td>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>i@maskray.me
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>FIXED
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Cannot use a regular plt entry for R_386_PC32 with -pie/-shared"
href="https://bugs.llvm.org/show_bug.cgi?id=36678#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Cannot use a regular plt entry for R_386_PC32 with -pie/-shared"
href="https://bugs.llvm.org/show_bug.cgi?id=36678">bug 36678</a>
from <span class="vcard"><a class="email" href="mailto:i@maskray.me" title="Fangrui Song <i@maskray.me>"> <span class="fn">Fangrui Song</span></a>
</span></b>
<pre>Fixed by r327542
% ld.lld -shared a.o b.so -o a
ld.lld: error: relocation R_386_PC32 cannot be used against symbol foo;
recompile with -fPIC
<span class="quote">>>> defined in b.so
>>> referenced by a.o:(.text+0x1)</span >
% ld.lld -pie a.o b.so -o a
ld.lld: error: symbol 'foo' cannot be preempted; recompile with -fPIE
<span class="quote">>>> defined in b.so
>>> referenced by a.o:(.text+0x1)</span >
With -z notext, a text relocation R_386_PC32 is created.
% ld.bfd -m elf_i386 -pie a.o b.so -o a -z text
ld.bfd: a.o: warning: relocation against `foo' in read-only section `.text'
ld.bfd: read-only segment has dynamic relocations.
% ld.bfd -m elf_i386 -shared a.o b.so -o a -z text
ld.bfd: a.o: warning: relocation against `foo' in read-only section `.text'
ld.bfd: read-only segment has dynamic relocations.</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>