<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 INVALID - LLD sometimes nondeterministically swaps _end and _edata in the string table"
href="https://bugs.llvm.org/show_bug.cgi?id=45746">bug 45746</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>NEW
</td>
<td>RESOLVED
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>INVALID
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - LLD sometimes nondeterministically swaps _end and _edata in the string table"
href="https://bugs.llvm.org/show_bug.cgi?id=45746#c5">Comment # 5</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - LLD sometimes nondeterministically swaps _end and _edata in the string table"
href="https://bugs.llvm.org/show_bug.cgi?id=45746">bug 45746</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>See <a href="https://reviews.llvm.org/D79222">https://reviews.llvm.org/D79222</a>
I am not sure we want to make this change. I believe lld's current behavior is
consistent with GNU ld and gold.
```
% clang -fuse-ld=bfd a.c -lX11 -o a && readelf -W --dyn-syms a
...
3: 0000000000404028 0 NOTYPE GLOBAL DEFAULT 21 _edata
4: 0000000000404030 0 NOTYPE GLOBAL DEFAULT 22 _end
```
GNU ld's internal linker script includes:
` _edata = .; PROVIDE (edata = .);`
So `_edata` is always available (in .symtab). It will end up in .dynsym if it
can preempt `_edata` in a shared object (libX11.so.6) or is exported via other
mechanisms.
lld's current behavior matches GNU ld w.r.t. .dynsym, but the .symtab entry is
optional.
It may be useful to understand why libX11.so.6 exports `_edata` and `_end`.
References within `libX11.so.6` will get bound to `_edata` and `_end` defined
in the main executable (preempted), which may be non-intuitive to many users.</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>