@@ -2872,7 +2872,8 @@ createSymbols(
28722872}
28732873
28742874// Returns a newly-created .gdb_index section.
2875- template <class ELFT > GdbIndexSection *GdbIndexSection::create () {
2875+ template <class ELFT >
2876+ std::unique_ptr<GdbIndexSection> GdbIndexSection::create () {
28762877 llvm::TimeTraceScope timeScope (" Create gdb index" );
28772878
28782879 // Collect InputFiles with .debug_info. See the comment in
@@ -2918,7 +2919,7 @@ template <class ELFT> GdbIndexSection *GdbIndexSection::create() {
29182919 nameAttrs[i] = readPubNamesAndTypes<ELFT>(dobj, chunks[i].compilationUnits );
29192920 });
29202921
2921- auto * ret = make <GdbIndexSection>();
2922+ auto ret = std::make_unique <GdbIndexSection>();
29222923 ret->chunks = std::move (chunks);
29232924 std::tie (ret->symbols , ret->size ) = createSymbols (nameAttrs, ret->chunks );
29242925
@@ -3860,6 +3861,7 @@ void InStruct::reset() {
38603861 ppc32Got2.reset ();
38613862 ibtPlt.reset ();
38623863 relaPlt.reset ();
3864+ gdbIndex.reset ();
38633865 shStrTab.reset ();
38643866 strTab.reset ();
38653867 symTab.reset ();
@@ -3986,10 +3988,10 @@ InStruct elf::in;
39863988std::vector<Partition> elf::partitions;
39873989Partition *elf::mainPart;
39883990
3989- template GdbIndexSection * GdbIndexSection::create<ELF32LE>();
3990- template GdbIndexSection * GdbIndexSection::create<ELF32BE>();
3991- template GdbIndexSection * GdbIndexSection::create<ELF64LE>();
3992- template GdbIndexSection * GdbIndexSection::create<ELF64BE>();
3991+ template std::unique_ptr< GdbIndexSection> GdbIndexSection::create<ELF32LE>();
3992+ template std::unique_ptr< GdbIndexSection> GdbIndexSection::create<ELF32BE>();
3993+ template std::unique_ptr< GdbIndexSection> GdbIndexSection::create<ELF64LE>();
3994+ template std::unique_ptr< GdbIndexSection> GdbIndexSection::create<ELF64BE>();
39933995
39943996template void elf::splitSections<ELF32LE>();
39953997template void elf::splitSections<ELF32BE>();
0 commit comments