Object: Output .file symbols properly

obj2yaml would emit the NUL bytes padding the auxiliary file symbol
records.  Trimming them looks nicer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204314 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Majnemer
2014-03-20 06:29:02 +00:00
parent b000c172ed
commit d9a0abcf8f
3 changed files with 19 additions and 1 deletions
+2 -1
View File
@@ -178,7 +178,8 @@ void COFFDumper::dumpSymbols(unsigned NumSymbols) {
} else if (Symbol->isFileRecord()) {
// This symbol represents a file record.
Sym.File = StringRef(reinterpret_cast<const char *>(AuxData.data()),
Symbol->NumberOfAuxSymbols * COFF::SymbolSize);
Symbol->NumberOfAuxSymbols * COFF::SymbolSize)
.rtrim(StringRef("\0", /*length=*/1));
} else if (Symbol->isSectionDefinition()) {
// This symbol represents a section definition.
assert(Symbol->NumberOfAuxSymbols == 1 &&