[PATCH] D103455: [yaml2obj] Add support for writing the long symbol name.

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 14 20:55:02 PDT 2021


shchenz accepted this revision.
shchenz added a comment.
This revision is now accepted and ready to land.

Yes, it is better to implement string table dump for XCOFF, then we should not rely on the system tool to verify this change.

I think the correctness should also be guaranteed by AIX system tool `dump`.

So LGTM. Thanks for doing this.

FYI. I can get the correct string table and symbol table for long/short name symbols on AIX:

  $cat t.yaml 
  --- !XCOFF
  FileHeader:
    MagicNumber: 0x1DF
  Symbols:
    - Name: .symname
    - Name: .longname
    - Name: .longname3456
    - Name: .longname345



  $dump -X32 -cv test.o
  
  test.o:
  
                          ***String Table Information***
           Offset     Name
  
               4   .longname
              14   .longname3456
              28   .longname345
  
  $dump -X32 -t test.o
  
  [0]     m   0x00000000         0     0    0x00         0x0000     .symname
  [1]     m   0x00000000         0     0    0x00         0x0000     .longname
  [2]     m   0x00000000         0     0    0x00         0x0000     .longname3456
  [3]     m   0x00000000         0     0    0x00         0x0000     .longname345



================
Comment at: llvm/lib/ObjectYAML/XCOFFEmitter.cpp:78
+bool XCOFFWriter::nameShouldBeInStringTable(StringRef SymbolName) {
+  return SymbolName.size() > XCOFF::NameSize;
+}
----------------
Maybe we need to explicitly describe that in the issue summary this is only for 32-bit XCOFF?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103455



More information about the llvm-commits mailing list