Commit 9e7ce07a authored by Peter Collingbourne's avatar Peter Collingbourne Committed by Nick Desaulniers
Browse files

[UPSTREAM] ARM: Don't emit R_ARM_NONE relocations to compact unwinding...

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

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.

Differential Revision: https://reviews.llvm.org/D70027



(cherry picked from commit 1549b469)
Bug: 139945549
Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
Change-Id: Ibe9fca4b903758e1a75f2e21bf670740b78a795c
parent 956c6831
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment