summaryrefslogtreecommitdiff
path: root/ELF/Symbols.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ELF/Symbols.cpp')
-rw-r--r--ELF/Symbols.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/ELF/Symbols.cpp b/ELF/Symbols.cpp
index 67e57d9c8f00..8f9b20477b29 100644
--- a/ELF/Symbols.cpp
+++ b/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,