From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13775 invoked by alias); 17 May 2011 06:04:19 -0000 Received: (qmail 13749 invoked by uid 22791); 17 May 2011 06:04:18 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 May 2011 06:04:04 +0000 Received: from wpaz24.hot.corp.google.com (wpaz24.hot.corp.google.com [172.24.198.88]) by smtp-out.google.com with ESMTP id p4H642PC021736 for ; Mon, 16 May 2011 23:04:02 -0700 Received: from pva4 (pva4.prod.google.com [10.241.209.4]) by wpaz24.hot.corp.google.com with ESMTP id p4H63xBk018563 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 16 May 2011 23:04:00 -0700 Received: by pva4 with SMTP id 4so91501pva.30 for ; Mon, 16 May 2011 23:03:59 -0700 (PDT) Received: by 10.143.78.12 with SMTP id f12mr201090wfl.58.1305612239623; Mon, 16 May 2011 23:03:59 -0700 (PDT) Received: from coign.google.com ([216.239.45.130]) by mx.google.com with ESMTPS id s39sm215246wfc.16.2011.05.16.23.03.58 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 May 2011 23:03:58 -0700 (PDT) From: Ian Lance Taylor To: "H.J. Lu" Cc: binutils@sourceware.org Subject: Re: PATCH: PR ld/12761: .gnu.warning.* doesn't work when building shared library References: <20110516190512.GA10653@intel.com> Date: Tue, 17 May 2011 06:04:00 -0000 In-Reply-To: <20110516190512.GA10653@intel.com> (H. J. Lu's message of "Mon, 16 May 2011 12:05:12 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2011-05/txt/msg00232.txt.bz2 "H.J. Lu" writes: > We should issure a gnu warning when building shared library. This patch > implements it. OK for trunk? No, this is not how warning symbols are supposed to work. We only want to issue the warning for a warning symbol if there is some reference to the symbol in the main program. If we issue the warnings for a shared library, then we will wind up issuing the warnings even if the program does not ever refer to the symbol. That is undesirable and will almost certainly break some uses of warning symbols. I think it would be reasonable to issue a warning when building a shared library for a reference to a symbol defined in some other shared library, but it is necessary to not give a warning for references to symbols defined in the library being created. Ian