mirror of
https://github.com/intel/llvm.git
synced 2026-01-20 01:58:44 +08:00
Revert "[ELF] Make Partition/InStruct members unique_ptr and remove associate make<XXX>"
This reverts commite48b1c8a27. This reverts commitd019de23a1. The changes caused memory leaks (non-final classes cannot use unique_ptr).
This commit is contained in:
@@ -561,15 +561,15 @@ LinkerScript::computeInputSections(const InputSectionDescription *cmd,
|
||||
}
|
||||
|
||||
void LinkerScript::discard(InputSectionBase &s) {
|
||||
if (&s == in.shStrTab.get() || &s == mainPart->relrDyn.get())
|
||||
if (&s == in.shStrTab || &s == mainPart->relrDyn)
|
||||
error("discarding " + s.name + " section is not allowed");
|
||||
|
||||
// You can discard .hash and .gnu.hash sections by linker scripts. Since
|
||||
// they are synthesized sections, we need to handle them differently than
|
||||
// other regular sections.
|
||||
if (&s == mainPart->gnuHashTab.get())
|
||||
if (&s == mainPart->gnuHashTab)
|
||||
mainPart->gnuHashTab = nullptr;
|
||||
if (&s == mainPart->hashTab.get())
|
||||
if (&s == mainPart->hashTab)
|
||||
mainPart->hashTab = nullptr;
|
||||
|
||||
s.markDead();
|
||||
|
||||
Reference in New Issue
Block a user