This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: ARM Branch Offsets?
- To: Todd Lipcon <tlipcon at mercea dot net>
- Subject: Re: ARM Branch Offsets?
- From: Nick Clifton <nickc at redhat dot com>
- Date: 13 Mar 2001 14:11:03 -0800
- Cc: binutils at sourceware dot cygnus dot com
- References: <Pine.LNX.4.10.10103131529330.8997-100000@mercea.net>
Hi Todd,
> 2c: ea000004 b 44 <start+0x2c>
>
> Why is this second branch offset continually wrong?
This is because the branch instruction has not yet been completely
defined. If you add the -r switch to objdump's command line, (as
suggested by Andrew Haley) you will see that there is a reloc
associated with this line. If you were to fully link this object
file, you would see that the relocation is resolved and the correct
address is now in the instruction.
However, as an alternative, you may like to download the latest
binutils snapshot. I applied a patch to objdump recently that makes
the disassembler take note of relocs in ARM object files and adjust the
displayed offsets accordingly. So for example when I run 'objdump
-dr' on your file I get:
28: e1a00000 nop (mov r0,r0)
2c: ea000004 b 18 <start>
2c: R_ARM_PC24 .text
You can obtain the snapshots from:
ftp://sources.redhat.com/pub/binutils/snapshots
Cheers
Nick