This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: PCH and exec-shield...
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Mike Stump <mrs at apple dot com>
- Cc: 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: Mon, 15 Mar 2004 20:34:58 -0800
- Subject: Re: PCH and exec-shield...
- Organization: CodeSourcery, LLC
- References: <2AF2A084-76FB-11D8-B0DE-003065A77310@apple.com>
Mike Stump wrote:
On Monday, March 8, 2004, at 01:04 PM, Mark Mitchell wrote:
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.
Using a feature that serves no purpose other than to slow down
compilations can reasonably be considered a bug. By having PCH swizzle
on load, we permit the introductions of bugs into the compiler. This is
bad. This is why it hasn't been done.
For robustness we should fall back to the normal .h file and pretend the
PCH file doesn't exist. I think we might just give a sorry now, that
might be wrong.
I agree that falling back to the normal .h file would be much better
than giving an error message.
But, there is good evidence (EDG's implementation) that swizzling is
often much faster than reparsing. And, on some systems it's the only
option; the system does not reliably place things at the same addresses
on multiple executions. An approach that tries to put things at the
same addresses, but then falls back to swizzling if necessary, would
provide a better user experience than your approach, all other things
being equal.
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com