bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Possible AS bug


From: sreenivas penumarthy
Subject: Possible AS bug
Date: Wed, 16 Jul 2003 12:46:25 -0700 (PDT)

Hi!
  I have possibly detected some bugs with AS and
objump. The problem is that when using Intel syntax,
for ARPL instruction the compiler doesnot report 
error when using Scaled Base Index mode when base
register is specified as a 16 bit register (NOT 32
bit). Instead it generates random code and this can
cause problems during the execution. So ARPL [%ax],%bx
compiles and produces: 63 fe. I think it is going to
do the same mistakes for all SIB modes. Please check
it.GCC Version: 2.96 Platform: i386-redhat-linux Linux
kernel version: 2.4.18-10 intel 686 processor.
 Also when using "objdump" for run time routines
appended by linker (crtn.o, crtend.o) I have come
across output:
080484d0 <__do_global_ctors_aux>:
 80484d0:    55                 push   %ebp
 80484d1:    89 e5              mov    %esp,%ebp
 80484d3:    53                 push   %ebx
 80484d4:    83 ec 04           sub    $0x4,%esp
 80484d7:    a1 a4 97 04 08     mov    0x80497a4,%eax
 80484dc:    bb a4 97 04 08     mov    $0x80497a4,%ebx
 80484e1:    83 f8 ff           cmp   
$0xffffffff,%eax
 80484e4:       74 16           je     80484fc
<__do_global_ctors_aux+0x2c>
 80484e6:       8d 76 00        lea    0x0(%esi),%esi
****************************************************
 80484e9:       8d bc 27 00 00 00 00   lea   
0x0(%edi,1),%edi
*****************************************************
 80484f0:       83 eb 04                sub   
$0x4,%ebx
Now if we observe the binary code for lea
0x0(%edi,1),%edi it is obviously not correct. The
binary code is shown as if it is SIB mode with value
of SIB byte being 27, which is not possible as then
value of index then would be 4 (100), which is
illegal. I guess the correct encoding for the
instruction would be 8d 7f 00 (I confirmed this with a
sample assembly program). So whats the actual problem?
Thanks,
Sunil.



__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]