<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 - valgrind missing debug info on LLD linked binaries"
   href="https://bugs.llvm.org/show_bug.cgi?id=37021">37021</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>valgrind missing debug info on LLD linked binaries
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lld
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>ELF
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>superjoe30@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When linking a clang-produced .o file with LLD, valgrind does not see the debug
info. However when linking the same .o file with binutils ld, valgrind does see
the debug info.

Upstream issue: <a href="https://github.com/zig-lang/zig/issues/896">https://github.com/zig-lang/zig/issues/896</a>

Steps to reproduce:


// test.c
static int *foo(void) {
    return (int *)10000000;
}

int main(void) {
    int *x = foo();
    *x += 1;
}


// looks good with binutils ld
clang -o test test.c -g
valgrind ./test
==23250==    at 0x400597: main (test.c:7)


// with lld, valgrind does not see debug info
clang -o test test.c -g -fuse-ld=lld
valgrind ./test
==24210==    at 0x2010F7: ??? (in /home/andy/tmp/test)



<a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - lld's debug info is not compatible with valgrind"
   href="show_bug.cgi?id=35032">https://bugs.llvm.org/show_bug.cgi?id=35032</a> seems like a duplicate, but it is
marked fixed, and this seems to still be an issue in trunk.</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>