This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: PR ld/12761: .gnu.warning.* doesn't work when building shared library
- From: Ian Lance Taylor <iant at google dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Mon, 16 May 2011 23:03:56 -0700
- Subject: Re: PATCH: PR ld/12761: .gnu.warning.* doesn't work when building shared library
- References: <20110516190512.GA10653@intel.com>
"H.J. Lu" <hongjiu.lu@intel.com> 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