This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Patch for R_ARM_THM_PC22 relocs
Alan Modra wrote:
>
> On Fri, 29 Sep 2000, Momchil Velikov wrote:
>
> > + upper_insn = bfd_get_16 (abfd, address);
> > + lower_insn = bfd_get_16 (abfd, address + 2);
>
> Sorry, I should have picked this up on your previous patch, but this is
> wrong too. You're assuming big-endian, which isn't always the case for
> arm-elf. Please use bfd_get_32 and bfd_put_32.
I don't think so. Here is what the ARM manual has to say:
...
In the first instruction the Offset field contains the upper 11 bits
of the target address.
...
In the second instruction the Offset field contains an 11-bit
representation lower half of
the target address.
...
So, when using bfd_get_32, depending on the host and target endianess,
you can end up with the upper bits of the addendum either in
the upper or the lower bits of the `addend'.
Regards,
-velco