diff --git a/lld/ELF/Arch/ARM.cpp b/lld/ELF/Arch/ARM.cpp index 4a293af9b9a118..f32c43067c3daf 100644 --- a/lld/ELF/Arch/ARM.cpp +++ b/lld/ELF/Arch/ARM.cpp @@ -1445,21 +1445,22 @@ void ArmCmseSGSection::finalizeContents() { // See ArmĀ® v8-M Security Extensions: Requirements on Development Tools // https://developer.arm.com/documentation/ecm0359818/latest template void elf::writeARMCmseImportLib(Ctx &ctx) { - StringTableSection *shstrtab = - make(ctx, ".shstrtab", /*dynamic=*/false); - StringTableSection *strtab = - make(ctx, ".strtab", /*dynamic=*/false); - SymbolTableBaseSection *impSymTab = - make>(ctx, *strtab); + auto shstrtab = + std::make_unique(ctx, ".shstrtab", /*dynamic=*/false); + auto strtab = + std::make_unique(ctx, ".strtab", /*dynamic=*/false); + auto impSymTab = std::make_unique>(ctx, *strtab); SmallVector, SyntheticSection *>, 0> osIsPairs; osIsPairs.emplace_back( - std::make_unique(ctx, strtab->name, 0, 0), strtab); + std::make_unique(ctx, strtab->name, 0, 0), strtab.get()); osIsPairs.emplace_back( - std::make_unique(ctx, impSymTab->name, 0, 0), impSymTab); + std::make_unique(ctx, impSymTab->name, 0, 0), + impSymTab.get()); osIsPairs.emplace_back( - std::make_unique(ctx, shstrtab->name, 0, 0), shstrtab); + std::make_unique(ctx, shstrtab->name, 0, 0), + shstrtab.get()); llvm::sort(ctx.symtab->cmseSymMap, [&](const auto &a, const auto &b) { return a.second.sym->getVA(ctx) < b.second.sym->getVA(ctx);