This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC assembler bug
- From: "H. J. Lu" <hjl at lucon dot org>
- To: Piotr Wyderski <piotr dot wyderski at hoga dot pl>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 25 Apr 2003 16:55:17 -0700
- Subject: Re: GCC assembler bug
- References: <000901c30b82$f3edae40$8eec63d9@voltan>
On Sat, Apr 26, 2003 at 01:32:03AM +0200, Piotr Wyderski wrote:
> Hello,
>
> it seems there's a bug in the GCC assembler. The ".equ"
> directive can be used to define an address of a function:
>
> .equ FN,myfunction1
> call FN
>
> If there are multiple and different definitions of FN, like this:
>
> .equ FN,myfunction1
> call FN
>
> .equ FN,myfunction2
> call FN
>
> then only the first one is used and GCC generates
>
> call myfunction1
> call myfunction1
>
> instead of
>
> call myfunction1
> call myfunction2
>
> I use the version 3.2 and the host computer is i386 at Linux dot
>
I believe this behavior is documented in gas manual. However, Intel
ia64 assembler supports "=" and "==" which works similar to above.
You can think
foo=bar
foo==bar
as
#undef foo
#define foo bar
where bar can be anything. They won't affect symbol table. The only
difference between "=" and "==" is "==" can only be used once in a
translation unit. I was wondering how hard to add this feature to gas.
Any ideas?
H.J.