linker memory mapping

Ian Lance Taylor iant@google.com
Mon Aug 30 21:42:00 GMT 2010


Ramana <ramana.venkat83@gmail.com> writes:

> I am working on a binutils port. The target has program memory as both
> ROM and RAM and all of the code which will run on the target will have
> to be linked to its own at link time. There is no further load/run
> time relocation. We need to burn the hand written assembly onto ROM
> during fabrication and all the other compiled code should go into RAM.
> Different applications which get compiled and mapped into RAM will
> refer to the hand written assembly on the ROM.
>
> How the linker should handle linking and memory mapping in this case?
> Will generating two "absolute" images one for the assembly code to go
> into ROM and other one for the compiled code to go into RAM work? The
> linker will know the ROM locations and will fix the references to ROM
> in the compiled code mapped into RAM.
>
> Are there any other better approaches for this? And also where should
> I map the data of hand written assembly, onto ROM or RAM?

If your system is going to copy memory from ROM to RAM at runtime, then
you probably want to use AT in a linker script.

If not, then you probably want to build a ROM image, and refer to it
with -R when linking other programs.

Ian



More information about the Binutils mailing list