}
}
+ // An STT_GNU_IFUNC symbol always uses a PLT entry, and all references
+ // to the symbol go through the PLT. This is true even for a local
+ // symbol, although local symbols normally do not require PLT entries.
+ if (Body && isGnuIFunc<ELFT>(*Body)) {
+ Body->setUsedInDynamicReloc();
+ if (Body->isInGot())
+ continue;
+ Out<ELFT>::Plt->addEntry(Body);
+ if (Target->UseLazyBinding) {
+ Out<ELFT>::GotPlt->addEntry(Body);
+ Out<ELFT>::RelaPlt->addReloc({&C, &RI});
+ } else {
+ Out<ELFT>::Got->addEntry(Body);
+ Out<ELFT>::RelaDyn->addReloc({&C, &RI});
+ }
+ continue;
+ }
+
bool NeedsGot = false;
bool NeedsPlt = false;
}
}
- // An STT_GNU_IFUNC symbol always uses a PLT entry, and all references
- // to the symbol go through the PLT. This is true even for a local
- // symbol, although local symbols normally do not require PLT entries.
- if (Body && isGnuIFunc<ELFT>(*Body)) {
- Body->setUsedInDynamicReloc();
- Out<ELFT>::RelaPlt->addReloc({&C, &RI});
- continue;
- }
-
if (Config->EMachine == EM_MIPS) {
if (Type == R_MIPS_LO16)
// Ignore R_MIPS_LO16 relocation. If it is a pair for R_MIPS_GOT16 we