A ELF executable can be reloctable?
Ola Liljedahl
olli@enea.se
Thu Feb 22 13:04:00 GMT 2001
Jonathan Larmour wrote:
>
> > Cliff Tsai wrote:
> >
> > Hi:
> > We know that a ELF shared library is dynamic linking and
> > reloctable,
>
> Actually they don't always need to be relocatable, although it is
> recommended and usually what you want.
>
> > and how about the ELF executables?
> > Are ELF executables reloctable?
>
> Not by default. In general, you need to compile with -fPIC to get this
> although the specifics can differ between architectures.
Many embedded compilers (Green Hills, Diab) generate executable ELF files
with relocation information. We use that to run time load and relocate
ELF programs into OSE single address space (but protected) memory.
With some tricks it is even possible to make GCC generate relocatable
(and absolutely linked) ELF files.
--
Ola
_____________________________________________________________________
Ola Liljedahl olli@enea.se System Architect Enea OSE Systems AB
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com
More information about the crossgcc
mailing list