* Can we move location counter backwards?
@ 2006-08-22 18:04 H. J. Lu
2006-08-22 18:36 ` H. J. Lu
0 siblings, 1 reply; 2+ messages in thread
From: H. J. Lu @ 2006-08-22 18:04 UTC (permalink / raw)
To: binutils
The linker manual says "The location counter may never be moved
backwards." But in the same manual, there are
Note that the `OVERLAY' command is just syntactic sugar, since
everything it does can be done using the more basic commands. The
above example could have been written identically as follows.
.text0 0x1000 : AT (0x4000) { o1/*.o(.text) }
__load_start_text0 = LOADADDR (.text0);
__load_stop_text0 = LOADADDR (.text0) + SIZEOF (.text0);
.text1 0x1000 : AT (0x4000 + SIZEOF (.text0)) { o2/*.o(.text) }
__load_start_text1 = LOADADDR (.text1);
__load_stop_text1 = LOADADDR (.text1) + SIZEOF (.text1);
. = 0x1000 + MAX (SIZEOF (.text0), SIZEOF (.text1));
It moves the location counter backwards implicitly. It is the same as
.text0 0x1000 : AT (0x4000) { o1/*.o(.text) }
__load_start_text0 = LOADADDR (.text0);
__load_stop_text0 = LOADADDR (.text0) + SIZEOF (.text0);
. = 0x1000;
.text1 : AT (0x4000 + SIZEOF (.text0)) { o2/*.o(.text) }
__load_start_text1 = LOADADDR (.text1);
__load_stop_text1 = LOADADDR (.text1) + SIZEOF (.text1);
. = 0x1000 + MAX (SIZEOF (.text0), SIZEOF (.text1));
Given that linker does allow/support moving the location counter
backwards, should we remove "The location counter may never be moved
backwards." from the linker manual?
H.J.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Can we move location counter backwards?
2006-08-22 18:04 Can we move location counter backwards? H. J. Lu
@ 2006-08-22 18:36 ` H. J. Lu
0 siblings, 0 replies; 2+ messages in thread
From: H. J. Lu @ 2006-08-22 18:36 UTC (permalink / raw)
To: binutils
On Tue, Aug 22, 2006 at 10:22:52AM -0700, H. J. Lu wrote:
> The linker manual says "The location counter may never be moved
> backwards." But in the same manual, there are
>
> Note that the `OVERLAY' command is just syntactic sugar, since
> everything it does can be done using the more basic commands. The
> above example could have been written identically as follows.
>
> .text0 0x1000 : AT (0x4000) { o1/*.o(.text) }
> __load_start_text0 = LOADADDR (.text0);
> __load_stop_text0 = LOADADDR (.text0) + SIZEOF (.text0);
> .text1 0x1000 : AT (0x4000 + SIZEOF (.text0)) { o2/*.o(.text) }
> __load_start_text1 = LOADADDR (.text1);
> __load_stop_text1 = LOADADDR (.text1) + SIZEOF (.text1);
> . = 0x1000 + MAX (SIZEOF (.text0), SIZEOF (.text1));
>
> It moves the location counter backwards implicitly. It is the same as
>
> .text0 0x1000 : AT (0x4000) { o1/*.o(.text) }
> __load_start_text0 = LOADADDR (.text0);
> __load_stop_text0 = LOADADDR (.text0) + SIZEOF (.text0);
> . = 0x1000;
> .text1 : AT (0x4000 + SIZEOF (.text0)) { o2/*.o(.text) }
> __load_start_text1 = LOADADDR (.text1);
> __load_stop_text1 = LOADADDR (.text1) + SIZEOF (.text1);
> . = 0x1000 + MAX (SIZEOF (.text0), SIZEOF (.text1));
>
> Given that linker does allow/support moving the location counter
> backwards, should we remove "The location counter may never be moved
> backwards." from the linker manual?
Nevermind. The linker manual has been updated.
H.J.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-08-22 17:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-22 18:04 Can we move location counter backwards? H. J. Lu
2006-08-22 18:36 ` H. J. Lu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).