*BSD News Article 10835


Return to BSD News archive

Received: by minnie.vk1xwt.ampr.org with NNTP
	id AA782 ; Sun, 07 Feb 93 16:00:39 EST
Newsgroups: comp.unix.bsd
Path: sserve!manuel.anu.edu.au!munnari.oz.au!sgiblab!sdd.hp.com!caen!destroyer!cs.ubc.ca!unixg.ubc.ca!kakwa.ucs.ualberta.ca!acs.ucalgary.ca!cpsc.ucalgary.ca!xenlink!newt.cuc.ab.ca!deraadt
From: deraadt@newt.cuc.ab.ca (Theo de Raadt)
Subject: Re: [386BSD] gcc2 and -fPIC
In-Reply-To: hlu@eecs.wsu.edu's message of Wed, 27 Jan 93 04: 46:27 GMT
Message-ID: <DERAADT.93Feb1191005@newt.newt.cuc.ab.ca>
Sender: news@newt.cuc.ab.ca
Nntp-Posting-Host: newt.fsa.ca
Organization: little lizard city
References: <CGD.93Jan25211237@eden.CS.Berkeley.EDU>
	<1993Jan26.210430.27806@serval.net.wsu.edu>
	<1993Jan27.002600.21136@jpl-devvax.jpl.nasa.gov>
	<1993Jan27.044627.2756@serval.net.wsu.edu>
Date: Tue, 2 Feb 1993 02:10:05 GMT
Lines: 38

In article <1993Jan27.044627.2756@serval.net.wsu.edu> hlu@eecs.wsu.edu (H.J. Lu) writes:
>  Not even SUN uses that a.out format anymore. ELF is the way to go.

Why?

>  Those patches are for psudo PIC for SVR3. I don't care SVR3. I want ELF.

Why??

   |> 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.

>  That is precisely why I want PIC. I'like to see PIC/ELF be used in 386bsd
>  and Linux.

You're not making a lot of sense.... ELF has very little to do with
PIC.  As it stands, PIC can be used very well for shared libraries.
PIC is acceptable for that use because it makes base-address-less
libraries easy to impliment (actually, more like it makes them
"possible".)

But, on most cpus PIC is a bad idea because it is slower than the
non-PIC code we are used to. If you really wanted to use PIC for
everything, then yes, the a.out format is insufficient (because ELF
contains information on base addresses, etc. whereas a.out does not).
But, when you get right down to it, you DON'T WANT TO use PIC for
everything. It has no real advantage!

For shared libraries, using PIC is the correct(tm) implimentation. But,
shared libraries don't require ELF at ALL. (I much prefer a.out, it
follows the KISS principle.)
 <tdr.
--

This space not left unintentionally unblank.		deraadt@newt.cuc.ab.ca