aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2006-01-17 15:32:41 +0000
committerAlan Modra <amodra@gmail.com>2006-01-17 15:32:41 +0000
commit64d03ab565d55c20bfa7267bc669876a8fbea912 (patch)
tree2a26a808ffb7e341189945b53fb96078d95f8875 /bfd/elflink.c
parenta0841d7ad2cd86e901b6961f1616144aebe8c336 (diff)
downloadgdb-64d03ab565d55c20bfa7267bc669876a8fbea912.zip
gdb-64d03ab565d55c20bfa7267bc669876a8fbea912.tar.gz
gdb-64d03ab565d55c20bfa7267bc669876a8fbea912.tar.bz2
* elf-bfd.h (struct elf_backend_data): Add gc_mark_dynamic_ref.
(bfd_elf_gc_mark_dynamic_ref_symbol): Declare. * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Rename from elf_gc_mark_dynamic_ref_symbol. Make global. (bfd_elf_gc_sections): Call bed->gc_mark_dynamic_ref. * elfxx-target.h (elf_backend_gc_mark_dynamic_ref): Define. (elfNN_bed): Init new field. * elf64-ppc.c (elf_backend_gc_mark_dynamic_ref): Define. (ppc64_elf_gc_mark_dynamic_ref): New function.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index a065dca..0336a29 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -1,6 +1,6 @@
/* ELF linking support for BFD.
- Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
- Free Software Foundation, Inc.
+ Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+ 2005, 2006 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -9067,8 +9067,8 @@ elf_gc_smash_unused_vtentry_relocs (struct elf_link_hash_entry *h, void *okp)
building shared libraries, we must assume that any visible symbol is
referenced. */
-static bfd_boolean
-elf_gc_mark_dynamic_ref_symbol (struct elf_link_hash_entry *h, void *inf)
+bfd_boolean
+bfd_elf_gc_mark_dynamic_ref_symbol (struct elf_link_hash_entry *h, void *inf)
{
struct bfd_link_info *info = (struct bfd_link_info *) inf;
@@ -9097,8 +9097,9 @@ bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info)
asection * (*gc_mark_hook)
(asection *, struct bfd_link_info *, Elf_Internal_Rela *,
struct elf_link_hash_entry *h, Elf_Internal_Sym *);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
- if (!get_elf_backend_data (abfd)->can_gc_sections
+ if (!bed->can_gc_sections
|| info->relocatable
|| info->emitrelocations
|| !is_elf_hash_table (info->hash))
@@ -9124,11 +9125,11 @@ bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info)
/* Mark dynamically referenced symbols. */
if (elf_hash_table (info)->dynamic_sections_created)
elf_link_hash_traverse (elf_hash_table (info),
- elf_gc_mark_dynamic_ref_symbol,
+ bed->gc_mark_dynamic_ref,
info);
/* Grovel through relocs to find out who stays ... */
- gc_mark_hook = get_elf_backend_data (abfd)->gc_mark_hook;
+ gc_mark_hook = bed->gc_mark_hook;
for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
{
asection *o;