[lld] r224815 - [Mips] Factor out the code checks a symbol's binding
Simon Atanasyan
simon at atanasyan.com
Wed Dec 24 04:19:30 PST 2014
Author: atanasyan
Date: Wed Dec 24 06:19:30 2014
New Revision: 224815
URL: http://llvm.org/viewvc/llvm-project?rev=224815&view=rev
Log:
[Mips] Factor out the code checks a symbol's binding
No functional changes.
Modified:
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.h
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.h?rev=224815&r1=224814&r2=224815&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.h Wed Dec 24 06:19:30 2014
@@ -215,13 +215,10 @@ private:
switch (rel.getType(isMips64EL())) {
case llvm::ELF::R_MIPS_HI16:
return llvm::ELF::R_MIPS_LO16;
- case llvm::ELF::R_MIPS_GOT16: {
- const Elf_Sym *symbol =
- this->_objFile->getSymbol(rel.getSymbol(isMips64EL()));
- if (symbol->getBinding() == llvm::ELF::STB_LOCAL)
+ case llvm::ELF::R_MIPS_GOT16:
+ if (isLocalBinding(rel))
return llvm::ELF::R_MIPS_LO16;
}
- }
return llvm::ELF::R_MIPS_NONE;
}
@@ -234,6 +231,10 @@ private:
}
bool isMips64EL() const { return this->_objFile->isMips64EL(); }
+ bool isLocalBinding(const Elf_Rel &rel) {
+ return this->_objFile->getSymbol(rel.getSymbol(isMips64EL()))
+ ->getBinding() == llvm::ELF::STB_LOCAL;
+ }
};
template <class ELFT> class MipsDynamicFile : public DynamicFile<ELFT> {
More information about the llvm-commits
mailing list