[lld] r278230 - [ELF][MIPS] Take into account combination of EF_MIPS_ARCH and EF_MIPS_MACH flags while checking ISA compatibility

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 22:50:29 PDT 2016


As far as I know MIPS gold is not under active development now. For
example it does not support new revision of MIPS ABI (aka R6). If you
want to see the corresponding GNU code you need to look at
bfd/elfxx-mips.c and find mips_mach_extends_p routine.

MIPS ABIs are really odd. In my opinion the problem rose because for
many years there were no single company/organization etc which lead
ABI development process. We have many MIPS architectures
(EF_MIPS_ARCH_xxx, EF_MIPS_MACH_xxx). Fortunately number of ABIs is
not equal to number of different CPUs but I would not be surprised if
we had say ten ABIs.

Good news - the situation slow changes. I hope in the future we will
be able to drop support for obsoleted parts of ABI. Bad news - in the
transition period we have to support some new and old things at the
same time. For example, o32 ABI (used for 32-bit code) defines and
requires .reginfo section. n64 ABI (used for 64-bit code) defines and
requires .MIPS.options section. New ABI revision defines one more
section .MIPS.abiflags. In ideal world this section supersedes both
old sections for both 32/64-bit code. Bit for now we have to support
all three variants. Sorry :)

On Wed, Aug 10, 2016 at 8:57 PM, Rui Ueyama <ruiu at google.com> wrote:
> Of course I know it's not your fault, but I have to say that the MIPS ABI
> seems really odd.
>
> I did a quick grep on gold source code but couldn't find code to do the same
> thing. It makes me wonder if other linkers do this.
>
> On Wed, Aug 10, 2016 at 8:06 AM, Simon Atanasyan via llvm-commits
> <llvm-commits at lists.llvm.org> wrote:
>>
>> Author: atanasyan
>> Date: Wed Aug 10 10:06:45 2016
>> New Revision: 278230
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=278230&view=rev
>> Log:
>> [ELF][MIPS] Take into account combination of EF_MIPS_ARCH and EF_MIPS_MACH
>> flags while checking ISA compatibility

-- 
Simon Atanasyan


More information about the llvm-commits mailing list