From owner-freebsd-hackers Fri Aug 29 19:08:26 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id TAA12181 for hackers-outgoing; Fri, 29 Aug 1997 19:08:26 -0700 (PDT) Received: from nico.telstra.net (nico.telstra.net [139.130.204.16]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id TAA12124 for ; Fri, 29 Aug 1997 19:07:54 -0700 (PDT) Received: from freebie.lemis.com (gregl1.lnk.telstra.net [139.130.136.133]) by nico.telstra.net (8.6.10/8.6.10) with ESMTP id MAA20259; Sat, 30 Aug 1997 12:00:28 +1000 Received: (grog@localhost) by freebie.lemis.com (8.8.7/8.6.12) id LAA13672; Sat, 30 Aug 1997 11:30:25 +0930 (CST) Message-ID: <19970830113025.45435@lemis.com> Date: Sat, 30 Aug 1997 11:30:25 +0930 From: Greg Lehey To: Eivind Eklund Cc: Marty Leisner , louie@transsys.com, imp@rover.village.org, dave@jetcafe.org, sef@Kithrup.COM, hackers@FreeBSD.ORG Subject: PIC (was: shared libraries?) References: <199708290035.UAA17627@whizzo.TransSys.COM> <9708291449.AA17699@gnu.sdsp.mc.xerox.com> <199708291734.TAA01553@bitbox.follo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.81e In-Reply-To: <199708291734.TAA01553@bitbox.follo.net>; from Eivind Eklund on Fri, Aug 29, 1997 at 07:34:17PM +0200 Organisation: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8250 Fax: +61-8-8388-8250 Mobile: +61-41-739-7062 WWW-Home-Page: http://www.lemis.com/~grog Fight-Spam-Now: http://www.cauce.org Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Fri, Aug 29, 1997 at 07:34:17PM +0200, Eivind Eklund wrote: >> >> >> Can someone point me to a reference (or explain it briefly) how PIC >> works? > > Basically just by doing all memory references relative to a register, > which usually initially was set up relative to the PC (program > counter, AKA instruction pointer). Thus, you can load it on any > address in your computer, and it will work just like it was supposed > to. Probably the most important factor in PIC is the instruction set. Many systems generate PIC by default, or with few constraints. The i386 architecture doesn't, unfortunately, and to generate PIC you have to do without a number of instructions or address modes. As a result, the code is less efficient. Greg