They can be regular DefinedSynthetic.
llvm-svn: 265981
// __rel_iplt_start/__rel_iplt_end for signaling
// where R_[*]_IRELATIVE relocations do live.
- static DefinedRegular<ELFT> *RelaIpltStart;
- static DefinedRegular<ELFT> *RelaIpltEnd;
+ static SymbolBody *RelaIpltStart;
+ static SymbolBody *RelaIpltEnd;
};
template <class ELFT> DefinedRegular<ELFT> *ElfSym<ELFT>::Etext;
template <class ELFT> DefinedRegular<ELFT> *ElfSym<ELFT>::End;
template <class ELFT> DefinedRegular<ELFT> *ElfSym<ELFT>::End2;
template <class ELFT> DefinedRegular<ELFT> *ElfSym<ELFT>::MipsGp;
-template <class ELFT> DefinedRegular<ELFT> *ElfSym<ELFT>::RelaIpltStart;
-template <class ELFT> DefinedRegular<ELFT> *ElfSym<ELFT>::RelaIpltEnd;
+template <class ELFT> SymbolBody *ElfSym<ELFT>::RelaIpltStart;
+template <class ELFT> SymbolBody *ElfSym<ELFT>::RelaIpltEnd;
} // namespace elf
} // namespace lld
if (isOutputDynamic() || !Out<ELFT>::RelaPlt)
return;
StringRef S = Config->Rela ? "__rela_iplt_start" : "__rel_iplt_start";
- ElfSym<ELFT>::RelaIpltStart = Symtab.addIgnored(S);
+ if (Symtab.find(S))
+ ElfSym<ELFT>::RelaIpltStart =
+ Symtab.addSynthetic(S, *Out<ELFT>::RelaPlt, 0, STV_HIDDEN);
S = Config->Rela ? "__rela_iplt_end" : "__rel_iplt_end";
- ElfSym<ELFT>::RelaIpltEnd = Symtab.addIgnored(S);
+ if (Symtab.find(S))
+ ElfSym<ELFT>::RelaIpltEnd = Symtab.addSynthetic(
+ S, *Out<ELFT>::RelaPlt, DefinedSynthetic<ELFT>::SectionEnd, STV_HIDDEN);
}
template <class ELFT> static bool includeInSymtab(const SymbolBody &B) {
// to each section. This function fixes some predefined absolute
// symbol values that depend on section address and size.
template <class ELFT> void Writer<ELFT>::fixAbsoluteSymbols() {
- // Update __rel[a]_iplt_{start,end} symbols so that they point
- // to beginning or ending of .rela.plt section, respectively.
- if (Out<ELFT>::RelaPlt) {
- uintX_t Start = Out<ELFT>::RelaPlt->getVA();
- if (ElfSym<ELFT>::RelaIpltStart)
- ElfSym<ELFT>::RelaIpltStart->Value = Start;
- if (ElfSym<ELFT>::RelaIpltEnd)
- ElfSym<ELFT>::RelaIpltEnd->Value = Start + Out<ELFT>::RelaPlt->getSize();
- }
-
// Update MIPS _gp absolute symbol so that it points to the static data.
if (Config->EMachine == EM_MIPS)
ElfSym<ELFT>::MipsGp->Value = getMipsGpAddr<ELFT>();
// CHECK-NEXT: Other [
// CHECK-NEXT: STV_HIDDEN
// CHECK-NEXT: ]
-// CHECK-NEXT: Section: Absolute
+// CHECK-NEXT: Section: .rela.plt
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: __rela_iplt_start
// CHECK-NEXT: Other [
// CHECK-NEXT: STV_HIDDEN
// CHECK-NEXT: ]
-// CHECK-NEXT: Section: Absolute
+// CHECK-NEXT: Section: .rela.plt
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: _start
// CHECK-NEXT: Other [
// CHECK-NEXT: STV_HIDDEN
// CHECK-NEXT: ]
-// CHECK-NEXT: Section: Absolute
+// CHECK-NEXT: Section: .rel.plt
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: __rel_iplt_start
// CHECK-NEXT: Other [
// CHECK-NEXT: STV_HIDDEN
// CHECK-NEXT: ]
-// CHECK-NEXT: Section: Absolute
+// CHECK-NEXT: Section: .rel.plt
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: _start
// CHECK-NEXT: Other [
// CHECK-NEXT: STV_HIDDEN
// CHECK-NEXT: ]
-// CHECK-NEXT: Section: Absolute
+// CHECK-NEXT: Section: .rela.plt
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: __rela_iplt_start
// CHECK-NEXT: Other [
// CHECK-NEXT: STV_HIDDEN
// CHECK-NEXT: ]
-// CHECK-NEXT: Section: Absolute
+// CHECK-NEXT: Section: .rela.plt
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: _start