[PATCH] D107333: [llvm-readobj][XCOFF] Print the length of the string table.
Esme Yi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 3 02:56:20 PDT 2021
Esme created this revision.
Esme added reviewers: jhenderson, shchenz, Higuoxing, PowerPC.
Herald added a subscriber: rupprecht.
Esme requested review of this revision.
Herald added subscribers: llvm-commits, MaskRay.
Herald added a project: LLVM.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D107333
Files:
llvm/test/tools/llvm-readobj/XCOFF/string-table.yaml
llvm/test/tools/yaml2obj/XCOFF/basic-doc64.yaml
llvm/test/tools/yaml2obj/XCOFF/long-symbol-name.yaml
llvm/tools/llvm-readobj/XCOFFDumper.cpp
Index: llvm/tools/llvm-readobj/XCOFFDumper.cpp
===================================================================
--- llvm/tools/llvm-readobj/XCOFFDumper.cpp
+++ llvm/tools/llvm-readobj/XCOFFDumper.cpp
@@ -460,6 +460,7 @@
void XCOFFDumper::printStringTable() {
DictScope DS(W, "StringTable");
StringRef StrTable = Obj.getStringTable();
+ W.printNumber("Length (in bytes)", StrTable.size());
// 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);
Index: llvm/test/tools/yaml2obj/XCOFF/long-symbol-name.yaml
===================================================================
--- llvm/test/tools/yaml2obj/XCOFF/long-symbol-name.yaml
+++ llvm/test/tools/yaml2obj/XCOFF/long-symbol-name.yaml
@@ -24,6 +24,7 @@
# CHECK-NEXT: }
# CHECK-NEXT: ]
# CHECK-NEXT: StringTable {
+# CHECK-NEXT: Length (in bytes): 14
# CHECK-NEXT: [ 4] .longname
# CHECK-NEXT: }
Index: llvm/test/tools/yaml2obj/XCOFF/basic-doc64.yaml
===================================================================
--- llvm/test/tools/yaml2obj/XCOFF/basic-doc64.yaml
+++ llvm/test/tools/yaml2obj/XCOFF/basic-doc64.yaml
@@ -135,6 +135,7 @@
# CHECK64-NEXT: }
# CHECK64-NEXT: ]
# CHECK64-NEXT: StringTable {
+# CHECK64-NEXT: Length (in bytes): 28
# CHECK64-NEXT: [ 4] .text
# CHECK64-NEXT: [ a] .abs
# CHECK64-NEXT: [ f] .undef
Index: llvm/test/tools/llvm-readobj/XCOFF/string-table.yaml
===================================================================
--- llvm/test/tools/llvm-readobj/XCOFF/string-table.yaml
+++ llvm/test/tools/llvm-readobj/XCOFF/string-table.yaml
@@ -5,6 +5,7 @@
# RUN: llvm-readobj --string-table %t1 | FileCheck %s --check-prefix=BASIC
# BASIC: StringTable {
+# BASIC-NEXT: Length (in bytes): 16
# BASIC-NEXT: [ 4] name2
# BASIC-NEXT: [ a] name1
# BASIC-NEXT: }
@@ -21,6 +22,7 @@
# RUN: llvm-readobj --string-table %t2 | FileCheck %s --check-prefix=SINGLE-BYTE
# SINGLE-BYTE: StringTable {
+# SINGLE-BYTE-NEXT: Length (in bytes): 6
# SINGLE-BYTE-NEXT: [ 4] n
# SINGLE-BYTE-NEXT: }
@@ -35,6 +37,7 @@
# RUN: llvm-readobj --string-table %t3 | FileCheck %s --check-prefix=NO-STRTBL
# NO-STRTBL: StringTable {
+# NO-STRTBL-NEXT: Length (in bytes): 0
# NO-STRTBL-NEXT: }
--- !XCOFF
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107333.363664.patch
Type: text/x-patch
Size: 2418 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210803/65f84f13/attachment.bin>
More information about the llvm-commits
mailing list