<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - -rpath-link stores absolute path in NEEDED when library has RPATH of ".""
   href="https://llvm.org/bugs/show_bug.cgi?id=30330">30330</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>-rpath-link stores absolute path in NEEDED when library has RPATH of "."
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>FreeBSD
          </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>eric@vangyzen.net
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When using -rpath-link to link to a shared library that has an RPATH of ".",
lld stores the absolute path in the executable's NEEDED entry.  By contrast,
ld.bfd stores just the file name, with no path.

Steps to reproduce:

touch foo.c
echo 'int main(){return 0;}' > bar.c
clang -shared -Wl,-rpath,. -o libfoo.so foo.c

clang -fuse-ld=bfd -Wl,-rpath-link,$PWD -L$PWD -lfoo -o bar bar.c
objdump -x bar | grep libfoo
  NEEDED      libfoo.so

clang -fuse-ld=lld -Wl,-rpath-link,$PWD -L$PWD -lfoo -o bar bar.c
objdump -x bar | grep libfoo
  NEEDED      /home/evangyzen/tmp/lld/libfoo.so</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>