Commit 737e27f6 authored by Esme-Yi's avatar Esme-Yi
Browse files

[llvm-readobj][XCOFF] dump the string table only if the size is bigger than 4.

parent 432341d8
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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
+2 −1
Original line number Diff line number Diff line
@@ -462,6 +462,7 @@ 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).
  if (StrTable.size() > 4)
    printAsStringList(StrTable, 4);
}