[PATCH] D105364: [lld-macho] Drop assertions that all symbols are in GOT

Vy Nguyen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 8 18:52:53 PDT 2021


oontvoo planned changes to this revision.
oontvoo added a comment.

Here is the simplest set repro steps:

  echo 'int main() {return 0;}' > foo.c
  echo 'int getX() {return 123;}' > bar.c
  
  clang -c -g -o foo.o foo.c  
  clang -c -g -o  bar_1.o  bar.c  
  ld -r -o bar.o bar_1.o
  
  ld64.lld.darwinnew --error-limit=0 -dynamic  -arch x86_64  -platform_version macos  11.0.0 14.5 foo.o bar.o
  
  ----------------------------------------
  ld64.lld.darwinnew: /mnt/ssd/repo/llvm-project/lld/MachO/UnwindInfoSection.cpp:265: void relocateCompactUnwind(lld::macho::ConcatOutputSection*, std::vector<lld::macho::CompactUnwindEntry<Ptr> >&) [with Ptr = long unsigned int]: Assertion `referentSym->isInGot()' failed.
  PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
  Stack dump:
  0.	Program arguments: ./bin/ld64.lld.darwinnew --error-limit=0 -dynamic -arch x86_64 -platform_version macos 11.0.0 14.5 cpp/foo_cpp.o cpp/bar_cpp_2.o
   #0 0x000055f75a27eefd llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /mnt/ssd/repo/llvm-project/llvm/lib/Support/Unix/Signals.inc:565:22
   #1 0x000055f75a27efb4 PrintStackTraceSignalHandler(void*) /mnt/ssd/repo/llvm-project/llvm/lib/Support/Unix/Signals.inc:632:1
   #2 0x000055f75a27cfaa llvm::sys::RunSignalHandlers() /mnt/ssd/repo/llvm-project/llvm/lib/Support/Signals.cpp:76:20
   #3 0x000055f75a27e950 SignalHandler(int) /mnt/ssd/repo/llvm-project/llvm/lib/Support/Unix/Signals.inc:407:1
   #4 0x00007fc016723140 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14140)
   #5 0x00007fc016206ce1 raise ./signal/../sysdeps/unix/sysv/linux/raise.c:51:1
   #6 0x00007fc0161f0537 abort ./stdlib/abort.c:81:7
   #7 0x00007fc0161f040f get_sysdep_segment_value ./intl/loadmsgcat.c:509:8
   #8 0x00007fc0161f040f _nl_load_domain ./intl/loadmsgcat.c:970:34
   #9 0x00007fc0161ff662 (/lib/x86_64-linux-gnu/libc.so.6+0x34662)
  #10 0x000055f75a7edb8a void relocateCompactUnwind<unsigned long>(lld::macho::ConcatOutputSection*, std::vector<lld::macho::CompactUnwindEntry<unsigned long>, std::allocator<lld::macho::CompactUnwindEntry<unsigned long> > >&) /mnt/ssd/repo/llvm-project/lld/MachO/UnwindInfoSection.cpp:266:48
  #11 0x000055f75a7f2dee UnwindInfoSectionImpl<unsigned long>::finalize() /mnt/ssd/repo/llvm-project/lld/MachO/UnwindInfoSection.cpp:391:43
  #12 0x000055f75a7ba989 (anonymous namespace)::Writer::assignAddresses(lld::macho::OutputSegment*) /mnt/ssd/repo/llvm-project/lld/MachO/Writer.cpp:1019:27
  #13 0x000055f75a7ba592 (anonymous namespace)::Writer::finalizeAddresses() /mnt/ssd/repo/llvm-project/lld/MachO/Writer.cpp:973:22
  #14 0x000055f75a7bb705 void (anonymous namespace)::Writer::run<lld::macho::LP64>() /mnt/ssd/repo/llvm-project/lld/MachO/Writer.cpp:1095:26
  #15 0x000055f75a7c5ec8 void lld::macho::writeResult<lld::macho::LP64>() /mnt/ssd/repo/llvm-project/lld/MachO/Writer.cpp:1100:49
  #16 0x000055f75a733407 lld::macho::link(llvm::ArrayRef<char const*>, bool, llvm::raw_ostream&, llvm::raw_ostream&) /mnt/ssd/repo/llvm-project/lld/MachO/Driver.cpp:1422:24
  #17 0x000055f75a1d2582 lldMain(int, char const**, llvm::raw_ostream&, llvm::raw_ostream&, bool) /mnt/ssd/repo/llvm-project/lld/tools/lld/lld.cpp:152:12
  #18 0x000055f75a1d2953 main /mnt/ssd/repo/llvm-project/lld/tools/lld/lld.cpp:206:19
  #19 0x00007fc0161f1d0a __libc_start_main ./csu/../csu/libc-start.c:308:16
  #20 0x000055f75a1d17aa _start (./bin/ld64.lld.darwinnew+0xe367aa)
  Aborted


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105364/new/

https://reviews.llvm.org/D105364



More information about the llvm-commits mailing list