[PATCH] D25721: [LLD][ARM] Allow relative exceptions relocations in shared libraries

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 18 03:40:51 PDT 2016


peter.smith created this revision.
peter.smith added reviewers: ruiu, rafael.
peter.smith added a subscriber: llvm-commits.
Herald added subscribers: rengolin, aemerson.

The R_ARM_NONE and R_ARM_PREL31 relocations are currently faulted when used in a shared object with:
can't create dynamic relocation R_ARM_NONE against symbol __aeabi_unwind_cpp_pr0
can't create dynamic relocation R_ARM_PREL31 against symbol __gxx_personality_v0

In the case of R_ARM_NONE this is because the R_ARM_NONE relocation is R_ABS when it should be relative, and it should be skipped in the same way that a R_HINT is handled as it should not affect any PLT-generation. Unfortunately R_ARM_NONE can't map to R_HINT as R_HINT has side-effects for TLS generation. I've introduced a R_NONE RelExpr to handle R_ARM_NONE in shared objects.

In the case of R_ARM_PREL31 this should map to R_PLT_PC as the personality routine can be imported so in a shared object the R_ARM_PREL31 has to resolve to the address of the PLT entry for the personality routine.


https://reviews.llvm.org/D25721

Files:
  ELF/InputSection.cpp
  ELF/Relocations.cpp
  ELF/Relocations.h
  ELF/Target.cpp
  test/ELF/arm-exidx-shared.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25721.74964.patch
Type: text/x-patch
Size: 4227 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161018/11ac2b0b/attachment.bin>


More information about the llvm-commits mailing list