<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 - lld/MachO mislinks program that has several symbols at same offset"
   href="https://bugs.llvm.org/show_bug.cgi?id=50262">50262</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>lld/MachO mislinks program that has several symbols at same offset
          </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>All
          </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>MachO
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>nicolasweber@gmx.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>gkm@fb.com, jezreel@gmail.com, llvm-bugs@lists.llvm.org, smeenai@fb.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I ran into this while writing tests for a patch I'm working on. It happens
without my patch too though:


thakis@MBP llvm-project % cat share.s
.globl _foo, _bar, _baz
.weak_definition _bar

_foo:
  retq

_bar:
_baz:
  retq

.subsections_via_symbols

thakis@MBP llvm-project % cat share2.s
.globl _main, _foo, _bar

.weak_definition _bar
_bar:
  retq

_main:
  callq _foo
  callq _bar

thakis@MBP llvm-project % out/gn/bin/clang++ share.s share2.s -isysroot $(xcrun
-show-sdk-path) -fuse-ld=lld
ld64.lld: warning: Option `-no_deduplicate' is not yet implemented. Stay
tuned...

thakis@MBP llvm-project % ./a.out
zsh: bus error  ./a.out


Works fine with ld64.


(I didn't see this in any "actual" code, so probably not super high priority.)</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>