This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: equating symbols to undefined
- From: "H. J. Lu" <hjl at lucon dot org>
- To: Jan Beulich <JBeulich at novell dot com>
- Cc: binutils at sourceware dot org
- Date: Tue, 11 Oct 2005 08:07:53 -0700
- Subject: Re: equating symbols to undefined
- References: <434BEEFE.76F0.0078.0@novell.com>
On Tue, Oct 11, 2005 at 04:57:34PM +0200, Jan Beulich wrote:
> H.J.,
>
> what is the purpose of disallowing equates of non-globals to undefined
> symbols? The example you give in bug 857 doesn't seem to point out an
> assembler problem, but rather a compiler one. Given that there is no
> generic way to create aliases of symbols (ia64 has the .alias directive
> for this), this is the only alternative. From the assembler's
> perspective I see nothing wrong with the 'bad' case of the example.
>
> Specifically, I use this to force compiler generated function calls
> (i.e. memcpy) to go to certain replacement functions (necessary in
> specialized environments). Having to additionally specify .global for
> the alias seems not only superfluous, but (at least to me) wrong, since
> now one must differentiate between the file implementing the function
> and files using it (meaning that a common header file implementation is
> no longer possible). This is because in the implementing file using
> .global on the alias makes it appear as global defined symbol in the
> symbol table, which for the given example is wrong (there is a
> general-purpose memcpy available, it's use is just to be avoided in the
> specific files).
>
> Unless you can point out a way to obtain previous behavior by other
> means I'd like to request to undo this part of the patch (and instead
> fix the compiler to fulfill the guarantees made for users of that
> __attribute__).
Local symbols must be defined. Do you have an example for an undefined
local symbol?
FYI, I proposed to add .alias to the generic assembler. But people
didn't feel it was useful. It is trivial to move .alias to ia64 to
generic.
H.J.