[PATCH] D95505: [yaml2obj] Initial support for 32-bit XCOFF in yaml2obj.

EsmeYi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 24 22:16:34 PDT 2021


Esme added inline comments.


================
Comment at: llvm/lib/ObjectYAML/XCOFFEmitter.cpp:62-63
+    if (!InitSections[I].Relocations.empty()) {
+      // Only the .text, .data, .tdata, and STYP_DWARF sections have
+      // relocations.
+      int32_t SecFlags = InitSections[I].Flags;
----------------
jhenderson wrote:
> Is this a fundamental restriction of the XCOFF file format, or is it just what should happen? Is it possible to create (potentially by hand) a section with relocations if it isn't one of these types?
> 
> In general, to allow for testing of bad input paths etc, you want to allow as much flexibility in yaml2obj as possible. As such, it isn't yaml2obj's place to restrict what can be done, as long as it can physically represent what was requested.
It is just what should happen.

Thanks for the advice, it makes sense to me to removing the restriction to allow more flexibility.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95505



More information about the llvm-commits mailing list