This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: PCH and exec-shield...
- From: Mike Stump <mrs at apple dot com>
- To: David Edelsohn <dje at watson dot ibm dot com>
- Cc: Mark Mitchell <mark at codesourcery dot com>, Ian Lance Taylor <ian at wasabisystems dot com>, law at redhat dot com, Eric Christopher <echristo at redhat dot com>, David Daney <ddaney at avtrex dot com>, gcc at gcc dot gnu dot org
- Date: Tue, 16 Mar 2004 14:15:39 -0800
- Subject: Re: PCH and exec-shield...
On Monday, March 15, 2004, at 08:14 PM, David Edelsohn wrote:
How does swizzling pointers on load only when the PCH file could
not be loaded at its original location slow down compilations and
serve no
purpose?
If you accept as true that it could not be loaded at the desired
address, then yes, swizzling is best, we can agree on this.
On Monday, March 15, 2004, at 08:34 PM, Mark Mitchell wrote:
And, on some systems it's the only option;
If it is, then, yes, swizzling is fine.
I'm merely suggesting that it is best not to leap to swizzle on load
prematurely. For example, on darwin, we had problems with this, and
had to invent the host-darwin.c scheme to avoid adding the swizzle
code. If we can, it is best to talk with the kernel and runtime people
to find ways to get an address allocated, in all cases, adding OS or
runtime features as necessary to achieve this.
I'm merely trying to discourage swizzle on load as the first solution,
when other solutions may exist.
Take for example the OS feature of load at random address by default.
This has the effect of making PCH unreliable otherwise. Now, suppose
there is a bit that is inherited across exec that can turn the feature
off, instead of SOL, we should instead just set that bit in gcc.c so
that the invoked compilers are deterministic. Or, maybe there is a bit
in the file-format somewhere that we can set to get determinism, if so,
we should arrange to get that bit set.
For OSes that have just added the feature, but have yet to provide the
don't do this feature, we could politely ask them for such a feature.
So, out of curiosity, on what system is it the only option?