[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

llvm-svn: 292219
This commit is contained in:
George Rimar 2017-01-17 13:50:34 +00:00
parent 903d35e50e
commit 2ddab6d186
1 changed files with 3 additions and 0 deletions

View File

@ -217,6 +217,9 @@ template <class ELFT> void Writer<ELFT>::run() {
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)