diff options
author | Rui Ueyama <ruiu@google.com> | 2018-09-25 19:26:58 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2018-09-25 19:26:58 +0000 |
commit | 4e247522ac8dc1ee1046df2c54c84e6bcc2bc1a9 (patch) | |
tree | 6d2e620d2dc827cdfae55f995563308d309e7320 /lld/ELF/MapFile.cpp | |
parent | 10c11b867a045ee6f5ada9b741dbf2929d8d7ae0 (diff) | |
download | bcm5719-llvm-4e247522ac8dc1ee1046df2c54c84e6bcc2bc1a9.tar.gz bcm5719-llvm-4e247522ac8dc1ee1046df2c54c84e6bcc2bc1a9.zip |
Reset input section pointers to null on each linker invocation.
Previously, if you invoke lld's `main` more than once in the same process,
the second invocation could fail or produce a wrong result due to a stale
pointer values of the previous run.
Differential Revision: https://reviews.llvm.org/D52506
llvm-svn: 343009
Diffstat (limited to 'lld/ELF/MapFile.cpp')
-rw-r--r-- | lld/ELF/MapFile.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lld/ELF/MapFile.cpp b/lld/ELF/MapFile.cpp index 54fddfb7b29..870705cd142 100644 --- a/lld/ELF/MapFile.cpp +++ b/lld/ELF/MapFile.cpp @@ -126,7 +126,7 @@ static void printEhFrame(raw_ostream &OS, OutputSection *OSec) { }; // Gather section pieces. - for (const CieRecord *Rec : InX::EhFrame->getCieRecords()) { + for (const CieRecord *Rec : In.EhFrame->getCieRecords()) { Add(*Rec->Cie); for (const EhSectionPiece *Fde : Rec->Fdes) Add(*Fde); @@ -181,7 +181,7 @@ void elf::writeMapFile() { for (BaseCommand *Base : OSec->SectionCommands) { if (auto *ISD = dyn_cast<InputSectionDescription>(Base)) { for (InputSection *IS : ISD->Sections) { - if (IS == InX::EhFrame) { + if (IS == In.EhFrame) { printEhFrame(OS, OSec); continue; } |