[ELF][ARM] Recommit Redesign of .ARM.exidx handling to use a SyntheticSection
authorPeter Smith <peter.smith@linaro.org>
Thu, 28 Mar 2019 11:10:20 +0000 (11:10 +0000)
committerPeter Smith <peter.smith@linaro.org>
Thu, 28 Mar 2019 11:10:20 +0000 (11:10 +0000)
commit3ce9af9370d091b7d959902216482f3015e965fc
tree8972cd55f54fd89071cacfcae0acaf37362e6002
parent13ef0c530913c904dc44f438e96fe684810e7b0a
[ELF][ARM] Recommit Redesign of .ARM.exidx handling to use a SyntheticSection

Recommit r356666 with fixes for buildbot failure, as well as handling for
--emit-relocs, which we decide not to emit any relocation sections as the
table is already position independent and an offline tool can deduce the
relocations.

Instead of creating extra Synthetic .ARM.exidx sections to account for
gaps in the table, create a single .ARM.exidx SyntheticSection that can
derive the contents of the gaps from a sorted list of the executable
InputSections. This has the benefit of moving the ARM specific code for
SyntheticSections in SHF_LINK_ORDER processing and the table merging code
into the ARM specific SyntheticSection. This also makes it easier to create
EXIDX_CANTUNWIND table entries for executable InputSections that don't
have an associated .ARM.exidx section.

Fixes pr40277

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

llvm-svn: 357160
13 files changed:
lld/ELF/OutputSections.cpp
lld/ELF/SyntheticSections.cpp
lld/ELF/SyntheticSections.h
lld/ELF/Writer.cpp
lld/test/ELF/arm-data-prel.s
lld/test/ELF/arm-exidx-add-missing.s [new file with mode: 0644]
lld/test/ELF/arm-exidx-canunwind.s
lld/test/ELF/arm-exidx-dedup.s
lld/test/ELF/arm-exidx-discard.s
lld/test/ELF/arm-exidx-emit-relocs.s [new file with mode: 0644]
lld/test/ELF/arm-exidx-gc.s
lld/test/ELF/arm-exidx-shared.s
lld/test/ELF/arm-exidx-synthetic-link.s [new file with mode: 0644]