forked from OSchip/llvm-project
[llvm-readobj][XCOFF] dump the string table only if the size is bigger than 4.
This commit is contained in:
parent
432341d8a8
commit
737e27f623
|
@ -32,10 +32,9 @@ Symbols:
|
|||
|
||||
## There is no string table.
|
||||
# RUN: yaml2obj --docnum=3 %s -o %t3
|
||||
# RUN: llvm-readobj --string-table %t3 2>&1 | FileCheck %s --check-prefix=NO-STRTBL
|
||||
# RUN: llvm-readobj --string-table %t3 | FileCheck %s --check-prefix=NO-STRTBL
|
||||
|
||||
# NO-STRTBL: StringTable {
|
||||
# NO-STRTBL-NEXT: error: offset is out of string contents
|
||||
# NO-STRTBL-NEXT: }
|
||||
|
||||
--- !XCOFF
|
||||
|
|
|
@ -462,7 +462,8 @@ void XCOFFDumper::printStringTable() {
|
|||
StringRef StrTable = Obj.getStringTable();
|
||||
// Print strings from the fifth byte, since the first four bytes contain the
|
||||
// length (in bytes) of the string table (including the length field).
|
||||
printAsStringList(StrTable, 4);
|
||||
if (StrTable.size() > 4)
|
||||
printAsStringList(StrTable, 4);
|
||||
}
|
||||
|
||||
void XCOFFDumper::printDynamicSymbols() {
|
||||
|
|
Loading…
Reference in New Issue