diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index 0a12add074af..57f8ad0bbfa1 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -233,12 +233,14 @@ void elf2::ObjectFile::initializeSections(DenseSet &Comdats) { if (Name == ".note.GNU-stack") Sections[I] = &InputSection::Discarded; else if (Name == ".eh_frame") - Sections[I] = new (this->Alloc) EHInputSection(this, &Sec); + Sections[I] = + new (this->EHAlloc.Allocate()) EHInputSection(this, &Sec); else if (Name == ".reginfo") Sections[I] = new (this->Alloc) MipsReginfoInputSection(this, &Sec); else if (shouldMerge(Sec)) - Sections[I] = new (this->MAlloc.Allocate()) MergeInputSection(this, &Sec); + Sections[I] = + new (this->MAlloc.Allocate()) MergeInputSection(this, &Sec); else Sections[I] = new (this->Alloc) InputSection(this, &Sec); break; diff --git a/lld/ELF/InputFiles.h b/lld/ELF/InputFiles.h index 9fb5cf60102f..bae999ad7948 100644 --- a/lld/ELF/InputFiles.h +++ b/lld/ELF/InputFiles.h @@ -136,6 +136,7 @@ private: llvm::BumpPtrAllocator Alloc; llvm::SpecificBumpPtrAllocator> MAlloc; + llvm::SpecificBumpPtrAllocator> EHAlloc; }; class ArchiveFile : public InputFile {