[ELF] Support for R_ARM_TARGET2 relocation
authorPeter Smith <peter.smith@linaro.org>
Mon, 17 Oct 2016 18:12:24 +0000 (18:12 +0000)
committerPeter Smith <peter.smith@linaro.org>
Mon, 17 Oct 2016 18:12:24 +0000 (18:12 +0000)
commit9bbd4e27a94cd6f45e659697c232d131494e84cb
treedcfe5aade8e62561e99ed3e343e6069e118700a8
parent9e1b6e108edb84effa57545caf2a83f22e4d4f37
[ELF] Support for R_ARM_TARGET2 relocation

The R_ARM_TARGET2 relocation is used in ARM exception tables to encode
a data dependency that will only be dereferenced by code in the
run-time support library. In a similar way to R_ARM_TARGET1 the
handling of the relocation is target specific, it maps to one of
R_ARM_ABS32, R_ARM_REL32 or R_ARM_GOT_PREL. The choice depends on the
run-time library. R_ARM_GOT_PREL is used for linux and BSD,
R_ARM_ABS32 and R_ARM_REL32 are used for bare-metal.

The command line option --target2=<target> can be used to select the
relocation used for R_ARM_TARGET2. The default is R_ARM_GOT_PREL.

Differential revision: https://reviews.llvm.org/D25684

llvm-svn: 284404
lld/ELF/Config.h
lld/ELF/Driver.cpp
lld/ELF/Options.td
lld/ELF/Target.cpp
lld/test/ELF/arm-target2.s [new file with mode: 0644]