Return to BSD News archive
Received: by minnie.vk1xwt.ampr.org with NNTP id AA94 ; Thu, 28 Jan 93 09:00:33 EST Newsgroups: comp.unix.bsd Path: sserve!manuel.anu.edu.au!munnari.oz.au!sgiblab!swrinde!elroy.jpl.nasa.gov!ames!saimiri.primate.wisc.edu!usenet.coe.montana.edu!news.u.washington.edu!serval!hlu From: hlu@eecs.wsu.edu (H.J. Lu) Subject: Re: [386BSD] gcc2 and -fPIC Message-ID: <1993Jan27.044627.2756@serval.net.wsu.edu> Sender: news@serval.net.wsu.edu (USENET News System) Organization: School of EECS, Washington State University References: <CGD.93Jan25211237@eden.CS.Berkeley.EDU> <1993Jan26.210430.27806@serval.net.wsu.edu> <1993Jan27.002600.21136@jpl-devvax.jpl.nasa.gov> Date: Wed, 27 Jan 93 04:46:27 GMT Lines: 50 In article <1993Jan27.002600.21136@jpl-devvax.jpl.nasa.gov>, kaleb@jpl-devvax.jpl.nasa.gov (Kaleb Keithley) writes: |> 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. |> Not even SUN uses that a.out format anymore. ELF is the way to go. |> Gcc doesn't grok PIC on any 386 machine, period, e.g. Sun 386i -- at You haven't try -fPIC -O on libg++-2.3 yet. |> 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! Those patches are for psudo PIC for SVR3. I don't care SVR3. I want ELF. |> |> 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 That is precisely why I want PIC. I'like to see PIC/ELF be used in 386bsd and Linux. H.J.