Relocatable code

Richard Earnshaw rearnsha@arm.com
Thu Jan 11 06:17:00 GMT 2001


>   I'm programming with gcc for ARM (ARM7TDMI) and I wonder if there's a
> way to make gcc compile relocatable code. My ARM processor hasn't got an
> MMU and I would want to be able to store programs in flash or receive
> them via serial port and put them to work at any memory region.
> 
>   Another question that I have is the topic of this list. Is my question
> suitable? Which aspects can be discussed here?

Gcc on the ARM support Position Independent Code, but not Position 
Independent Data.  For PIC, use the flag -fPIC.  You may need to do some 
work with the linker to make everything work in your target environment; 
I've never tried PIC except in the context of a shared library on a full 
OS.

Richard.



More information about the Gcc mailing list