This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


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

Re: 2.9.1 gas, PowerPC, and PIC


   Date: Wed, 30 Jun 1999 16:14:29 -0500 (CDT)
   From: Thomas A Peterson <tap@htc.honeywell.com>

   >>>>> "ILT" == Ian Lance Taylor <ian@zembu.com> writes:

     ILT>    Date: Wed, 30 Jun 1999 15:39:40 -0500 (CDT)
     ILT>    From: Thomas A Peterson <tap@htc.honeywell.com>

     ILT>    It looks like gas does not support PIC for the PowerPC. Can someone
     ILT>    clue me in on how big of an effort it would be to add PIC support to
     ILT>    gas for the PowerPC.

     ILT> Gas certainly does support PIC for PowerPC ELF.  What makes you say
     ILT> that it does not?

   There is no reference to it from the gas NEWS file.

As far as I know, it was there from the start.  Note that ``PowerPC
ELF support added'' appears in release 2.7, after ``Added PIC support
to Solaris and SPARC SunOS 4 assembler'' was added in release 2.6.

   Also, the GCC info file seems to be lagging.

      From the GCC info file with 2.8.1

      * The GNU assembler (GAS) does not support PIC.  To generate PIC
	code, you must use some other assembler, such as `/bin/as'.

I believe this unfortunate error has been corrected since the 2.8.1
release.  It should be correct in egcs.

     ILT> Note that PowerPC code tends to be position independent by its very
     ILT> nature.  What it means for gas to support PIC for PowerPC ELF is that
     ILT> it supports the generation of various special relocation types.

   Here is my example that's causing me grief.  I would expect a procedure
   linkage table but there is none instead I'm getting relocations that would
   require the code segment to be writable (DT_TEXTREL).  

I think you forgot to include the source code.

   Am I confused as to what it means for gas to support PIC?  Ultimately, I
   need the code to execute from flash or ROM and not RAM.

What gas means by PIC support is that it generates relocations which
are resolved by an ELF style dynamic linker, as on a Unix system.

If you are talking about flash or ROM, you may be interested in the
-mrelocatable option which is available with gcc.  See the PowerPC
specific section of the gcc documentation.

Ian

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