C Startup Code
Andrew Pines
apines@cosmodog.com
Thu Apr 19 08:04:00 GMT 2001
In the linkfile, something along the lines of:
MEMORY
{
ROM : ORIGIN = 0x00000000, LENGTH = 0x020000
RAM : ORIGIN = 0x00020000, LENGTH = 0x001000
}
will cause the linker to fail if the size of a section is exceeded.
-Andrew
John Clarke wrote:
>
> On Tue, Apr 17, 2001 at 11:19:41PM -0500, Andrew Pines wrote:
>
> > SECTIONS
> > {
> > .text :
> > {
> > _text = .; /* start of text */
> > *(.rodata) /* read only data (in ROM) */
> > *(.text) /* code */
> > _etext = .; /* end of text */
> > } >ROM
> >
> > .data : AT (ADDR(.text) + SIZEOF(.text)) /* place initialized
> > data after read only data in ROM, but reference to it in RAM */
> > {
> > _data = .; /* RAM location of initialized data */
> > *(.data)
> > _edata = .; /* end of data, used to copy initialized
> > data at start up */
> > } >RAM
>
> What happens if SIZEOF(.text) + SIZEOF(.data) is greater than the size
> of the ROM area? Is there any way to have the linker produce a warning
> or an error?
>
> Cheers,
>
> John
> --
> whois !JC774-AU@whois.aunic.net
>
> ------
> Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
> Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com
--
Andrew Pines
apines@cosmodog.com
http://www.cosmodog.com
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com
More information about the crossgcc
mailing list