aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-hppa.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2001-01-14 05:58:15 +0000
committerAlan Modra <amodra@gmail.com>2001-01-14 05:58:15 +0000
commit150ccafb7a737cd7678df713dc39760b79f9fc4e (patch)
tree69cc81b5e7b08109242a06bf7384c268bf25ea3a /bfd/elf32-hppa.c
parentb352eebf39412ea12700904ec4667d907fe45ea5 (diff)
downloadgdb-150ccafb7a737cd7678df713dc39760b79f9fc4e.zip
gdb-150ccafb7a737cd7678df713dc39760b79f9fc4e.tar.gz
gdb-150ccafb7a737cd7678df713dc39760b79f9fc4e.tar.bz2
Correct DT_INIT/DT_FINI ABI violation
Diffstat (limited to 'bfd/elf32-hppa.c')
-rw-r--r--bfd/elf32-hppa.c76
1 files changed, 1 insertions, 75 deletions
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index 3d0c9ee..e67a1ed 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -1,5 +1,5 @@
/* BFD back-end for HP PA-RISC ELF files.
- Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
+ Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001
Free Software Foundation, Inc.
Original code by
@@ -2142,7 +2142,6 @@ elf32_hppa_size_dynamic_sections (output_bfd, info)
if (hplink->root.dynamic_sections_created)
{
- const char *funcname;
bfd *i;
/* Set the contents of the .interp section to the interpreter. */
@@ -2159,54 +2158,6 @@ elf32_hppa_size_dynamic_sections (output_bfd, info)
clobber_millicode_symbols,
info);
- /* DT_INIT and DT_FINI need a .plt entry. Make sure they have
- one. */
- funcname = info->init_function;
- while (1)
- {
- if (funcname != NULL)
- {
- struct elf_link_hash_entry *h;
-
- h = elf_link_hash_lookup (&hplink->root,
- funcname,
- false, false, false);
- if (h != NULL
- && (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR
- | ELF_LINK_HASH_DEF_REGULAR)))
- {
- if (h->plt.refcount <= 0)
- {
- h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
-
- /* Make an entry in the .plt section. We know
- the function doesn't have a plabel by the
- refcount. */
- s = hplink->splt;
- h->plt.offset = s->_raw_size;
- s->_raw_size += PLT_ENTRY_SIZE;
-
- /* Make sure this symbol is output as a dynamic
- symbol. */
- if (h->dynindx == -1)
- {
- if (! bfd_elf32_link_record_dynamic_symbol (info, h))
- return false;
- }
-
- /* Make an entry for the reloc too. */
- s = hplink->srelplt;
- s->_raw_size += sizeof (Elf32_External_Rela);
- }
-
- ((struct elf32_hppa_link_hash_entry *) h)->plt_abs = 1;
- }
- }
- if (funcname == info->fini_function)
- break;
- funcname = info->fini_function;
- }
-
/* Set up .plt offsets for local plabels. */
for (i = info->input_bfds; i; i = i->link_next)
{
@@ -4103,31 +4054,6 @@ elf32_hppa_finish_dynamic_sections (output_bfd, info)
dyn.d_un.d_val = s->_raw_size;
bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
-
- case DT_INIT:
- case DT_FINI:
- {
- struct elf_link_hash_entry *h;
- const char *funcname;
-
- if (dyn.d_tag == DT_INIT)
- funcname = info->init_function;
- else
- funcname = info->fini_function;
-
- h = elf_link_hash_lookup (&hplink->root, funcname,
- false, false, false);
-
- /* This is a function pointer. The magic +2 offset
- signals to $$dyncall that the function pointer
- is in the .plt and thus has a gp pointer too. */
- dyn.d_un.d_ptr = (h->plt.offset
- + hplink->splt->output_offset
- + hplink->splt->output_section->vma
- + 2);
- bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
- break;
- }
}
}
}