Re: Jump addresses messed up with GNU as
- From: Sebastien <sebastien.bourdeauducq@xxxxxxxxx>
- Date: Wed, 27 Jul 2005 12:35:40 +0200
> Yes, it is. Do you use linker?
I didn't. But I have a similar problem when using GCC (I downgraded to GCC
3.4.3 and Binutils 2.14 to see if it was a GCC4 bug, but it is not), for
example with the following program :
int main(void)
{
int i;
for(i=0;i<10000;i++);
(...)
I compile it with :
$ arm-elf-gcc -O2 -Wall -g -mcpu=arm7tdmi main.c -c -o main.o
$ arm-elf-gcc -O2 -Wall -g -mcpu=arm7tdmi -s -o monitor.o main.o
$ arm-elf-objcopy -I elf32-little -O binary main.o monitor.arm
(I tried various flags, same problem)
Then I check the final output :
$ arm-elf-objcopy -I binary -O elf32-littlearm monitor.arm temp.o
$ arm-elf-objdump -marm7tdmi -D temp.o
00000000 <_binary_monitor_arm_start>:
0: e3a03c27 mov r3, #9984 ; 0x2700
4: e2833010 add r3, r3, #16 ; 0x10
8: e2533001 subs r3, r3, #1 ; 0x1
c: 1a000000 bne 14 <_binary_monitor_arm_start+0x14>
(...)
The jump address is incorrect : it should be _binary_monitor_arm_start+0x08
instead (and the code actually fails because of that when loaded in the
CPU).
But the intermediate object file looks correct :
$ arm-elf-objdump -d main.o
00000000 <main>:
0: e3a03c27 mov r3, #9984 ; 0x2700
4: e2833010 add r3, r3, #16 ; 0x10
8: e2533001 subs r3, r3, #1 ; 0x1
c: 1a000000 bne 8 <main+0x8>
Any clue ?
.
- Follow-Ups:
- Re: Jump addresses messed up with GNU as
- From: Vadim Borshchev
- Re: Jump addresses messed up with GNU as
- From: Sebastien
- Re: Jump addresses messed up with GNU as
- References:
- Jump addresses messed up with GNU as
- From: Sebastien
- Re: Jump addresses messed up with GNU as
- From: Tauno Voipio
- Re: Jump addresses messed up with GNU as
- From: Sebastien
- Re: Jump addresses messed up with GNU as
- From: Vadim Borshchev
- Jump addresses messed up with GNU as
- Prev by Date: Re: Jump addresses messed up with GNU as
- Next by Date: Re: Jump addresses messed up with GNU as
- Previous by thread: Re: Jump addresses messed up with GNU as
- Next by thread: Re: Jump addresses messed up with GNU as
- Index(es):
Relevant Pages
|