[PATCH] D92904: [lld-macho] Don't attempt to emit rebase opcodes for debug sections

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 8 18:35:34 PST 2020


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

This was causing a crash as we were attempting to look up the
nonexistent parent OutputSection of the debug sections. We didn't detect
it earlier because there was no test for PIEs with debug info (PIEs
require us to emit rebases for X86_64_RELOC_UNSIGNED).

This diff filters out the debug sections while loading the ObjFiles. In
addition to fixing the above problem, it also lets us avoid doing
redundant work -- we no longer parse / apply relocations / attempt to
emit dyld opcodes for these sections that we don't emit.

Fixes bug 48392.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92904

Files:
  lld/MachO/Dwarf.cpp
  lld/MachO/InputFiles.cpp
  lld/MachO/InputFiles.h
  lld/MachO/Writer.cpp
  lld/test/MachO/stabs.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92904.310405.patch
Type: text/x-patch
Size: 4790 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201209/10c560ec/attachment.bin>


More information about the llvm-commits mailing list