This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: multiple SECTIONS and/or MEMORY commands
- To: John Marshall <jmarshall at acm dot org>
- Subject: Re: multiple SECTIONS and/or MEMORY commands
- From: Alan Modra <amodra at bigpond dot net dot au>
- Date: Tue, 30 Oct 2001 13:54:32 +1030
- Cc: binutils at sources dot redhat dot com
- References: <20011029214504.A10551@kahikatea.pohutukawa.gen.nz>
On Mon, Oct 29, 2001 at 09:45:04PM +0000, John Marshall wrote:
> The ld documention (in the Options node) cautions
>
> Note that specifying a script in this way [as an implicit linker
> script] should only be used to augment the main linker script;
> if you want to use some command that logically can only appear
> once, such as the `SECTIONS' or `MEMORY' command, you must
> replace the default linker script using the `-T' option.
>
> Is this appearing-only-once thing simply convention, or is there (or might
> there be in the future) something in the linker that depends on it?
There may have been some such restriction in the past, but looking at
ldgram.y, I see no reason why you can't have multiple MEMORY or SECTIONS
commands. If there is a contradiction between ld.texinfo and ldgram.y,
ldgram.y is the definitive source. ;-)
Alan