summaryrefslogtreecommitdiff
path: root/ELF/Symbols.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-06-10 13:44:49 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-06-10 13:44:49 +0000
commit2079716dfb3fb7e4e24b8b2e85eb6780b981a0af (patch)
tree3b0c58e50948b450b50b20ae5a38c005128edfb5 /ELF/Symbols.cpp
parentb9a1baec33e911ca24f51abf882d454e62047ea6 (diff)
Vendor import of lld trunk r305145:vendor/lld/lld-trunk-r305145
Notes
svn path=/vendor/lld/dist/; revision=319788 svn path=/vendor/lld/lld-trunk-r305145/; revision=319789; tag=vendor/lld/lld-trunk-r305145
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,