aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2001-10-23 03:55:24 +0000
committerAlan Modra <amodra@gmail.com>2001-10-23 03:55:24 +0000
commitce757d1518cabb829fb42080a08c17892aa34f76 (patch)
treedf2b3410a89da66a2b31b718eb6d39d24fe14df7 /bfd/elflink.h
parenta1675ea138b8dbd9420135fd04f147db8cccc9a1 (diff)
downloadfsf-binutils-gdb-ce757d1518cabb829fb42080a08c17892aa34f76.zip
fsf-binutils-gdb-ce757d1518cabb829fb42080a08c17892aa34f76.tar.gz
fsf-binutils-gdb-ce757d1518cabb829fb42080a08c17892aa34f76.tar.bz2
* elflink.h (elf_link_input_bfd): Zero the reloc instead of doing
bfd_reloc_type_lookup (bfd, BFD_RELOC_NONE) as bfd_reloc_type_lookup doesn't accept BFD_RELOC_* on some targets, eg. hppa. * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove plt_abs. (hppa_link_hash_newfunc): Likewise. (elf32_hppa_finish_dynamic_symbol): Likewise. (allocate_dynrelocs): Always allocate .got relocs if shared. (elf32_hppa_relocate_section): Output them too. Similarly consolidate .plt reloc code, and no longer initialise .plt when a reloc is output. (elf32_hppa_finish_dynamic_symbol): Only initialise .plt entries when no reloc is output. From Herbert Xu <herbert@gondor.apana.org.au> * elf32-hppa.c (final_link_relocate): Call bfd_set_error for unreachable branches.
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r--bfd/elflink.h23
1 files changed, 8 insertions, 15 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h
index 7cfa0fb..fd251b0 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -5897,8 +5897,6 @@ elf_link_input_bfd (finfo, input_bfd)
asection *o;
struct elf_backend_data *bed;
boolean emit_relocs;
- reloc_howto_type *none_howto;
- bfd_vma none_r_info;
output_bfd = finfo->output_bfd;
bed = get_elf_backend_data (output_bfd);
@@ -6070,9 +6068,6 @@ elf_link_input_bfd (finfo, input_bfd)
return false;
}
- none_howto = bfd_reloc_type_lookup (output_bfd, BFD_RELOC_NONE);
- none_r_info = ELF_R_INFO (0, none_howto->type);
-
/* Relocate the contents of each section. */
for (o = input_bfd->sections; o != NULL; o = o->next)
{
@@ -6125,13 +6120,12 @@ elf_link_input_bfd (finfo, input_bfd)
{
Elf_Internal_Rela *rel, *relend;
/* Run through the relocs looking for any against section
- symbols from removed link-once sections. Set any such
- relocs to be against 0. We should really complain if
- anything in the final link tries to use it, but
- DWARF-based exception handling might have an entry in
- .eh_frame to describe a routine in the linkonce section,
- and it turns out to be hard to remove the .eh_frame entry
- too. FIXME. */
+ symbols from removed link-once sections. Zero any such
+ relocs. We should really complain if anything in the
+ final link tries to use it, but DWARF-based exception
+ handling might have an entry in .eh_frame to describe a
+ routine in the linkonce section, and it turns out to be
+ hard to remove the .eh_frame entry too. FIXME. */
rel = internal_relocs;
relend = rel + o->reloc_count * bed->s->int_rels_per_ext_rel;
for ( ; rel < relend; rel++)
@@ -6151,21 +6145,20 @@ elf_link_input_bfd (finfo, input_bfd)
&& (sec->flags & SEC_LINK_ONCE) != 0
&& bfd_is_abs_section (sec->output_section))
{
- rel->r_info = none_r_info;
-
#if BFD_VERSION_DATE > 20021005
(*finfo->info->callbacks->warning)
(finfo->info,
_("warning: relocation against removed section; zeroing"),
NULL, input_bfd, o, rel->r_offset);
#endif
+ memset (rel, 0, sizeof (*rel));
}
}
}
}
}
#else
-#error "This kludge ought to be fixed properly in gcc by now"
+#error "gcc should be fixed by now, and this kludge no longer needed"
#endif
/* Relocate the section by invoking a back end routine.