This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -fPIC
- To: "erik.ivanenko" <erik dot ivanenko at utoronto dot ca>
- Subject: Re: -fPIC
- From: Jeffrey A Law <law at upchuck dot cygnus dot com>
- Date: Wed, 19 May 1999 11:29:50 -0600
- cc: "egcs at egcs dot cygnus dot com" <egcs at egcs dot cygnus dot com>
- Reply-To: law at cygnus dot com
In message <37430FAF.ECDC716F@utoronto.ca>you write:
> Sorry, I have a cold and am not thinking straight. I'll try to be more
> accurate.
:-)
> The cross compiler targets i386-rtemself. The goal is to build an image
> that can run threads that are loaded from a file system. This means that
> the thread would use a global offset table to resolve all references to
> symbols defined outside the thread itself, like the RTEMS kernel, TCP/IP
> stack, file-system services etc....
>
> I hope that is clearer. I suppose that since it is done for linux, it
> could also be done for RTEMS. How much work I can't say -- perhaps just
> a linker script or two?
I suspect the compiler, assembler & linker can probably handle what you are
trying to do. But you've still got the issue of dynamic loading and symbol
binding, which is what drives a lot of the linker's actions with PIC code.
ie, you still have to fill in the GOT/PLT at runtime. If your dynamic linker
uses the same conventions for relocations, layout, etc as the linux dynamic
linker, then you're ready to go. Else you may have to tweak the output from
the linker to be compatible with your dynamic loader.
jeff