This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: -fPIC



  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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]