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: Porting the linker


Sorry about the long wait in this subject,

Anyway, I'm back on this and I have a bit more questions :-)

It still isn't clear to me how this should work.

What is clear is that I need a solution to:

- Move variables around in the sections
- It seems to me that if I do this at the latest stage it makes sense

- One idea was to remember all the elements that want to be in the
smaller bank and do what you said: send them off actually to the
biggest memory bank and then bring them back.

- The problem I have is that I have trouble finding two important things:
    - Where exactly to insert that, should it be in the ldwrite
function and do that.

- How to do it:
    (1) I can see the sizes of the sections and I can probably move
all of the section around but how do I go in the section to see what
is in there?

If I can figure that out, then I can probably :

- At the beginning of the linker, store which variables go where
- Then send them all to the biggest memory segment
- Then before ldwrite, actually go back and get one by one and try to
store them into the other smaller segments.

Any ideas on how to do (1) by any chance ?
Thanks in advance,
Jc

On Wed, Mar 10, 2010 at 9:11 AM, Nick Clifton <nickc@redhat.com> wrote:
> Hi Jean Christophe,
>
>>> Just a thought - it might be easier in the linker to fill the large text
>>> and
>>> data sections first and then, as late as possible, extract portions of
>>> those
>>> sections to go into the smaller text and data sections.
>>
>> That could be a solution, any hints as to how to do that ?
>
> As a guess - how about putting the code in where the section garbage
> collection occurs ? ?(Search for "gc_section" in the bfd/ directory for lots
> of examples). ?Currently the garbage collection code is used to strip out
> unneeded sections, but maybe it will also prove to be a suitable place to
> move parts of sections around.
>
> Cheers
> ?Nick
>


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