summaryrefslogtreecommitdiff
path: root/bfd/elf64-sparc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2004-04-14 09:50:07 +0000
committerAlan Modra <amodra@bigpond.net.au>2004-04-14 09:50:07 +0000
commita3aae4e728f88ae7736585b7c9cd1f7d7bbe570f (patch)
tree708628fdfef195de7509da543aaf909e456ca8c0 /bfd/elf64-sparc.c
parent5447a6dd7eecf0c03ebdc0dd3066da6a1b907bed (diff)
downloadbinutils-redhat-a3aae4e728f88ae7736585b7c9cd1f7d7bbe570f.tar.gz
* elf32-sparc.c (elf32_sparc_relocate_section): Don't abort
when statically linking PIC code. * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
Diffstat (limited to 'bfd/elf64-sparc.c')
-rw-r--r--bfd/elf64-sparc.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c
index dd3e4962e2..0b65380aae 100644
--- a/bfd/elf64-sparc.c
+++ b/bfd/elf64-sparc.c
@@ -2027,7 +2027,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
else
got_base = elf_hash_table (info)->hgot->root.u.def.value;
- sgot = splt = sreloc = NULL;
+ sgot = sreloc = NULL;
+ splt = bfd_get_section_by_name (dynobj, ".plt");
rel = relocs;
relend = relocs + NUM_SHDR_ENTRIES (& elf_section_data (input_section)->rel_hdr);
@@ -2409,7 +2410,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
procedure linkage table. */
BFD_ASSERT (h != NULL);
- if (h->plt.offset == (bfd_vma) -1)
+ if (h->plt.offset == (bfd_vma) -1 || splt == NULL)
{
/* We didn't make a PLT entry for this symbol. This
happens when statically linking PIC code, or when
@@ -2417,12 +2418,6 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
goto do_default;
}
- if (splt == NULL)
- {
- splt = bfd_get_section_by_name (dynobj, ".plt");
- BFD_ASSERT (splt != NULL);
- }
-
relocation = (splt->output_section->vma
+ splt->output_offset
+ sparc64_elf_plt_entry_offset (h->plt.offset));