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

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

[ARM] gas miscompiles ADR statement


From: Enrico Scholz
Subject: [ARM] gas miscompiles ADR statement
Date: 02 Dec 2002 17:51:27 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Informed Management)

Hello,

when using the most recent and for linux-kernel compilation
recommended snapshot of binutils from [1], I get miscompilations
of ADR statements. The following code is a minimal example:

| $ cat x.s 
| .space  0x0298
| adral   lr, X
| .space  0x0168
| adral   lr, X1
| 
| .globl X; 
| X:
| X1:
|
| $ /usr/arm-linux/bin/as-2.13.90.0.16 x.s && objdump -d a.out 
| 
| a.out:     file format elf32-littlearm
| 
| Disassembly of section .text:
| 
| 00000000 <X-0x408>:
|         ...
|  298:   e24fee2a        sub     lr, pc, #672    ; 0x2a0
|         ...
|  404:   e24fe004        sub     lr, pc, #4      ; 0x4


Obviously, the 'sub' at 0x298 is wrong. When using gas-2.13.90.0.4,
the first line is:

|  298:   e28fef5a        add     lr, pc, #360    ; 0x168

'gas' was build with './configure --host=i386-redhat-linux
--target=arm-linux --disable-shared'.


Probably, this bug is related to [2], but more serious since the
miscompilation happens silently.



Enrico

Footnotes: 
[1]  ftp://ftp.kernel.org/pub/linux/devel/binutils/
[2]  http://sources.redhat.com/ml/bug-binutils/2002-q4/msg00172.html




reply via email to

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