[PATCH] D97245: [lld-macho] Better deduplication of personality symbols

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 22 18:52:27 PST 2021


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

D95809: [lld-macho] Emit personalities in compact unwind <https://reviews.llvm.org/D95809> introduced a mechanism for synthetic symbol creation of personality
pointers. When multiple section relocations referred to the same personality
pointer, it would deduplicate them. However, it neglected to consider that we
could have symbol relocations that also refer to the same personality pointer.
This diff fixes it.

In practice, this mix of relocations arises when there is a statically-linked
personality routine that is referenced from multiple object files. Within the
same object file, it will be referred to via section relocations, but
(obviously) other object files will refer to it via symbol relocations. Failing
to deduplicate these references resulted in us going over the
3-personality-pointer limit when linking some larger applications.

Fixes llvm.org/PR48389.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97245

Files:
  lld/MachO/UnwindInfoSection.cpp
  lld/test/MachO/compact-unwind.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97245.325641.patch
Type: text/x-patch
Size: 7481 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210223/76671f0c/attachment.bin>


More information about the llvm-commits mailing list