[PATCH] D104613: [llvm-readobj][XCOFF] Add support for printing the String Table.

EsmeYi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 1 03:41:16 PDT 2021


Esme added a comment.





================
Comment at: llvm/test/tools/yaml2obj/XCOFF/basic-doc64.yaml:137
+# CHECK64-NEXT: StringTable {
+# CHECK64-NEXT:   [     3]   ..text
+# CHECK64-NEXT:   [     a]   .abs
----------------
jhenderson wrote:
> Does this test pass? Why is there a second "." in this name, if so?
> 
> What's at bytes 0-2 in the string table?
Yes, the test does pass. The offset is `3`, but the real offset is `4` in the Symbol entry. It is not a bug of yaml2obj or this patch, since the issue occurs when check the StringTable of a compiled binary object. This should be a bug during parsing the StringTable, and I will post another patch to fix it before the patch.
There are '\0' at bytes 0-2. Here is an example of dumping the string data for every bytes offset of a StringTable for a compiled binary file. Where the correct result should be  `[     4]   alongname`
```
StringTable {
-every bytes
0: 
1: 
2: 
3: alongname
4: alongname
5: longname
6: ongname
7: ngname
8: gname
9: name
10: ame
11: me
12: e
13: 
-Result
  [     3]   .alongname  
}
```



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104613/new/

https://reviews.llvm.org/D104613



More information about the llvm-commits mailing list