From 31a91d61f9ea4504812349166ef6ad5308270927 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 31 Jul 2013 16:26:02 +0000 Subject: PR ld/15787 * elf32-arm.c (elf32_arm_final_link_relocate): Base SB on the output section VMA. * ld-arm/group-relocs-alu-bad-2.d; New. * ld-arm/group-relocs-alu-bad-2.s: New. * ld-arm/group-relocs-ldc-bad-2.d: New. * ld-arm/group-relocs-ldc-bad-2.s: New. * ld-arm/group-relocs-ldr-bad-2.d: New. * ld-arm/group-relocs-ldr-bad-2.s: New. * ld-arm/group-relocs-ldrs-bad-2.d: New. * ld-arm/group-relocs-ldrs-bad-2: New. * ld-arm/arm-elf.exp: Add the new tests. * ld-arm/group-relocs-ldr-bad.d: Update expected output. * ld-arm/group-relocs-ldr-bad.s: Likewise. * ld-arm/group-relocs-ldrs-bad.d: Likewise. * ld-arm/group-relocs-ldrs-bad.s: Likewise. * ld-arm/group-relocs.d: Likewise. * ld-arm/group-relocs.s: Likewise. --- bfd/ChangeLog | 6 ++++++ bfd/elf32-arm.c | 15 ++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'bfd') diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 62cb270..3df9e8e 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2013-07-31 John Tytgat + + PR ld/15787 + * elf32-arm.c (elf32_arm_final_link_relocate): Base SB on the + output section VMA. + 2013-07-28 Maciej W. Rozycki * elf64-hppa.c (elf64_hppa_finish_dynamic_sections) diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 8f88839..4616ae9 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -9852,10 +9852,8 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, bfd_vma insn = bfd_get_32 (input_bfd, hit_data); bfd_vma pc = input_section->output_section->vma + input_section->output_offset + rel->r_offset; - /* sb should be the origin of the *segment* containing the symbol. - It is not clear how to obtain this OS-dependent value, so we - make an arbitrary choice of zero. */ - bfd_vma sb = 0; + /* sb is the origin of the *segment* containing the symbol. */ + bfd_vma sb = sym_sec->output_section->vma; bfd_vma residual; bfd_vma g_n; bfd_signed_vma signed_value; @@ -9988,7 +9986,8 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, bfd_vma insn = bfd_get_32 (input_bfd, hit_data); bfd_vma pc = input_section->output_section->vma + input_section->output_offset + rel->r_offset; - bfd_vma sb = 0; /* See note above. */ + /* sb is the origin of the *segment* containing the symbol. */ + bfd_vma sb = sym_sec->output_section->vma; bfd_vma residual; bfd_signed_vma signed_value; int group = 0; @@ -10071,7 +10070,8 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, bfd_vma insn = bfd_get_32 (input_bfd, hit_data); bfd_vma pc = input_section->output_section->vma + input_section->output_offset + rel->r_offset; - bfd_vma sb = 0; /* See note above. */ + /* sb is the origin of the *segment* containing the symbol. */ + bfd_vma sb = sym_sec->output_section->vma; bfd_vma residual; bfd_signed_vma signed_value; int group = 0; @@ -10154,7 +10154,8 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, bfd_vma insn = bfd_get_32 (input_bfd, hit_data); bfd_vma pc = input_section->output_section->vma + input_section->output_offset + rel->r_offset; - bfd_vma sb = 0; /* See note above. */ + /* sb is the origin of the *segment* containing the symbol. */ + bfd_vma sb = sym_sec->output_section->vma; bfd_vma residual; bfd_signed_vma signed_value; int group = 0; -- cgit v1.1