From 2079716dfb3fb7e4e24b8b2e85eb6780b981a0af Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 10 Jun 2017 13:44:49 +0000 Subject: Vendor import of lld trunk r305145: https://llvm.org/svn/llvm-project/lld/trunk@305145 --- ELF/Symbols.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'ELF/Symbols.cpp') 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 bool DefinedRegular::isMipsPIC() const { + typedef typename ELFT::Ehdr Elf_Ehdr; if (!Section || !isFunc()) return false; + + auto *Sec = cast(Section); + const Elf_Ehdr *Hdr = Sec->template getFile()->getObj().getHeader(); return (this->StOther & STO_MIPS_MIPS16) == STO_MIPS_PIC || - (cast(Section) - ->template getFile() - ->getObj() - .getHeader() - ->e_flags & - EF_MIPS_PIC); + (Hdr->e_flags & EF_MIPS_PIC); } Undefined::Undefined(StringRefZ Name, bool IsLocal, uint8_t StOther, -- cgit v1.3