Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Aug 1997 23:05:22 -0500 (EST)
From:      "John S. Dyson" <toor@dyson.iquest.net>
To:        perlsta@fang.cs.sunyit.edu (Alfred Perlstein)
Cc:        hackers@FreeBSD.ORG
Subject:   Re: PIC (was: shared libraries?)
Message-ID:  <199708300405.XAA00224@dyson.iquest.net>
In-Reply-To: <Pine.BSF.3.95.970830025252.9057A-100000@fang.cs.sunyit.edu> from Alfred Perlstein at "Aug 30, 97 03:01:45 am"

next in thread | previous in thread | raw e-mail | index | archive | help
Alfred Perlstein said:
> > 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.
> 
> ummmm, as far as i know the 386 and beyond greatly reduced the addressing
> restrictions placed on code, almost any register is avalable for
> addressing and since you can load the PC into a register i don't see the
> problem here.
> 
Basically, PIC requires the use of an additional base register.  That
adds register pressure and complicates the needed addressing modes.  There
are only 6 or 7 registers to begin with on an X86.  Please look at the
code that gcc creates with the -fpic option.  It isn't gcc's fault that
the code looks more complex.  It seems that the X86 could use at least a
few more registers :-(, but there are always design tradeoffs.
 
-- 
John
dyson@freebsd.org
jdyson@nc.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199708300405.XAA00224>