This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: MIPS stubs in Gold
- From: Ian Lance Taylor <iant at google dot com>
- To: Aleksandar Simeonov <Aleksandar dot Simeonov at RT-RK dot com>
- Cc: binutils <binutils at sourceware dot org>, rich at mips dot com
- Date: Fri, 01 Jul 2011 08:22:12 -0700
- Subject: Re: MIPS stubs in Gold
- References: <4DE63AD1.4020708@RT-RK.com> <mcrpqmxk16e.fsf@coign.corp.google.com> <BANLkTi=YhQBY13_ZwLHv=ijUO9H=5cdUBC3KtH0he1wx0A-G-w@mail.gmail.com> <4E04A0A6.1070304@RT-RK.com> <mcrliwr6ith.fsf@coign.corp.google.com> <87boxhiutz.fsf@firetop.home> <4E0B34DC.5020000@RT-RK.com> <mcr4o38vh09.fsf@coign.corp.google.com> <4E0DE1A4.70203@RT-RK.com>
Aleksandar Simeonov <Aleksandar.Simeonov@RT-RK.com> writes:
> Now I have another question: where would be the best place to do
> relocation for stub code? I added code that looks something like in the
> end of .text section, but I don't know how to add relocations:
>
> lui $25,%hi(func)
> j func
> addiu $25,$25,%lo(func)
One approach is to remember the information you will need in your stub
class, and then pull in that information in the do_write method. E.g.,
look at how the PLT code picks the bytes to write out in
Output_data_plt_x86_64::do_write in x86_64.cc.
Ian