summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2017-06-09 21:09:08 +0000
committerRui Ueyama <ruiu@google.com>2017-06-09 21:09:08 +0000
commitd97265f79273a98f13b447949fda196d1c2330bf (patch)
tree28e710f8baae99d87dc09e51f28e1c4406803551
parent0d54c46cddaaf23b2c8d2f0d4a9a7c10b79fff4a (diff)
downloadbcm5719-llvm-d97265f79273a98f13b447949fda196d1c2330bf.tar.gz
bcm5719-llvm-d97265f79273a98f13b447949fda196d1c2330bf.zip
Simplify. NFC.
llvm-svn: 305112
-rw-r--r--lld/ELF/Symbols.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp
index 67e57d9c8f0..8f9b20477b2 100644
--- a/lld/ELF/Symbols.cpp
+++ b/lld/ELF/Symbols.cpp
@@ -264,15 +264,14 @@ Defined::Defined(Kind K, StringRefZ Name, bool IsLocal, uint8_t StOther,
: SymbolBody(K, Name, IsLocal, StOther, Type) {}
template <class ELFT> bool DefinedRegular::isMipsPIC() const {
+ typedef typename ELFT::Ehdr Elf_Ehdr;
if (!Section || !isFunc())
return false;
+
+ auto *Sec = cast<InputSectionBase>(Section);
+ const Elf_Ehdr *Hdr = Sec->template getFile<ELFT>()->getObj().getHeader();
return (this->StOther & STO_MIPS_MIPS16) == STO_MIPS_PIC ||
- (cast<InputSectionBase>(Section)
- ->template getFile<ELFT>()
- ->getObj()
- .getHeader()
- ->e_flags &
- EF_MIPS_PIC);
+ (Hdr->e_flags & EF_MIPS_PIC);
}
Undefined::Undefined(StringRefZ Name, bool IsLocal, uint8_t StOther,
OpenPOWER on IntegriCloud