<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/59419>59419</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [lld] After c30e6447c02, duplicate symbol errors with dtrace-processed object files
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            lld:ELF
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          DimitryAndric
      </td>
    </tr>
</table>

<pre>
    As reported in https://bugs.freebsd.org/265516, https://bugs.freebsd.org/260947 but also visible in https://pkg-status.freebsd.org/gohan05/data/maini386PR265425-default/2022-12-06_12h24m32s/logs/errors/ghc-9.2.5.log, with lld 15 several FreeBSD ports using DTrace error out with "duplicate symbol" errors, specifically for DTrace-related symbols.

Bisection shows that this started appearing after c30e6447c0225f675773d07f2b6d4e3c2b962155 ("[ELF] Move section assignment from initializeSymbols to postParse"), possibly due to the "Postpone reporting duplicate symbol errors so that the messages have the section information" item described in the commit message.

Reproduction tarball with perl 5.36 objects: [lld-dtrace-dupe.tar.gz](https://github.com/llvm/llvm-project/files/10195424/lld-dtrace-dupe.tar.gz)

@emaste reported in https://bugs.freebsd.org/258872#c4 that this may have something to do with DTrace making local symbols hidden. Still, it is strange that a seemingly internal-only change in lld causes errors that weren't there before.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUlE2PpDYQhn-N-1JqBAXm48ChZzt9SqTVTu6RwQU4azBymRn1_vrI0K3sThIpe2lQU66P933KitmMC1Er5IuQ15PawuR8ezWzCf5-WbQ3_alz-t5eGDytzgfSYBaYQlhZ5BeBN4G3bhs5GTxRxzpxfhR4w1LKrBT46f-Epk1RQbcFUJYdvBk2naV_llm_jmcOKmwfM4xuUksqBd60CkrgbVZmMXldfv6CpSxQnjUNarMhVksRzxme0_KPDCcs5hxZ4M26MT7Ie-fjyzj15ybBRCbWjXGMdxMmsFZDJo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