This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: The location counter and 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: 23 Jul 2004 11:48:31 -0400
- Subject: Re: The location counter and OVERLAY command in linker script
- References: <Pine.GSO.4.58.0407222245280.27851@gaia.cc.gatech.edu>
Tao Zhang <zhangtao@cc.gatech.edu> writes:
> Through some experiments, I think the problem is due to the linker
> doesn't update the location couter properly for OVERLAY command.
> According to the manual, "At the end of the overlay, the value of .
> is set to the start address of the overlay plus the size of the
> largest section." I don't understand why the location counter is
> plused by the size of largest section rather than the size of
> all the sections in OVERLAY.
Because we more or less expect that the overlay sections will use a
different LMA, via the > modifier. Then the location counter '.' will
be the VMA, and the sections will actually be loaded elsewhere and
tracked by the memory region.
Ian