*BSD News Article 10416


Return to BSD News archive

Received: by minnie.vk1xwt.ampr.org with NNTP
	id AA82 ; Thu, 28 Jan 93 07:00:16 EST
Newsgroups: comp.unix.bsd
Path: sserve!manuel.anu.edu.au!munnari.oz.au!sgiblab!swrinde!elroy.jpl.nasa.gov!ufo!kaleb
From: kaleb@jpl-devvax.jpl.nasa.gov (Kaleb Keithley)
Subject: Re: [386BSD] gcc2 and -fPIC
Message-ID: <1993Jan27.002600.21136@jpl-devvax.jpl.nasa.gov>
Organization: Jet Propulsion Laboratory (NASA)
References: <CGD.93Jan25211237@eden.CS.Berkeley.EDU> <1993Jan26.210430.27806@serval.net.wsu.edu>
Date: Wed, 27 Jan 1993 00:26:00 GMT
Lines: 34

In article <1993Jan26.210430.27806@serval.net.wsu.edu> hlu@eecs.wsu.edu (H.J. Lu) writes:
>In article <CGD.93Jan25211237@eden.CS.Berkeley.EDU>, cgd@eden.CS.Berkeley.EDU (Chris G. Demetriou) writes:
>|> anybody gotten code compiled w/gcc2's -fPIC to assemble properly
>|> (or "at all") under 386bsd?
>|> 
>That is because as on bsd doesn't support PIC yet. That leads to another
>question. I believe a.out format is not very good for PIC even with some
>patches. Personally, I prefer ELF. The problem is gnu binutils 2.x and
>gas do not fully support ELF. I was wondering if anyone has done something
>on ELF?

Huh?  a.out and PIC work pretty good on Sun.  I always understood the
difference between PIC and non-PIC was the use of relative addressing
versus "hard" addressing.  I'm sure the assembler is more than capable
of handling relative offsets if the compiler generates them correctly.

Gcc doesn't grok PIC on any 386 machine, period, e.g. Sun 386i -- at 
least that's what I was told when I asked gnu.gcc.help.  There are patches 
out there to make gcc generate PIC on 386.  One author of such patches told 
me that Stallman didn't like them because they broke other things, or didn't 
fit the gcc conceptual design or some other blather...

Anyway, ask around on gnu.gcc.help -- the patches are out there!

BTW, you probably already know this, but I'll mention it for what it's
worth.  99&44/100% of all things compiled with PIC go into shared 
"libraries".  Getting things compiled/assembled with PIC is only half the 
battle.  Then you have to modify 'ld' to create the library with the PIC 
objects.  At least you'll want to handle the pure-text assertion.

-- 

Kaleb Keithley                               kaleb@jpl-devvax.jpl.nasa.gov