This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: alias of hidden function
On Mon, May 10, 2010 at 05:20:22PM +0100, Dave Korn wrote:
> On 10/05/2010 17:16, Dave Korn wrote:
> > On 10/05/2010 16:19, Jack Howarth wrote:
> >
> >> Compiler executable checksum: c54eb6db87684e4d5a5bb9ad02c2b2c4
> >> 20081222_1.c:16: error: 'EXT_x' aliased to undefined symbol 'INT_x'
>
> > The error comes from finish_aliases_1 in varasm.c, where it is suppressed in
> > the case of a weakref. I don't know why.
>
> Well, I can infer that it would be because it's legitimate not to define a
> weak symbol. I guess the problem might be that find_decl_and_mark_needed when
> called on EXT_x gets confused by the combination of an asm decl as well as an
> alias maybe?
>
> cheers,
> DaveK
Dave,
When I pointed out to the darwin linker maintainer that their gcc 4.0.1
compiler produced an error message...
> gcc-4.0 -O0 -c -o c_lto_20081222_1.o 20081222_1.c
> 20081222_1.c:16: error: 'EXT_x' aliased to undefined symbol 'INT_x'
> 20081222_1.c:16: warning: alias definitions not supported in Mach-O;
> ignored
but that for the newer Apple gcc 4.2.1 compiler (and FSF gcc) we don't
get the 'warning: alias definitions not supported in Mach-O' warning,
his reply was...
--------------------------------------------------------------------------
My understanding is the mach-o file format does not have a way to encode
aliases.
The weak alias case works sometimes, because the compiler just ignores the
alias part and just makes a weak def of the function with the aliased name.
---------------------------------------------------------------------------
I also found http://gcc.gnu.org/ml/gcc/2005-12/msg00009.html where Geoffrey Keating
indicates that Mach-O doesn't support aliases in the object file at all.
Jack
ps I am still trying to find the patch that removed the warning "alias definitions not
upported in Mach-O" from Apple's gcc since that might have some useful comments
on the current situation.