[PATCH] Re-enable a hook in MCELFObjectTargetWriter to allow target-specific relocationtable sorting and use this hook for Mips.
Rafael EspĂndola
rafael.espindola at gmail.com
Wed Apr 1 16:20:51 PDT 2015
On 1 April 2015 at 18:26, Vladimir Stefanovic
<vladimir.stefanovic at imgtec.com> wrote:
> In http://reviews.llvm.org/D7414#150147, @rafael wrote:
>
>> > //// There may be more ways to sort the table while respecting the ABI rule;
>>
>> > //// we always sort the same way gnu as does, for compatibility.
>>
>>
>> Still not particularly clear. We *have* to sort it in a way that
>> causes bfd ld to match the same hi and lo relocations as would be
>> matched had the .s been assembled by gas.
>>
>> Cheers,
>> Rafael
>
>
> Ok, a new one:
>
> // We are reusing gnu as sorting algorithm so we are emitting the relocation
> // table sorted the same way as gnu as would sort it.
It doesn't say why.
Just say that which hi and lo relocation gets matched by the linker
influences the result. The assembler then has to always make sure that
the relocations are output in an order that causes the linker to make
the same decisions as if the .o was produced by the gnu assembler.
It is horrible, but it is reality for mips.
Cheers,
Rafael
More information about the llvm-commits
mailing list