diff options
author | Nick Clifton <nickc@redhat.com> | 2013-07-31 16:26:02 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2013-07-31 16:26:02 +0000 |
commit | 31a91d61f9ea4504812349166ef6ad5308270927 (patch) | |
tree | aad0e1f44dea516ba6e3fdf1a6f99a02f217449a /bfd/elf32-arm.c | |
parent | 16f92dd4d4a4e637f7910c32cd6fd4b0ff78149a (diff) | |
download | gdb-31a91d61f9ea4504812349166ef6ad5308270927.zip gdb-31a91d61f9ea4504812349166ef6ad5308270927.tar.gz gdb-31a91d61f9ea4504812349166ef6ad5308270927.tar.bz2 |
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.
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r-- | bfd/elf32-arm.c | 15 |
1 files changed, 8 insertions, 7 deletions
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; |