File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -658,18 +658,21 @@ template <class ELFT> bool MIPS<ELFT>::usesOnlyLowPageBits(RelType Type) const {
658
658
659
659
// Return true if the symbol is a PIC function.
660
660
template <class ELFT > bool elf::isMipsPIC (const Defined *Sym) {
661
- typedef typename ELFT::Ehdr Elf_Ehdr;
662
- if (!Sym->Section || !Sym->isFunc ())
661
+ if (!Sym->isFunc ())
663
662
return false ;
664
663
665
- auto *Sec = cast<InputSectionBase>(Sym->Section );
666
- ObjFile<ELFT> *File = Sec->template getFile <ELFT>();
664
+ if (Sym->StOther & STO_MIPS_PIC)
665
+ return true ;
666
+
667
+ if (!Sym->Section )
668
+ return false ;
669
+
670
+ ObjFile<ELFT> *File =
671
+ cast<InputSectionBase>(Sym->Section )->template getFile <ELFT>();
667
672
if (!File)
668
673
return false ;
669
674
670
- const Elf_Ehdr *Hdr = File->getObj ().getHeader ();
671
- return (Sym->StOther & STO_MIPS_MIPS16) == STO_MIPS_PIC ||
672
- (Hdr->e_flags & EF_MIPS_PIC);
675
+ return File->getObj ().getHeader ()->e_flags & EF_MIPS_PIC;
673
676
}
674
677
675
678
template <class ELFT > TargetInfo *elf::getMipsTargetInfo () {
You can’t perform that action at this time.
0 commit comments