Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Aug 1997 19:33:49 -0700 (PDT)
From:      Mike Haertel <mike@ducky.net>
To:        dyson@FreeBSD.ORG
Cc:        hackers@FreeBSD.ORG
Subject:   Re: PIC (was: shared libraries?)
Message-ID:  <199708310233.TAA00415@ducky.net>

next in thread | raw e-mail | index | archive | help
John S. Dyson wrote:
>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.

One thing that's always baffled me is, why does gcc insist
on *dedicating* a register for the global offset table pointer?

I would hope that instead of dedicating a register, they would
just make the global offset table pointer a regular variable
subject to register allocation just like any other variable.
Then, code that doesn't use global variables wouldn't be hurt
by being put in a shared library.



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