This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Bug gas/m68k] parse error with m68k-aout targets
On Mon, Nov 28, 2005 at 12:02:32PM -0800, Ian Lance Taylor wrote:
> Gunther Nikl <gni@gecko.de> writes:
>
> > It is a hard to detect bug. It was now detected with binutils-2.14
> > sources because bfd/libbfd.c/warn_deprecated has a static variable
> > "mask". Since the variable is static it is emitted without a prepended
> > underscore with a.out systems. Thus by renaming the variable the
> > problem goes away for this particular source.
>
> Even a static variable should have a prepended underscore. Otherwise
> it is impossible to say something like
> static int d0;
> Not using an underscore is clearly a bug.
You are correct. I don't know why I didn't think about that myself.
FWIW, no GAS2 version probably could assemble such code. GAS 1.38.1
does.
> Are you using gcc? If so, which version?
Yes, the error surfaced with GCC. I was using GCC 3.4.3 to build
binutils 2.14. Now I checked other GCC versions (2.95.x, 3.3.x,
4.0.0 and an oldish 4.1.0) and all do add an underscore to the
variable name. All GCC 3.4.x versions "forget" the underscore :-/
It seems this is a GCC 3.4.x only bug affecting a.out targets: with
i386-aout and m68k-aout the underscore is missing. The bug is still
present with prerelease-3.4.5-20051128. I guess I should file a bug
report. Can you give me a pointer where the bug might be?
> The compiler should not emit symbols which are in the register name
> space. The same applies to hand coded assembler. Assembler code
> should be unambiguous. I don't think it is appropriate to add code to
> the assembler to clarify ambiguity by guessing what the user means.
I agree that this isn't an assembler problem, its a GCC 3.4.x bug.
Thank you for making me realize this fact.
Gunther