according to https://www.ibm.com/docs/en/aix/7.2?topic=formats-xcoff-object-file-format#XCOFF__vra3i31ejbau
we add a new option --loader-section-header for llvm-readobj to decode the decode the loader section header field of XCOFF object file.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Please don't forget to update the documentation for new options.
I'm going to be on paid time off next week, and don't have the time to look at this today. I will look at it at some point after I get back.
llvm/include/llvm/Object/XCOFFObjectFile.h | ||
---|---|---|
198 | Reading the code, it seems like the CRTP (and therefore this base class) are unnecessary. In your lambda where you print the fields, you can use the common subclass memeber fields directly, because you've provided the input parameter type of the lamdba as auto. | |
llvm/tools/llvm-readobj/XCOFFDumper.cpp | ||
166 | Nit: don't start functions with a blank line. | |
169 | Nit: Lambdas are function objects. The consensus is that their names should be written like variables, because they are passed around like them (i.e. PrintLoadSecHeaderCommon). |
One more suggestion. I thought I made this in the previous version of the patch, but apparently not.
llvm/tools/llvm-readobj/llvm-readobj.cpp | ||
---|---|---|
514–515 | This is a very odd way of getting it to print a specific part of the loader section. It would be much more normal to pass in booleans into printLoaderSection, rather than modifying the state of the dumper to ensure it does print it. Take a look at the printSymbols call for example. |
Looks good. Probably worth an XCOFF developer taking a quick look too, for more file-format specific aspects of this.
Reading the code, it seems like the CRTP (and therefore this base class) are unnecessary. In your lambda where you print the fields, you can use the common subclass memeber fields directly, because you've provided the input parameter type of the lamdba as auto.