This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MIPS stubs in Gold


The ARM stubs do a number of things

-extending branch range
-handling transistion between ARM and THUMB with BX and BLX
instructions cannot be used.
-avoid a hardware erratum in involving page straddling long branches
in THUMB2 mode.

The base class is Stub, from which other stub kinds are derived.  Stub
generation in ARM is a relaxation.  I need to iterate a number of time
because addresses are changed by the inserted stubs.  I hope that this
is not the case in MIPS.  There are hooks for doing relaxation.  Look
for do_relax() in the ARM backend.

-Doug

On Wed, Jun 1, 2011 at 8:43 AM, Ian Lance Taylor <iant@google.com> wrote:
> Aleksandar Simeonov <Aleksandar.Simeonov@RT-RK.com> writes:
>
>> Again I have problem that occupy me for some time and for what I can't
>> find solution. Situation is as follows (next text is taken from
>> elfxx-mips.c from ld):
>>
>> "Information about a non-PIC interface to a PIC function. ?There are
>> ? ?two ways of creating these interfaces. ?The first is to add:
>>
>> ? ? ? lui ? ? $25,%hi(func)
>> ? ? ? addiu ? $25,$25,%lo(func)
>>
>> ? ?immediately before a PIC function "func". ?The second is to add:
>>
>> ? ? ? lui ? ? $25,%hi(func)
>> ? ? ? j ? ? ? func
>> ? ? ? addiu ? $25,$25,%lo(func)
>>
>> ? ?to a separate trampoline section.
>>
>> ? ?Stubs of the first kind go in a new section immediately before the
>> ? ?target function. ?Stubs of the second kind go in a single section
>> ? ?pointed to by the hash table's "strampoline" field."
>>
>> I tried to find something similar in Gold for other architectures, but
>> without success. Can you give me some suggestions where to look and what
>> to do to implement this.
>
> The ARM backend implements stubs, e.g., for calls between ARM and Thumb
> code. ?Search for "stub" and "Stub". ?You probably don't have to do
> anything as complex for the MIPS backend. ?At least, I hope not.
>
> Ian
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]