This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH] fix some ld testsuite regressions for arm-nacl targets
On Thu, Jun 28, 2012 at 7:49 AM, nick clifton <email@example.com> wrote:
> Approved, please apply.
> Note - testing with an arm-nacl toolchain I found that the "Simple non-PIC
> shared library (no PLT check)" failed because the library did not build:
> ?ld-new -o tmpdir/arm-lib.so -shared tmpdir/arm-lib.o
> ?ld-new: BFD (GNU Binutils) 184.108.40.20620628 assertion fail
> Would you care to take a look at this ?
This happens only with a 32-bit-only host (and no --enable-64-bit-bfd),
which is why I failed to notice it. I committed the fix below.
2012-06-28 Roland McGrath <firstname.lastname@example.org>
* elf32-arm.c (elf32_arm_populate_plt_entry): Use int32_t for
displacement calculation in nacl_p case.
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 826dd7e..4ac0a9d 100644
@@ -23,6 +23,7 @@
@@ -7629,7 +7630,7 @@ elf32_arm_populate_plt_entry (bfd *output_bfd, struct bfd\
/* Calculate the displacement between the PLT slot and the
common tail that's part of the special initial PLT slot. */
- bfd_vma tail_displacement
+ int32_t tail_displacement
= ((splt->output_section->vma + splt->output_offset
- (plt_address + htab->plt_entry_size + 4));
@@ -7642,7 +7643,8 @@ elf32_arm_populate_plt_entry (bfd *output_bfd, struct bfd\
/* Calculate the displacement between the PLT slot and the entry
in the GOT. The offset accounts for the value produced by
adding to pc in the penultimate instruction of the PLT stub. */
- got_displacement = got_address - (plt_address + htab->plt_entry_size)\
+ got_displacement = (got_address
+ - (plt_address + htab->plt_entry_size));
/* NaCl does not support interworking at all. */
BFD_ASSERT (!elf32_arm_plt_needs_thumb_stub_p (info, arm_plt));