summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/InputFiles.cpp7
-rw-r--r--lld/ELF/SymbolTable.cpp2
-rw-r--r--lld/ELF/Writer.cpp8
3 files changed, 8 insertions, 9 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index a9f1f860aba..a1f6b137881 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -511,11 +511,10 @@ SymbolBody *elf::ObjectFile<ELFT>::createSymbolBody(const Elf_Sym *Sym) {
StringRefZ Name = this->StringTable.data() + Sym->st_name;
if (Sym->st_shndx == SHN_UNDEF)
- return new (BAlloc)
- Undefined(Name, /*IsLocal=*/true, StOther, Type, this);
+ return make<Undefined>(Name, /*IsLocal=*/true, StOther, Type, this);
- return new (BAlloc) DefinedRegular(Name, /*IsLocal=*/true, StOther, Type,
- Value, Size, Sec, this);
+ return make<DefinedRegular>(Name, /*IsLocal=*/true, StOther, Type, Value,
+ Size, Sec, this);
}
StringRef Name = check(Sym->getName(this->StringTable));
diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp
index 62d76dd6a7c..a70f76184f2 100644
--- a/lld/ELF/SymbolTable.cpp
+++ b/lld/ELF/SymbolTable.cpp
@@ -191,7 +191,7 @@ std::pair<Symbol *, bool> SymbolTable<ELFT>::insert(StringRef Name) {
Symbol *Sym;
if (IsNew) {
- Sym = new (BAlloc) Symbol;
+ Sym = make<Symbol>();
Sym->InVersionScript = false;
Sym->Binding = STB_WEAK;
Sym->Visibility = STV_DEFAULT;
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index cc12e5ce35f..ce5ef0229a9 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -533,11 +533,11 @@ template <class ELFT> void Writer<ELFT>::addSectionSymbols() {
if (!IS || isa<SyntheticSection>(IS) || IS->Type == SHT_REL ||
IS->Type == SHT_RELA)
continue;
- auto *B = new (BAlloc)
- DefinedRegular("", /*IsLocal=*/true, /*StOther*/ 0, STT_SECTION,
- /*Value*/ 0, /*Size*/ 0, IS, nullptr);
- In<ELFT>::SymTab->addSymbol(B);
+ auto *Sym =
+ make<DefinedRegular>("", /*IsLocal=*/true, /*StOther=*/0, STT_SECTION,
+ /*Value=*/0, /*Size=*/0, IS, nullptr);
+ In<ELFT>::SymTab->addSymbol(Sym);
}
}
OpenPOWER on IntegriCloud