[llvm-bugs] [Bug 50262] New: lld/MachO mislinks program that has several symbols at same offset

via llvm-bugs llvm-bugs at lists.llvm.org
Fri May 7 07:44:44 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=50262

            Bug ID: 50262
           Summary: lld/MachO mislinks program that has several symbols at
                    same offset
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: MachO
          Assignee: unassignedbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: gkm at fb.com, jezreel at gmail.com,
                    llvm-bugs at lists.llvm.org, smeenai at fb.com

I ran into this while writing tests for a patch I'm working on. It happens
without my patch too though:


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

_foo:
  retq

_bar:
_baz:
  retq

.subsections_via_symbols

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

.weak_definition _bar
_bar:
  retq

_main:
  callq _foo
  callq _bar

thakis at 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 at 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.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210507/fb846300/attachment.html>


More information about the llvm-bugs mailing list