Skip to content

Commit a87f776

Browse files
committed
[ELF] Avoid make in elf::writeARMCmseImportLib
1 parent 48b13ca commit a87f776

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

lld/ELF/Arch/ARM.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,21 +1445,22 @@ void ArmCmseSGSection::finalizeContents() {
14451445
// See Arm® v8-M Security Extensions: Requirements on Development Tools
14461446
// https://developer.arm.com/documentation/ecm0359818/latest
14471447
template <typename ELFT> void elf::writeARMCmseImportLib(Ctx &ctx) {
1448-
StringTableSection *shstrtab =
1449-
make<StringTableSection>(ctx, ".shstrtab", /*dynamic=*/false);
1450-
StringTableSection *strtab =
1451-
make<StringTableSection>(ctx, ".strtab", /*dynamic=*/false);
1452-
SymbolTableBaseSection *impSymTab =
1453-
make<SymbolTableSection<ELFT>>(ctx, *strtab);
1448+
auto shstrtab =
1449+
std::make_unique<StringTableSection>(ctx, ".shstrtab", /*dynamic=*/false);
1450+
auto strtab =
1451+
std::make_unique<StringTableSection>(ctx, ".strtab", /*dynamic=*/false);
1452+
auto impSymTab = std::make_unique<SymbolTableSection<ELFT>>(ctx, *strtab);
14541453

14551454
SmallVector<std::pair<std::unique_ptr<OutputSection>, SyntheticSection *>, 0>
14561455
osIsPairs;
14571456
osIsPairs.emplace_back(
1458-
std::make_unique<OutputSection>(ctx, strtab->name, 0, 0), strtab);
1457+
std::make_unique<OutputSection>(ctx, strtab->name, 0, 0), strtab.get());
14591458
osIsPairs.emplace_back(
1460-
std::make_unique<OutputSection>(ctx, impSymTab->name, 0, 0), impSymTab);
1459+
std::make_unique<OutputSection>(ctx, impSymTab->name, 0, 0),
1460+
impSymTab.get());
14611461
osIsPairs.emplace_back(
1462-
std::make_unique<OutputSection>(ctx, shstrtab->name, 0, 0), shstrtab);
1462+
std::make_unique<OutputSection>(ctx, shstrtab->name, 0, 0),
1463+
shstrtab.get());
14631464

14641465
llvm::sort(ctx.symtab->cmseSymMap, [&](const auto &a, const auto &b) {
14651466
return a.second.sym->getVA(ctx) < b.second.sym->getVA(ctx);

0 commit comments

Comments
 (0)