PCH and exec-shield...
Ian Lance Taylor
ian@wasabisystems.com
Mon Mar 8 21:13:00 GMT 2004
Mark Mitchell <mark@codesourcery.com> writes:
> >Not to get too far out, but is there any way that PCH could work even
> >when exec-shield is enabled?
> >
> Geoff has already given you the current, platform-specific, approach.
>
> There is a more general approach used by other PCH implementations
> which involves walking the loaded PCH and swizzling pointers. That
> would be a superior approach as it would make PCH more robust on all
> platforms, and would permit people to use exec-shield randomization
> (and similar features on other operating systems) with PCH.
>
> Until that is implemented, many people will probably complain that PCH
> is broken.
Well, I do take Geoff's point that it's faster to use a PCH if you
don't have to swizzle pointers when you load it. And Richard did
manage to work out approaches which work using exec-shield on Linux
(and so did I, for that matter, although Richard's are better).
You just mentioned pointer hashing--I don't think that pointer hashing
requires pointer swizzling when loading a PCH with the current
approach; I think it just requires pointer swizzling when the PCH is
created.
On the other hand, I agree with you that it would be a good idea to
implement PCH pointer swizzling on load as a fallback mechanism for
cases in which the PCH can not be loaded at the predicted memory
address.
Ian
More information about the Gcc
mailing list