This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Need help on OVERLAY command in linker script...
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: Tao Zhang <zhangtao at cc dot gatech dot edu>
- Cc: binutils at sources dot redhat dot com
- Date: 29 Jun 2004 21:28:16 -0400
- Subject: Re: Need help on OVERLAY command in linker script...
- References: <Pine.GSO.4.58.0406291336160.2096@gaia.cc.gatech.edu>
Tao Zhang <zhangtao@cc.gatech.edu> writes:
> I modified the standard linker script a little bit:
>
> [skip...]
> .text :
> {
> foo1.o(.text) foo2.o(.text)
> }
> OVERLAY :
> {
> .ovly0 { ovly0.o(.text) }
> .ovly1 { ovly1.o(.text) }
> .ovly2 { ovly2.o(.text) }
> }
> .text :
> {
> *(.text)
> }
Presumably these appear inside a SECTIONS construct.
I'm not sure that it makes sense to use OVERLAY without using either
AT to specify the LMA or > to specify a memory region.
It's very odd to specify .text more than once. I think that will
create two different .text sections. Do you want the overlay space to
be within the .text section? Why?
> The result is that the binary doesn't contain .ovly0, .ovly1 and .ovly2
> sections at all, it looks the overlay command is simply ignored.
That is hard to understand. Generate a linker map using the -M option
to see what happened to those sections.
Ian