1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-21 18:22:53 +01:00

[yaml2obj] Do not write the string table if there is no string entry.

Summary: yaml2obj shouldn't create the string table that isn't needed
         - doing so wastes time and disk space.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D106420
This commit is contained in:
Esme-Yi 2021-07-26 02:37:49 +00:00
parent a60a1f2f04
commit d0cd0162ac

View File

@ -317,12 +317,11 @@ bool XCOFFWriter::writeXCOFF() {
if (!writeRelocations())
return false;
}
if (!Obj.Symbols.empty()) {
if (!writeSymbols())
return false;
// Write the string table.
if (!Obj.Symbols.empty() && !writeSymbols())
return false;
// Write the string table.
if (Strings.getSize() > 4)
Strings.write(W.OS);
}
return true;
}