Address assignment

DJ Delorie dj@redhat.com
Wed Sep 14 05:38:00 GMT 2005


If what you mean is something like "I have this structure, but it exists
at a specific address" you can easily do this in the assembler like this:

	.global _my_struct
_my_struct = 0xa0001028

The linker doesn't care *what* a symbol is, just *where* it is.  The
above gives it an absolute address (it shows up in the "*ABS*"
section) but doesn't allocate any space for it (sorry, no overlap
protection).


If what you mean is "I want code in this block of flash, and data in
this block of RAM" then you want to look up the MEMORY directive for
link scripts in the linker manual ("info ld").  If you download the
latest newlib from CVS and look at libgloss/m32c you'll see a number
of examples of how to manage all that.



More information about the Binutils mailing list