[PATCH] D70027: ARM: Don't emit R_ARM_NONE relocations to compact unwinding decoders in .ARM.exidx on Android.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 8 13:38:49 PST 2019


pcc created this revision.
pcc added reviewers: rprichard, peter.smith.
Herald added subscribers: hiraditya, kristof.beyls, srhines.
Herald added a project: LLVM.

These relocations are specified by the ARM EHABI (section 6.3). As I understand
it, their purpose is to accommodate unwinder implementations that wish to
reduce code size by placing the implementations of the compact unwinding
decoders in a separate translation unit, and using extern weak symbols to
refer to them from the main unwinder implementation, so that they are only
linked when something in the binary needs them in order to unwind.

However, neither of the unwinders used on Android (libgcc, LLVM libunwind)
use this technique, and in fact emitting these relocations ends up being
counterproductive to code size because they cause a copy of the unwinder
to be statically linked into most binaries, regardless of whether it is
actually needed. Furthermore, these relocations create circular dependencies
(between libc and the unwinder) in cases where the unwinder is dynamically
linked and libc contains compact unwind info.

Therefore, deviate from the EHABI here and stop emitting these relocations
on Android.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70027

Files:
  llvm/include/llvm/MC/MCELFStreamer.h
  llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
  llvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
  llvm/test/MC/ARM/eh-compact-pr0.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70027.228516.patch
Type: text/x-patch
Size: 5832 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191108/aead6273/attachment.bin>


More information about the llvm-commits mailing list