<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 - Should LLD synthesize STT_FILE symbols when copying local symbols?"
   href="https://bugs.llvm.org/show_bug.cgi?id=48023">48023</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Should LLD synthesize STT_FILE symbols when copying local symbols?
          </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>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </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>i@maskray.me
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, smithp352@googlemail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The ELF spec says

<span class="quote">> STT_FILE - Conventionally, the symbol's name gives the name of the source file associated with the object file. A file symbol has STB_LOCAL binding, its section index is SHN_ABS, and it precedes the other STB_LOCAL symbols for the file, if it is present.</span >

If an object file has STB_LOCAL non-STT_SECTION symbols like (ARM $a). LLD
copies them to the output which may be attributed to the previous file (with
STT_FILE).

If we synthesize a STB_LOCAL STT_FILE SHN_ABS symbol, we can resolve this
problem.
However, this behavior can be inconvenient in some cases.

The compiler passes the absolute paths of files like crti.o crtn.o to ld.bfd,
so ld.bfd will synthesize STT_FILE symbols with absolute paths.

If the user wants to pursue "Local determinism: Like incremental basic
determinism, but builds are also independent of the name of the build
directory"
(<a href="https://blog.llvm.org/2019/11/deterministic-builds-with-clang-and-lld.html">https://blog.llvm.org/2019/11/deterministic-builds-with-clang-and-lld.html</a>),
the absolute path can actually get in the way.</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>