From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6299 invoked by alias); 14 Mar 2008 17:36:20 -0000 Received: (qmail 6289 invoked by uid 22791); 14 Mar 2008 17:36:19 -0000 X-Spam-Check-By: sourceware.org Received: from ns2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 14 Mar 2008 17:35:59 +0000 Received: from Relay2.suse.de (relay-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 3BB283BAB3 for ; Fri, 14 Mar 2008 18:35:57 +0100 (CET) Date: Fri, 14 Mar 2008 17:45:00 -0000 From: Michael Matz To: gcc-patches@gcc.gnu.org Subject: [patch] Hide some more libgcov functions Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2008-03/txt/msg00911.txt.bz2 Hi, this turned up in local testing (with Tcl). The problem is when a shared lib and the main executable both are built with -fprofile-generate and both use the IOR counter. As the merge_ior function currently is not hidden it will be exported from the shared lib and found for the reference in the executable. But the executable and the shared lib have their own private copy of the gcov_var variable. At one point it isn't yet initialized for the shared lib, but the executable already calls the merge_ior function (expecting it to access it's own data of course) --> abort. The gcov_fork function would have the same problem (it itself calls gcov_flush, which is hidden). Simply hiding both (like most other functions already are) solves this. Regstrapping for trunk in progress. Okay for trunk and 4.3.1? Ciao, Michael. -- * gcov-io.h (__gcov_merge_ior, __gcov_fork): Mark hidden. Index: gcc/gcov-io.h =================================================================== --- gcc/gcov-io.h (revision 133208) +++ gcc/gcov-io.h (working copy) @@ -467,6 +467,9 @@ extern void __gcov_merge_single (gcov_ty consecutive values. */ extern void __gcov_merge_delta (gcov_type *, unsigned) ATTRIBUTE_HIDDEN; +/* The merge function that just ors the counters together. */ +extern void __gcov_merge_ior (gcov_type *, unsigned) ATTRIBUTE_HIDDEN; + /* The profiler functions. */ extern void __gcov_interval_profiler (gcov_type *, gcov_type, int, unsigned); extern void __gcov_pow2_profiler (gcov_type *, gcov_type); @@ -474,11 +477,10 @@ extern void __gcov_one_value_profiler (g extern void __gcov_indirect_call_profiler (gcov_type *, gcov_type, void *, void *); extern void __gcov_average_profiler (gcov_type *, gcov_type); extern void __gcov_ior_profiler (gcov_type *, gcov_type); -extern void __gcov_merge_ior (gcov_type *, unsigned); #ifndef inhibit_libc /* The wrappers around some library functions.. */ -extern pid_t __gcov_fork (void); +extern pid_t __gcov_fork (void) ATTRIBUTE_HIDDEN; extern int __gcov_execl (const char *, const char *, ...) ATTRIBUTE_HIDDEN; extern int __gcov_execlp (const char *, const char *, ...) ATTRIBUTE_HIDDEN; extern int __gcov_execle (const char *, const char *, ...) ATTRIBUTE_HIDDEN;