[lld] r235030 - [Mips] Check `_gp_disp` symbol using a trivial string comparison
Simon Atanasyan
simon at atanasyan.com
Wed Apr 15 11:31:45 PDT 2015
Author: atanasyan
Date: Wed Apr 15 13:31:44 2015
New Revision: 235030
URL: http://llvm.org/viewvc/llvm-project?rev=235030&view=rev
Log:
[Mips] Check `_gp_disp` symbol using a trivial string comparison
No functional changes.
Modified:
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetLayout.h
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp?rev=235030&r1=235029&r2=235030&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp Wed Apr 15 13:31:44 2015
@@ -563,9 +563,7 @@ std::error_code RelocationHandler<ELFT>:
assert(ref.kindArch() == Reference::KindArch::Mips);
uint64_t gpAddr = _targetLayout.getGPAddr();
-
- AtomLayout *gpDispAtom = _targetLayout.getGPDisp();
- bool isGpDisp = gpDispAtom && ref.target() == gpDispAtom->_atom;
+ bool isGpDisp = ref.target()->name() == "_gp_disp";
uint8_t *atomContent = buf.getBufferStart() + atom._fileOffset;
uint8_t *location = atomContent + ref.offsetInAtom();
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetLayout.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetLayout.h?rev=235030&r1=235029&r2=235030&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetLayout.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetLayout.h Wed Apr 15 13:31:44 2015
@@ -51,14 +51,6 @@ public:
return _gpAddr;
}
- /// \brief Get '_gp_disp' symbol atom layout.
- AtomLayout *getGPDisp() {
- std::call_once(_gpDispOnce, [this]() {
- _gpDispAtom = this->findAbsoluteAtom("_gp_disp");
- });
- return _gpDispAtom;
- }
-
/// \brief Return the section order for a input section
typename TargetLayout<ELFT>::SectionOrder
getSectionOrder(StringRef name, int32_t contentType,
@@ -81,9 +73,7 @@ private:
MipsGOTSection<ELFT> *_gotSection;
MipsPLTSection<ELFT> *_pltSection;
uint64_t _gpAddr = 0;
- AtomLayout *_gpDispAtom = nullptr;
std::once_flag _gpOnce;
- std::once_flag _gpDispOnce;
};
} // end namespace elf
More information about the llvm-commits
mailing list