This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH] Silence gas warning about "*"


On Tue, 30 May 2000, OKUJI Yoshinori wrote:

> For binutils developers: Why does newer GAS warn formats like "lcall
> (%edi)"? AFAIK, binutils-2.9.1 only supports such formats and it fails
> when it encounters "lcall *(%edi)" or similar. I think it is
> consistent with the other formats to prepend an asterisk to an absolute
> call or jump operand which uses a register as well, but even GCC
> generates absolute call/jump operands without `*', so isn't it too
> strict to raise warnings?

Simple answer:
Gas warns because a `*' is required to meet AT&T assembler syntax rules.

More detailed answer:
Gas still continues to guess what the programmer meant when code deviates
from required syntax.  However, it's dangerous to do this without giving a
warning, as code not meeting simple syntax rules indicates that the
programmer is not familiar with the language.  For instance, did the
programmer mean "jmp *%ebx" or "jmp *(%ebx)" when he wrote "jmp (%ebx)"?
Either translation of this example could logically be argued as correct.

If ancient versions of gcc used incorrect syntax, that was simply a gcc
bug.  It's likely that these ancient versions of gcc couldn't be used with
assemblers other than gas.

As far as binutils-2.9.1 goes, I think it was only certain of H.J. Lu's
releases that gave an error on "call *(%ebx)"  I don't think anyone should
be at all worried about backwards compatibility with these assemblers.

Alan Modra
-- 
Linuxcare.  Support for the Revolution.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]