This is the mail archive of the
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.email@example.com>
Tao Zhang <firstname.lastname@example.org> 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.