Changes to an ABI for -fpic and -fPIC

Jeffrey A Law law@upchuck.cygnus.com
Wed Mar 31 23:54:00 GMT 1999


  In message < 36EEC1A7.6B637836@email.sps.mot.com >you write:
  > Could somebody provide me with a pointer to information/documentation on
  > the changes that GNU/Egcs makes to an ABI in order to accomodate -fpic
  > and -fPIC?
Typically we try to follow whatever the ABI specifies for PIC code generation.
The majority of systems now define how code should be generated for PIC.


  > For example, the GNU/Egcs targets for M68K and PPC implement a SVR4 (more or
  > less) ABI which doesn't explicitly call out pic conventions, yet I observe 
  > -fpic and -fPIC being utilized by members of this group. I've experimented
  > some to observe the changes in instructions, but I'd like some reliable
  > documentation to pull all the pieces together.
If the ABI doesn't specify a register, then gcc is free to select any register
it wants so long as it continues to follow the caller/callee register
conventions.

Some systems may even make the PIC register vary from function to function
(I believe ppc svr4 does this).  However, there are some serious technical
problems with this approach and I suspect we'll move away from such schemes.

jeff



More information about the Gcc-bugs mailing list