summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Protivensky <dprotivensky@accesssoftek.com>2015-04-15 09:57:04 +0000
committerDenis Protivensky <dprotivensky@accesssoftek.com>2015-04-15 09:57:04 +0000
commit7f6b22ee841ca1023acd4b0004b865c14947fef4 (patch)
tree08e75062e7502de03b833f5bc12e1e18378a975f
parentbcb4a8fe1b8aaaa48fc8f8e10eb8df48524a44d6 (diff)
downloadbcm5719-llvm-7f6b22ee841ca1023acd4b0004b865c14947fef4.tar.gz
bcm5719-llvm-7f6b22ee841ca1023acd4b0004b865c14947fef4.zip
[ARM] Pass Thumb flag to handler methods instead of atom
llvm-svn: 234989
-rw-r--r--lld/lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/lld/lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp b/lld/lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp
index 62e0a6c0aae..81f8885375b 100644
--- a/lld/lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp
+++ b/lld/lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp
@@ -332,14 +332,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);
+ static_cast<Derived *>(this)->handlePlain(isThumbCode(&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)->handlePlain(atom, ref);
+ static_cast<Derived *>(this)->handlePlain(isThumbCode(&atom), ref);
static_cast<Derived *>(this)->handleVeneer(atom, ref);
break;
case R_ARM_TLS_IE32:
@@ -524,11 +524,11 @@ protected:
///
/// This create a PLT and GOT entry for the IFUNC if one does not exist. The
/// GOT entry and a IRELATIVE relocation to the original target resolver.
- std::error_code handleIFUNC(const DefinedAtom &atom, const Reference &ref) {
+ std::error_code handleIFUNC(bool fromThumb, const Reference &ref) {
auto target = dyn_cast<const DefinedAtom>(ref.target());
if (target && target->contentType() == DefinedAtom::typeResolver) {
const_cast<Reference &>(ref)
- .setTarget(getIFUNCPLTEntry(target, isThumbCode(atom.codeModel())));
+ .setTarget(getIFUNCPLTEntry(target, fromThumb));
}
return std::error_code();
}
@@ -727,8 +727,8 @@ public:
: ARMRelocationPass(ctx) {}
/// \brief Handle ordinary relocation references.
- std::error_code handlePlain(const DefinedAtom &atom, const Reference &ref) {
- return handleIFUNC(atom, ref);
+ std::error_code handlePlain(bool fromThumb, const Reference &ref) {
+ return handleIFUNC(fromThumb, ref);
}
/// \brief Get the veneer for ARM B/BL instructions.
@@ -813,17 +813,16 @@ public:
}
/// \brief Handle ordinary relocation references.
- std::error_code handlePlain(const DefinedAtom &atom, const Reference &ref) {
+ std::error_code handlePlain(bool fromThumb, const Reference &ref) {
if (auto sla = dyn_cast<SharedLibraryAtom>(ref.target())) {
if (sla->type() == SharedLibraryAtom::Type::Data) {
llvm_unreachable("Handle object entries");
} else if (sla->type() == SharedLibraryAtom::Type::Code) {
- const_cast<Reference &>(ref)
- .setTarget(getPLTEntry(sla, isThumbCode(atom.codeModel())));
+ const_cast<Reference &>(ref).setTarget(getPLTEntry(sla, fromThumb));
}
return std::error_code();
}
- return handleIFUNC(atom, ref);
+ return handleIFUNC(fromThumb, ref);
}
/// \brief Get the veneer for ARM B/BL instructions.
OpenPOWER on IntegriCloud