[llvm] r200138 - Implement the missing bits corresponding to .mips_hack_elf_flags.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Mon Jan 27 10:18:03 PST 2014


On 27 January 2014 12:17, Matheus Almeida <Matheus.Almeida at imgtec.com> wrote:
> Hi Rafael,
>
> We found one issue with this commit.
> EF_MIPS_ABI2 should only be set if the n32 ABI is used as opposed to set if targeting any 64-bit Mips architecture. Note that at the moment n64 is the default ABI for Mips64 (not n32). This will probably be updated in the future for compatibility reasons with GCC based toolchains but I believe it's not a change we can perform silently.
>
> I've attached a patch that fixes this issue.
>
> Are you OK if we add an option to llvm-mc that allows the ABI to be manipulated on the command line (-mabi=...) ? That would allow us to add more tests that check if the correct bits were written to the ELF header without relying on the default values for the ABI.

I see. I noticed the default cpu was different from gas, but missed
that the ABI was intended to be different. Can't you use llvm-mc's
mattr option to set it? For example, -mattr=n32 seems to correctly
select the n32 abi. If so, please change the test to include at least
the equivalent of

mips64el-as -mabi=n32 -mips64r2 (what we have now, but with the
explicit abi option)
mips64el-as -mabi=n32 -mips64 (similar)

mips64el-as -mabi=64 -mips64r2 (what you were changing the test to,
but with the explicit abi option)
mips64el-as -mabi=64 -mips64 (similar)

Using explicit command line options keeps the invariant stated at the
top of the test that it matches the output of gas when compiled with
the same triple and corresponding options.

Feel free to add another test explicitly showing that we have a
different default from gas.

Cheers,
Rafael




More information about the llvm-commits mailing list