This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: same routines in multiple overlays
- From: Nick Clifton <nickc at redhat dot com>
- To: Oliver Wohlmuth <oliver dot wohlmuth at freescale dot com>
- Cc: binutils at sourceware dot org
- Date: Fri, 03 Feb 2006 13:03:58 +0000
- Subject: Re: same routines in multiple overlays
- References: <43E06BE3.4030709@freescale.com>
Hi Oliver,
Here comes my question:
Is there a way in the linker script to tell ld (version 2.16.1) to move
a static library into multiple overlays ?
Sorry no. The linker does not (currently) support this feature. You
would have to code it into the linker sources yourself.
If not, does anybody know of other way to achieve this ?
If you know all of the codecs that might be used by your users then you
can can the following approach:
* Link together the time critical parts of each codec separately
using the -r linker switch to create a relocatible object file as the
output.
* Create a linker script with overlays and in each overlay load one
of your relocatable codec objects.
Eg:
ld -r -o first_codec.o foo.o bar.o
ld -r -o second_codec.o foo.o fred.o
ld -T codecs.t -o my_app first_codec.o second_codec.o common_code.o
Where codecs.t looks something like:
SECTIONS
{
OVERLAY
{
first_codec
{
.text : { first_codec.o(.text) }
}
second_codec
{
.text : { second_codec.o(.text) }
}
}
/* Everything not in an overlay goes here. */
.text : { *(.text) }
.data : { *(.data) }
}
I have not actually tested the above idea you understand, but in theory
it ought to work.
Cheers
Nick