<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 - Missing dyn symbol for a weak wrapped function when using --wrap"
   href="https://bugs.llvm.org/show_bug.cgi?id=49897">bug 49897</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;">Resolution</td>
           <td>---
           </td>
           <td>FIXED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </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;">Assignee</td>
           <td>unassignedbugs@nondot.org
           </td>
           <td>i@maskray.me
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Missing dyn symbol for a weak wrapped function when using --wrap"
   href="https://bugs.llvm.org/show_bug.cgi?id=49897#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Missing dyn symbol for a weak wrapped function when using --wrap"
   href="https://bugs.llvm.org/show_bug.cgi?id=49897">bug 49897</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>I'll consider this a bug because ld.lld produced an R_X86_64_JUMP_SLOT
relocation referencing the index 0 undefined symbol, which would be errored by
glibc (see commit 7c74ce3c686938e95a08a05ea1e2a714eac43167).

Fixed by 7c74ce3c686938e95a08a05ea1e2a714eac43167: [ELF] --wrap: don't clear
sym->isUsedInRegularObj if real->isUsedInRegularObj; set wrap's initial binding
to sym's

I fixed another bug: if `__wrap_foo` does not exist, its initial binding should
be `foo`'s.

I can still observe a difference with GNU ld which probably does not matter in
practice: if foo does not exist, --wrap=foo is a no-op in ld.lld. However, GNU
ld can still redirect __real_foo to foo.</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>