From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11106 invoked by alias); 16 Mar 2004 04:34:59 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 11098 invoked from network); 16 Mar 2004 04:34:58 -0000 Received: from unknown (HELO mail.codesourcery.com) (65.74.133.6) by sources.redhat.com with SMTP; 16 Mar 2004 04:34:58 -0000 Received: (qmail 2315 invoked from network); 16 Mar 2004 04:34:57 -0000 Received: from 227.148-60-66-fuji-dsl.static.surewest.net (HELO codesourcery.com) (mitchell@66.60.148.227) by mail.codesourcery.com with SMTP; 16 Mar 2004 04:34:57 -0000 Message-ID: <405683F2.2060306@codesourcery.com> Date: Tue, 16 Mar 2004 04:34:00 -0000 From: Mark Mitchell Organization: CodeSourcery, LLC User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 MIME-Version: 1.0 To: Mike Stump CC: Ian Lance Taylor , law@redhat.com, Eric Christopher , David Daney , gcc@gcc.gnu.org Subject: Re: PCH and exec-shield... References: <2AF2A084-76FB-11D8-B0DE-003065A77310@apple.com> In-Reply-To: <2AF2A084-76FB-11D8-B0DE-003065A77310@apple.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-03/txt/msg00776.txt.bz2 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