[PATCH] D89285: [lld-macho] Emit local symbols in symtab; record metadata in LC_DYSYMTAB

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 12 18:49:15 PDT 2020


int3 created this revision.
int3 added a reviewer: lld-macho.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
int3 requested review of this revision.

Symbols of the same type must be laid out contiguously: following ld64's
lead, we choose to emit all local symbols first, then external symbols,
and finally undefined symbols. For each symbol type, the LC_DYSYMTAB
load command will record the range (start index and total number) of
those symbols in the symbol table.

This work was motivated by the fact that LLDB won't search for debug
info if LC_DYSYMTAB says there are no local symbols (since STABS symbols
are all local symbols). With this change, LLDB is now able to display
the source lines at a given breakpoint when debugging our binaries.

Some tests had to be updated due to local symbol names now appearing in
`llvm-objdump`'s output.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D89285

Files:
  lld/MachO/SyntheticSections.cpp
  lld/MachO/SyntheticSections.h
  lld/MachO/Writer.cpp
  lld/test/MachO/stabs.s
  lld/test/MachO/subsections-symbol-relocs.s
  lld/test/MachO/symtab.s
  lld/test/MachO/tlv.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89285.297738.patch
Type: text/x-patch
Size: 14215 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201013/7e746a96/attachment.bin>


More information about the llvm-commits mailing list