This is the mail archive of the binutils@sources.redhat.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]
Other format: [Raw text]

Gas can't handle prefix generated by gcc


On Fri, Jul 23, 2004 at 10:41:52AM -0700, Zack Weinberg wrote:

> (except for the assembler miscalculating the branch offset).  
> See for yourself:
> 
> $ cat test.s
>         .text
>         ds ; je .+2  # offset miscalculated
>         cs ; je .+2  # offset miscalculated
>         je,pt   .+3
>         je,pn   .+3
> $ as test.s
> $ objdump -d a.out
> 
> a.out:     file format elf64-x86-64
> 
> Disassembly of section .text:
> 
> 0000000000000000 <.text>:
>    0:   3e 74 00                je,pt  0x3
>    3:   2e 74 00                je,pn  0x6
>    6:   3e 74 00                je,pt  0x9
>    9:   2e 74 00                je,pn  0xc
> 
> I assume that the offset miscalculation is due to the problem HJ is
> trying to solve, i.e. the x86-64 assembler rejecting explicit ds/cs
> prefixes on branch instructions.
> 

I opened a bug:

http://sources.redhat.com/bugzilla/show_bug.cgi?id=286

It seems that gcc uses a prefix syntax which gas doesn't handle. Does
gcc always use " ; " as prefix separator? Right now, gas can only
handle PREFIX_SEPARATOR, which is defined as '\\' or '/'. There can be
no spaces after PREFIX_SEPARATOR. I can special case branch hints. But
I don't know if it is enough.


H.J.


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