This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: ARM long branch stubs: pic take 2
On Thu, 2009-02-26 at 12:55 +0100, Christophe LYON wrote:
> > I think that this shows that the offset calculation is wrong: The
> > offset needs to be based on the location of the instruction that uses
> > the PC -- in this case address 0x1010, with PC=0x1018 (since it's an ARM
> > instruction), so 0x1018 + 0x02000000 = 0x02001018, which is the
> > instruction after your bx lr instruction.
> >
>
> Good catch!
> Here an updated patch, with updated offsets for
> elf32_arm_stub_long_branch_v4t_thumb_arm_pic and
> elf32_arm_stub_long_branch_thumb_only_pic (and updated expected results
> farcall-thumb-arm-pic-veneer.d farcall-thumb-thumb-m-pic-veneer.d
> farcall-thumb-thumb-pic-veneer.d)
>
> Christophe.
> plain text document attachment (pic2.changelog)
> 2009-02-25 Christophe Lyon <christophe.lyon@st.com>
>
> bfd/
> * elf32-arm.c (stub_reloc_type): Removed.
> (insn_sequence): Renamed reloc_type field to r_type.
> (elf32_arm_stub_long_branch_v4t_arm_thumb_pic): New stub.
> (elf32_arm_stub_long_branch_v4t_thumb_arm_pic): Likewise.
> (elf32_arm_stub_long_branch_thumb_only_pic): Likewise.
> (elf32_arm_stub_type): Add new enum entries for the new stubs.
> (arm_stub_is_thumb): Catch new stubs.
> (arm_type_of_stub): Handle new stubs.
> (arm_size_one_stub): Use ARRAY_SIZE. Handle new stubs.
> (bfd_elf32_arm_process_before_allocation): Remove useless
> condition.
>
> testsuite/
> * ld-arm/arm-elf.exp: Add 3 tests for the 3 new stubs.
> * ld-arm/farcall-thumb-arm-pic-veneer.d: New expected result, the
> test is now expected to pass.
> * ld-arm/farcall-thumb-thumb-m-pic-veneer.d: Likewise.
> * ld-arm/farcall-thumb-thumb-pic-veneer.d: Likewise.
Yes, I think this is OK now. Daniel, you've reviewed most of this
series, do you have any final comments?
R.