From b56dff5729d985d80f76d699fbb56e2ce854183e Mon Sep 17 00:00:00 2001 From: Denis Protivensky Date: Fri, 10 Apr 2015 09:54:10 +0000 Subject: [PATCH] [ARM] Improve veneer handling and introduce handlePlain method Handle veneers only for call-like relocations. llvm-svn: 234580 --- lld/lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lld/lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp b/lld/lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp index ebc0dd950330..ea84369f3619 100644 --- a/lld/lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp +++ b/lld/lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp @@ -297,12 +297,14 @@ template class ARMRelocationPass : public Pass { case R_ARM_MOVT_ABS: case R_ARM_THM_MOVW_ABS_NC: case R_ARM_THM_MOVT_ABS: + static_cast(this)->handlePlain(atom, ref); + break; case R_ARM_THM_CALL: case R_ARM_CALL: case R_ARM_JUMP24: case R_ARM_THM_JUMP24: case R_ARM_THM_JUMP11: - static_cast(this)->handleIFUNC(atom, ref); + static_cast(this)->handlePlain(atom, ref); static_cast(this)->handleVeneer(atom, ref); break; case R_ARM_TLS_IE32: @@ -666,6 +668,11 @@ public: ARMStaticRelocationPass(const elf::ARMLinkingContext &ctx) : ARMRelocationPass(ctx) {} + /// \brief Handle ordinary relocation references. + std::error_code handlePlain(const DefinedAtom &atom, const Reference &ref) { + return handleIFUNC(atom, ref); + } + /// \brief Get the veneer for ARM B/BL instructions. const VeneerAtom *getVeneer_ARM_B_BL(const DefinedAtom *da, StringRef secName) { @@ -728,6 +735,11 @@ public: ARMDynamicRelocationPass(const elf::ARMLinkingContext &ctx) : ARMRelocationPass(ctx) {} + /// \brief Handle ordinary relocation references. + std::error_code handlePlain(const DefinedAtom &atom, const Reference &ref) { + return handleIFUNC(atom, ref); + } + /// \brief Get the veneer for ARM B/BL instructions. const VeneerAtom *getVeneer_ARM_B_BL(const DefinedAtom *da, StringRef secName) {