[ARM] Improve veneer handling and introduce handlePlain method

Handle veneers only for call-like relocations.

llvm-svn: 234580
This commit is contained in:
Denis Protivensky 2015-04-10 09:54:10 +00:00
parent 4bf08947a1
commit b56dff5729
1 changed files with 13 additions and 1 deletions

View File

@ -297,12 +297,14 @@ template <class Derived> class ARMRelocationPass : public Pass {
case R_ARM_MOVT_ABS:
case R_ARM_THM_MOVW_ABS_NC:
case R_ARM_THM_MOVT_ABS:
static_cast<Derived *>(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<Derived *>(this)->handleIFUNC(atom, ref);
static_cast<Derived *>(this)->handlePlain(atom, ref);
static_cast<Derived *>(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) {