aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-sparc.c
diff options
context:
space:
mode:
authorGeoffrey Keating <geoffk@geoffk.org>2000-10-16 20:49:53 +0000
committerGeoffrey Keating <geoffk@geoffk.org>2000-10-16 20:49:53 +0000
commitea5fbc6753ca79362abe58778e172592a4e55479 (patch)
treeefc274e612b37999b12f94e5cbe100b28aa7f6d5 /bfd/elf64-sparc.c
parente1e0340bc8a0bc235b4d1916df6b3eac9ce399de (diff)
downloadgdb-ea5fbc6753ca79362abe58778e172592a4e55479.zip
gdb-ea5fbc6753ca79362abe58778e172592a4e55479.tar.gz
gdb-ea5fbc6753ca79362abe58778e172592a4e55479.tar.bz2
* elf64-sparc.c (sparc64_elf_relocate_section): Clear the location
of a GOT reloc.
Diffstat (limited to 'bfd/elf64-sparc.c')
-rw-r--r--bfd/elf64-sparc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c
index cef3788..2efe034 100644
--- a/bfd/elf64-sparc.c
+++ b/bfd/elf64-sparc.c
@@ -2358,7 +2358,6 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
off &= ~1;
else
{
- bfd_put_64 (output_bfd, relocation, sgot->contents + off);
local_got_offsets[r_symndx] |= 1;
if (info->shared)
@@ -2366,6 +2365,13 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
asection *srelgot;
Elf_Internal_Rela outrel;
+ /* The Solaris 2.7 64-bit linker adds the contents
+ of the location to the value of the reloc.
+ Note this is different behaviour to the
+ 32-bit linker, which both adds the contents
+ and ignores the addend. So clear the location. */
+ bfd_put_64 (output_bfd, 0, sgot->contents + off);
+
/* We need to generate a R_SPARC_RELATIVE reloc
for the dynamic linker. */
srelgot = bfd_get_section_by_name(dynobj, ".rela.got");
@@ -2382,6 +2388,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
+ srelgot->reloc_count));
++srelgot->reloc_count;
}
+ else
+ bfd_put_64 (output_bfd, relocation, sgot->contents + off);
}
relocation = sgot->output_offset + off - got_base;
}