This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: MIPS JAL/JALR to BAL transformation for Linux (o32 ABI)
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Adam Nemet <anemet at caviumnetworks dot com>
- Cc: "Fu\, Chao-Ying" <fu at mips dot com>, <binutils at sourceware dot org>, "Lau\, David" <davidlau at mips dot com>, "Garbacea\, Ilie" <ilie at mips dot com>
- Date: Sat, 01 Aug 2009 09:15:50 +0100
- Subject: Re: MIPS JAL/JALR to BAL transformation for Linux (o32 ABI)
- References: <94BD67F8AF3ED34FA362C662BA1F12C502BB5CF8@MTVEXCHANGE.mips.com> <o7iqh8ra53.fsf@ropi.home> <o7eirwr5ye.fsf@ropi.home>
Adam Nemet <anemet@caviumnetworks.com> writes:
> Adam Nemet <anemet@caviumnetworks.com> writes:
>> "Fu, Chao-Ying" <fu@mips.com> writes:
>>> In order to utilize this optimization, we need to
>>> use -mno-explicit-relocs for GCC to let the assembler emit
>>> BFD_RELOC_MIPS_JALR for shared libraries (-mshared).
>>
>> I agree that we should try to use BAL in shared libraries. However it
>> seems to me that requiring -mno-explicit-relocs is a high price to pay.
>> Can't we instead change the calls in shared libraries to also use the
>> PLT (or the locally binding function directly if possible)?
>
> If we can't do this there is also the other idea which we used to do to
> avoid -mno-explicit-relocs in our toolchain. Emit jalr and jr with an
> extra optional operand that is the symbol name of the function for PIC
> calls and use that to create the JALR relocation.
Yeah. These days we could also use (thanks Alan!):
.reloc 1f, R_MIPS_JALR, foo
1: jalr $25
Does that mean you already have a GCC patch to do this kind of thing?
Richard