[PATCH] D66583: [yaml2obj] - Allow setting the symbol st_other field to any integer.
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 23 03:38:26 PDT 2019
MaskRay added a comment.
In D66583#1642408 <https://reviews.llvm.org/D66583#1642408>, @grimar wrote:
> 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
> }
>
>
> A 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 new STO_* flags and broken values on these targets though.
In PPC64, these bits are not used separately for difference purposes. Instead, it is shifted to represent a number, which encodes the localentry value. `StOther` might be the best to represent that piece of information.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66583/new/
https://reviews.llvm.org/D66583
More information about the llvm-commits
mailing list