make<InputSection<ELFT>>(SHF_ALLOC, SHT_PROGBITS, 8, Data, ".data");
Sections.push_back(Section);
- elf::Symtab<ELFT>::X->addRegular(StartName, STV_DEFAULT, Section, STB_GLOBAL,
- STT_OBJECT, 0);
- elf::Symtab<ELFT>::X->addRegular(EndName, STV_DEFAULT, Section, STB_GLOBAL,
- STT_OBJECT, Data.size());
- elf::Symtab<ELFT>::X->addRegular(SizeName, STV_DEFAULT, nullptr, STB_GLOBAL,
- STT_OBJECT, Data.size());
+ elf::Symtab<ELFT>::X->addRegular(StartName, STV_DEFAULT, STT_OBJECT, 0, 0,
+ STB_GLOBAL, Section);
+ elf::Symtab<ELFT>::X->addRegular(EndName, STV_DEFAULT, STT_OBJECT,
+ Data.size(), 0, STB_GLOBAL, Section);
+ elf::Symtab<ELFT>::X->addRegular(SizeName, STV_DEFAULT, STT_OBJECT,
+ Data.size(), 0, STB_GLOBAL, nullptr);
}
static bool isBitcode(MemoryBufferRef MB) {
template <class ELFT> static void addRegular(SymbolAssignment *Cmd) {
uint8_t Visibility = Cmd->Hidden ? STV_HIDDEN : STV_DEFAULT;
- Symbol *Sym = Symtab<ELFT>::X->addRegular(Cmd->Name, Visibility, nullptr,
- STB_GLOBAL, STT_NOTYPE, 0);
+ Symbol *Sym = Symtab<ELFT>::X->addRegular(Cmd->Name, Visibility, STT_NOTYPE,
+ 0, 0, STB_GLOBAL, nullptr);
Cmd->Sym = Sym->body();
// If we have no SECTIONS then we don't have '.' and don't call
template <class ELFT>
DefinedRegular<ELFT> *SymbolTable<ELFT>::addAbsolute(StringRef Name,
uint8_t Visibility) {
- return cast<DefinedRegular<ELFT>>(
- addRegular(Name, Visibility, nullptr, STB_GLOBAL, STT_NOTYPE, 0)->body());
+ Symbol *Sym =
+ addRegular(Name, Visibility, STT_NOTYPE, 0, 0, STB_GLOBAL, nullptr);
+ return cast<DefinedRegular<ELFT>>(Sym->body());
}
// Add Name as an "ignored" symbol. An ignored symbol is a regular
Symbol *Sym = B->symbol();
Symbol *Real = addUndefined(Saver.save("__real_" + Name));
Symbol *Wrap = addUndefined(Saver.save("__wrap_" + Name));
+
// We rename symbols by replacing the old symbol's SymbolBody with the new
// symbol's SymbolBody. This causes all SymbolBody pointers referring to the
// old symbol to instead refer to the new symbol.
}
template <typename ELFT>
-Symbol *SymbolTable<ELFT>::addRegular(StringRef Name, uint8_t StOther,
- InputSectionBase<ELFT> *Section,
- uint8_t Binding, uint8_t Type,
- uintX_t Value) {
- return addRegular(Name, StOther, Type, Value, 0, Binding, Section);
-}
-
-template <typename ELFT>
Symbol *SymbolTable<ELFT>::addSynthetic(StringRef N, OutputSectionBase *Section,
uintX_t Value, uint8_t StOther) {
Symbol *S;
Symbol *addRegular(StringRef Name, uint8_t StOther, uint8_t Type,
uintX_t Value, uintX_t Size, uint8_t Binding,
InputSectionBase<ELFT> *Section);
-
Symbol *addRegular(StringRef Name, const Elf_Sym &Sym,
InputSectionBase<ELFT> *Section);
- Symbol *addRegular(StringRef Name, uint8_t StOther,
- InputSectionBase<ELFT> *Section, uint8_t Binding,
- uint8_t Type, uintX_t Value);
+
Symbol *addSynthetic(StringRef N, OutputSectionBase *Section, uintX_t Value,
uint8_t StOther);
+
void addShared(SharedFile<ELFT> *F, StringRef Name, const Elf_Sym &Sym,
const typename ELFT::Verdef *Verdef);