This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.
See the CrossGCC FAQ for lots more information.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
[ snip ]Is there any way I can obtain info from the linker script's MEMORY spec from within my code? Are the parameters made available as symbols by the linker or anything?
- Toralf
You can certainly do it if you have your own linker script. For example, you might have something like this in your linker file:
.bss (NOLOAD) : { . = ALIGN(0x4); __bss_start = .; *(.shbss) *(.bss) *(COMMON) _end = ALIGN (0x8); /* Used by sbrk() as start of heap */ __bss_end = _end; } > IRam
You can then have C code like:
extern unsigned long int __bss_start, __bss_end;
MEMORY { IRam (rwx) : ORIGIN = 0x001000, LENGTH = 1M }
PROVIDE (__ram_start = 0x001000); PROVIDE (__ram_end = 0x001000+1M);
------ Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |