m68k-coff: Unused memory region included in output file?
Toralf Lund
toralf@procaptura.com
Tue Oct 26 15:00:00 GMT 2004
I've been using the following memory region setup for applications
running on our custom M68K board:
MEMORY
{
reserved (rwx) : ORIGIN = 0x000000, LENGTH = 4K
ram (rwx) : ORIGIN = 0x001000, LENGTH = 1M-4K
rom (rx) : ORIGIN = 0xF00000, LENGTH = 128K
user (rx) : ORIGIN = 0xF20000, LENGTH = 768K
registers (rx): ORIGIN = 0xFE0000, LENGTH = 16K
sio (rx): ORIGIN = 0xFE4000, LENGTH = 16K
ivhc (rx): ORIGIN = 0xFE8000, LENGTH = 16K
vme (rx): ORIGIN = 0xFF0000, LENGTH = 64K
}
Of these I actually only use "ram", i.e. all sections have "> ram"; the
rest are included mainly as a reminder of what the memory looks like.
When building with gcc-2.95.3, it looks like only data from ram is
included in the output file, but with 3.3.3 it's different - the
"reserved" region seems to be written, too, even though no output data
is directed to it. Or at least, the .text segment, which is written to
the start of "ram" appears at offset 0x1000 of the actual program data
within the file, while it used to start at the very beginning.
If I change "reserved (rwx)" to "reserved (rx)" this no longer happens.
Actually that's the way it should have been set up from the beginning,
and it may not even be such a great idea to include unused regions in
the first place, but the point is that *something* has changed between
gcc 2 and 3, and I'd like to know what.
Can anyone enlighten me?
- Toralf
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com
More information about the crossgcc
mailing list