Skip to content

Commit 2eb7e5f

Browse files
author
Esme-Yi
committed
[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
1 parent 9451403 commit 2eb7e5f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

llvm/lib/ObjectYAML/XCOFFEmitter.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -317,12 +317,11 @@ bool XCOFFWriter::writeXCOFF() {
317317
if (!writeRelocations())
318318
return false;
319319
}
320-
if (!Obj.Symbols.empty()) {
321-
if (!writeSymbols())
322-
return false;
323-
// Write the string table.
320+
if (!Obj.Symbols.empty() && !writeSymbols())
321+
return false;
322+
// Write the string table.
323+
if (Strings.getSize() > 4)
324324
Strings.write(W.OS);
325-
}
326325
return true;
327326
}
328327

0 commit comments

Comments
 (0)