This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Relocatable code
- To: Rafael Rodríguez Velilla <rrv at tid dot es>
- Subject: Re: Relocatable code
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Thu, 11 Jan 2001 14:17:22 +0000
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Cc: rearnsha at arm dot com
- Organization: ARM Ltd.
- Reply-To: rearnsha at arm dot com
> 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.