[lld] r292219 - [ELF] - Do not create huge garbage files on section offset overflow.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 17 05:50:35 PST 2017
Author: grimar
Date: Tue Jan 17 07:50:34 2017
New Revision: 292219
URL: http://llvm.org/viewvc/llvm-project?rev=292219&view=rev
Log:
[ELF] - Do not create huge garbage files on section offset overflow.
Patch changes behavior to not try open the output
file if we already know about error.
That is not just cleaner, but also fixes nasty behavior of linker that
could create huge temporarily files under certain conditions.
Differential revision: https://reviews.llvm.org/D28107
Modified:
lld/trunk/ELF/Writer.cpp
Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=292219&r1=292218&r2=292219&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Tue Jan 17 07:50:34 2017
@@ -217,6 +217,9 @@ template <class ELFT> void Writer<ELFT>:
fixAbsoluteSymbols();
}
+ // It does not make sense try to open the file if we have error already.
+ if (ErrorCount)
+ return;
// Write the result down to a file.
openFile();
if (ErrorCount)
More information about the llvm-commits
mailing list