PCH and exec-shield...

Mike Stump mrs@apple.com
Tue Mar 16 22:17:00 GMT 2004


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?



More information about the Gcc mailing list