This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 2.5/4 v2] GAS: Make new fake labels when cloning a symbol
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: "Maciej W. Rozycki" <macro at codesourcery dot com>
- Cc: Catherine Moore <clm at codesourcery dot com>, binutils at sourceware dot org
- Date: Sat, 30 Oct 2010 11:01:48 +0100
- Subject: Re: [PATCH 2.5/4 v2] GAS: Make new fake labels when cloning a symbol
- References: <alpine.DEB.1.10.1007241721120.29495@tp.orcam.me.uk> <alpine.DEB.1.10.1010291442440.25860@tp.orcam.me.uk>
"Maciej W. Rozycki" <macro@codesourcery.com> writes:
> 2010-10-29 Maciej W. Rozycki <macro@codesourcery.com>
>
> gas/
> * symbols.h (dot_symbol): New declaration.
> (dot_symbol_init): New prototype.
> * symbols.c (dot_symbol): New variable.
> (dot_symbol_init): New function.
> (symbol_clone_if_forward_ref): Create a new temporary symbol
> when trying to clone dot_symbol.
> * expr.c (current_location): Refer to dot_symbol instead of
> making a new temporary symbol.
> * read.c (read_a_source_file): Update dot_symbol as we go.
> * as.c (main): Call dot_symbol_init.
Looks good. However,
gcc (Debian 4.4.4-8) 4.4.5 20100728 (prerelease)
complains about so-called aliasing violations on these calls:
> + S_SET_NAME (&dot_symbol, ".");
> + S_SET_FORWARD_REF (&dot_symbol);
It's inlining the calls and warning about the local case, which obviously
doesn't apply here. I know it's not usually good practice to recode to
avoid bogus warnings, but let's use:
dot_symbol.bsym->name = ".";
dot_symbol.sy_forward_ref = 1;
anyway. Could you also add a gcc_assert to symbol_clone to make sure
that we don't accidentally clone dot_symbol in other cases?
OK with those changes once 2.21 has branched, thanks.
Richard