[PATCH 2.5/4 v2] GAS: Make new fake labels when cloning a symbol
Richard Sandiford
rdsandiford@googlemail.com
Sat Oct 30 10:01:00 GMT 2010
"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
More information about the Binutils
mailing list