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: An x86 gas bug



On Sat, 17 Jul 1999, H.J. Lu wrote:

> --c.s--
> 	call 0x12345678
> 
> There is am x86 gas bug. On Solaris 7/x86, I got
> 
> # gcc -c c.s
> Assembler: 
> 	aline 1	: Illegal PC-relative relocation
> 
> I think it is correct. But gas takes it. Please check out the
> "constant calls and optimization" thread on the egcs bug list.
> I send a patch to egcs to fix the egcs bug:
> 
> http://egcs.cygnus.com/ml/gcc-patches/1999-07/msg00468.html
> 
> But we need to fix gas.

I'm not so sure anything needs fixing, except for egcs.  As you note
above, egcs code would not have assembled with the solaris assembler.

You could say that accepting a constant as a jmp, loop or call operand is
a gas extension.  (The constant value is written directly into the
instruction)  Some people may depend on this extension, writing code like

 loope -2

(which does exactly the same as "loope .")

Besides all this, it's not easy to fix correctly.  If you do try, make
sure you check assembly in an absolute section!

> BTW,
> 
> 	call .+0x12345678
> 
> should be the right syntax. Both gas and Solaris as do it right.


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