[PATCH] D66583: [yaml2obj] - Allow setting the symbol st_other field to any integer.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 23 02:14:12 PDT 2019


grimar added a comment.

In D66583#1642404 <https://reviews.llvm.org/D66583#1642404>, @MaskRay wrote:

> All of MIPS/PPC64/AArch64 can make use of these st_other bits now.


But do they need it? I see that yaml2obj supports only MIPS flags atm:

  void ScalarBitSetTraits<ELFYAML::ELF_STO>::bitset(IO &IO,
                                                    ELFYAML::ELF_STO &Value) {
    const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
    assert(Object && "The IO context is not initialized");
  #define BCase(X) IO.bitSetCase(Value, #X, ELF::X)
    switch (Object->Header.Machine) {
    case ELF::EM_MIPS:
      BCase(STO_MIPS_OPTIONAL);
      BCase(STO_MIPS_PLT);
      BCase(STO_MIPS_PIC);
      BCase(STO_MIPS_MICROMIPS);
      break;
    default:
      break; // Nothing to do
    }
  #undef BCase
  #undef BCaseMask
  }

Normal way for PPC64/AArch64/(?) would be to teach yaml2obj about their flags and use an existent "Other" field
(instead of "StOther" added by this patch).

This is still useful for testing a new STO_* flags and broken values on these targets though.


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

https://reviews.llvm.org/D66583





More information about the llvm-commits mailing list