ARM Branch Offsets?
Nick Clifton
nickc@redhat.com
Tue Mar 13 14:12:00 GMT 2001
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
More information about the Binutils
mailing list