This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC assembler bug


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.


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