<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:ck@remobjects.com" title="Carlo Kok <ck@remobjects.com>"> <span class="fn">Carlo Kok</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - ELF executable generated with lld crashes when reading DYNAMIC link_map on x86-64"
   href="https://llvm.org/bugs/show_bug.cgi?id=28040">bug 28040</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 - ELF executable generated with lld crashes when reading DYNAMIC link_map on x86-64"
   href="https://llvm.org/bugs/show_bug.cgi?id=28040#c7">Comment # 7</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - ELF executable generated with lld crashes when reading DYNAMIC link_map on x86-64"
   href="https://llvm.org/bugs/show_bug.cgi?id=28040">bug 28040</a>
              from <span class="vcard"><a class="email" href="mailto:ck@remobjects.com" title="Carlo Kok <ck@remobjects.com>"> <span class="fn">Carlo Kok</span></a>
</span></b>
        <pre>So this ended up being a user error. Below code isn't supposed to work at all,
from the glibc mailing list:

<span class="quote">> The l_addr is a *relocation*, or a delta between first PT_LOAD
> .p_vaddr and the actual load address.</span >

<span class="quote">> For non-PIE ET_EXEC, this delta is always 0. For non-prelinked ET_DYN
> (which are normally linked with first PT_LOAD .p_vaddr == 0) it's the
> actual load address (this is why it works most of the time).</span >

<span class="quote">> But for any prelinked ET_DYN binary with first PT_LOAD .p_vaddr != 0,
> this will crash and burn. See also "man prelink".</span >

The reason this hit at all for me is because my compiler didn't emit version
records in the dummy .so files so weak dl_iterate_phdr wouldn't be resolved by
the loader. libGC (boehm) used the code above as a fallback.

closed the issue as invalid.</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>