summaryrefslogtreecommitdiff
path: root/bfd/elf32-ppc.c
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@nildram.co.uk>2006-03-02 08:56:59 +0000
committerRichard Sandiford <rsandifo@nildram.co.uk>2006-03-02 08:56:59 +0000
commit2f9a34b57d3323b04ee6b894e2fb69645ea34083 (patch)
tree0e4f97f9268758ead142f1de1db5f6b931b1b407 /bfd/elf32-ppc.c
parent446fb97b791fe6f3ca0a9d5ab8e7ad70adcdc877 (diff)
downloadgdb-2f9a34b57d3323b04ee6b894e2fb69645ea34083.tar.gz
bfd/
* elf32-i386.c (elf_i386_create_dynamic_sections): Use elf_vxworks_create_dynamic_sections. (elf_i386_size_dynamic_sections): Remove VxWorks GOT and PLT symbol handling. * elf32-ppc.c (ppc_elf_create_dynamic_sections): Use elf_vxworks_create_dynamic_sections. (ppc_elf_size_dynamic_sections): Remove VxWorks GOT and PLT symbol handling. * elf-vxworks.c (elf_vxworks_create_dynamic_sections): New function. * elf-vxworks.h (elf_vxworks_create_dynamic_sections): Declare. ld/testsuite/ * ld-i386/ld-i386/vxworks1-lib.nd: New test. * ld-i386/i386.exp: Run it. * ld-powerpc/ld-powerpc/vxworks1-lib.nd: New test. * ld-powerpc/powerc.exp: Run it.
Diffstat (limited to 'bfd/elf32-ppc.c')
-rw-r--r--bfd/elf32-ppc.c31
1 files changed, 3 insertions, 28 deletions
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 353f288b18a..68cead29e05 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -2548,19 +2548,9 @@ ppc_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
return FALSE;
}
- /* Create the section for VxWorks static plt relocations. */
- if (htab->is_vxworks && !info->shared)
- {
- s = bfd_make_section (abfd, ".rela.plt.unloaded");
- flags = (SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_READONLY
- | SEC_LINKER_CREATED);
- if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags)
- || ! bfd_set_section_alignment (abfd, s,
- get_elf_backend_data (abfd)->s->log_file_align))
- return FALSE;
- htab->srelplt2 = s;
- }
+ if (htab->is_vxworks
+ && !elf_vxworks_create_dynamic_sections (abfd, info, &htab->srelplt2))
+ return FALSE;
htab->relplt = bfd_get_section_by_name (abfd, ".rela.plt");
htab->plt = s = bfd_get_section_by_name (abfd, ".plt");
@@ -4764,21 +4754,6 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
else
htab->tlsld_got.offset = (bfd_vma) -1;
- if (htab->is_vxworks)
- {
- /* 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;
- 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. */
elf_link_hash_traverse (elf_hash_table (info), allocate_dynrelocs, info);