aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2006-02-25 09:23:30 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2006-02-25 09:23:30 +0000
commit7325306f39112471924c0f2bf92734473686ae58 (patch)
treeb1ce1d410d25866124e30ae2b236921fde870a3c /bfd/elf32-ppc.c
parent * gdb/defs.h: unconditionally include <fcntl.h>, and (diff)
downloadbinutils-gdb-7325306f39112471924c0f2bf92734473686ae58.tar.gz
binutils-gdb-7325306f39112471924c0f2bf92734473686ae58.tar.bz2
binutils-gdb-7325306f39112471924c0f2bf92734473686ae58.zip
bfd/
* elf-bfd.h (elf_link_hash_table): Add hplt field. * elflink.c (_bfd_elf_create_dynamic_sections): Initialize it. * elf-m10300.c (_bfd_mn10300_elf_create_got_section): Likewise. * elf32-frv.c (_frv_create_got_section): Likewise. * elf32-m32r.c (m32r_elf_create_dynamic_sections): Likewise. * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise. * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Likewise. * elf64-sh64.c (sh64_elf64_create_dynamic_sections): Likewise. * elf32-i386.c (elf_i386_link_hash_table): Remove hgot and hplt. (elf_i386_link_hash_table_create): Don't initialize them. (elf_i386_size_dynamic_sections): Use the generic ELF hplt and hgot fields. (elf_i386_finish_dynamic_symbol): Likewise. * elf32-ppc.c (ppc_elf_link_hash_table): Remove hplt. (ppc_elf_size_dynamic_sections): Use the generic ELF hplt fields. (ppc_elf_finish_dynamic_symbol): Likewise.
Diffstat (limited to 'bfd/elf32-ppc.c')
-rw-r--r--bfd/elf32-ppc.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 134b960db96..ec407fdb402 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -2365,9 +2365,6 @@ struct ppc_elf_link_hash_table
/* The .got.plt section (VxWorks only)*/
asection *sgotplt;
- /* Short-cuts to frequently used symbols on VxWorks targets. */
- struct elf_link_hash_entry *hplt;
-
/* True if the target system is VxWorks. */
int is_vxworks;
@@ -4762,21 +4759,17 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
if (htab->is_vxworks)
{
- /* Save the PLT symbol in the hash table for easy access.
- Mark GOT and PLT syms as having relocations; they might not,
- but we won't know for sure until we build the GOT in
+ /* Mark the GOT and PLT symbols as having relocations; they might
+ not, but we won't know for sure until we build the GOT in
finish_dynamic_symbol. */
-
if (htab->elf.hgot)
htab->elf.hgot->indx = -2;
- htab->hplt = elf_link_hash_lookup (elf_hash_table (info),
- "_PROCEDURE_LINKAGE_TABLE_",
- FALSE, FALSE, FALSE);
- if (htab->hplt)
- htab->hplt->indx = -2;
- /* If the PLT is executable then give the symbol function type. */
- if (htab->hplt && htab->plt->flags & SEC_CODE)
- htab->hplt->type = STT_FUNC;
+ if (htab->elf.hplt)
+ {
+ htab->elf.hplt->indx = -2;
+ if (htab->plt->flags & SEC_CODE)
+ htab->elf.hplt->type = STT_FUNC;
+ }
}
/* Allocate space for global sym dynamic relocs. */
@@ -4867,7 +4860,7 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* We'd like to strip these sections if they aren't needed, but if
we've exported dynamic symbols from them we must leave them.
It's too late to tell BFD to get rid of the symbols. */
- if ((s == htab->plt || s == htab->got) && htab->hplt != NULL)
+ if ((s == htab->plt || s == htab->got) && htab->elf.hplt != NULL)
strip_section = FALSE;
/* Strip this section if we don't need it; see the
comment below. */
@@ -6880,7 +6873,7 @@ ppc_elf_finish_dynamic_symbol (bfd *output_bfd,
rela.r_offset = (htab->sgotplt->output_section->vma
+ htab->sgotplt->output_offset
+ got_offset);
- rela.r_info = ELF32_R_INFO (htab->hplt->indx,
+ rela.r_info = ELF32_R_INFO (htab->elf.hplt->indx,
R_PPC_ADDR32);
rela.r_addend = ent->plt.offset + 16;
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
@@ -7248,7 +7241,7 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd,
loc += sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloc_in (output_bfd, loc, &rel);
- rel.r_info = ELF32_R_INFO (htab->hplt->indx, R_PPC_ADDR32);
+ rel.r_info = ELF32_R_INFO (htab->elf.hplt->indx, R_PPC_ADDR32);
bfd_elf32_swap_reloc_out (output_bfd, &rel, loc);
loc += sizeof (Elf32_External_Rela);
}