This is the mail archive of the
mailing list for the GCC project.
Re: Relocatable code
- To: rrv at tid dot es
- Subject: Re: Relocatable code
- From: Nick Clifton <nickc at redhat dot com>
- Date: Thu, 11 Jan 2001 10:14:42 -0800
- CC: gcc at gcc dot gnu dot org
> 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.
Richard mentioned compiling Position Independent Code. Another method
you could try is to compile position dependent code (ie the default
that gcc-arm-elf generates), but link it with the --emit-relocs linker
switch. This will preserve the relocations in the resulting binary
and then your loader will have to process them in order to create a
working executable. Note - I have not actually tried this in
practice, so I do not guarantee that it will work, but it should be
> Another question that I have is the topic of this list. Is my
> question suitable? Which aspects can be discussed here?
The question is OK. The gcc list is:
a high volume list for general development discussions
about GCC. Anything not covered by other mailing lists
is suitable for discussion here.
For information about all of the lists see: