[all-commits] [llvm/llvm-project] 1549b4: ARM: Don't emit R_ARM_NONE relocations to compact ...

pcc via All-commits all-commits at lists.llvm.org
Tue Nov 12 10:53:40 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 1549b4699a84838c3969590dc4f757b72f39f40d
      https://github.com/llvm/llvm-project/commit/1549b4699a84838c3969590dc4f757b72f39f40d
  Author: Peter Collingbourne <peter at pcc.me.uk>
  Date:   2019-11-12 (Tue, 12 Nov 2019)

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

  Log Message:
  -----------
  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




More information about the All-commits mailing list