+2009-01-23 Alan Modra <amodra@bigpond.net.au>
+
+ * elf-bfd.h (struct elf_assign_sym_version_info): Delete.
+ (struct elf_info_failed, struct elf_find_verdep_info): Move to..
+ * elflink.c: ..here, somewhat modified.
+ * elf-bfd.h (_bfd_elf_add_default_symbol, _bfd_elf_export_symbol,
+ _bfd_elf_link_find_version_dependencies,
+ _bfd_elf_link_assign_sym_version, _bfd_elf_link_size_reloc_section,
+ _bfd_elf_fix_symbol_flags, _bfd_elf_adjust_dynamic_symbol,
+ _bfd_elf_link_sec_merge_syms, bfd_elf_link_mark_dynamic_symbol): Don't
+ declare..
+ * elflink.c: ..and make static here.
+ (_bfd_elf_link_find_version_dependencies): Adjust for removal
+ of output_bfd from struct elf_find_verdep_info.
+ (_bfd_elf_link_assign_sym_version): Similarly adjust to use
+ struct elf_info_failed.
+ (bfd_elf_size_dynamic_sections): Adjust.
+
2009-01-22 Alan Modra <amodra@bigpond.net.au>
PR 6832
#define get_elf_backend_data(abfd) \
xvec_get_elf_backend_data ((abfd)->xvec)
-/* This struct is used to pass information to routines called via
- elf_link_hash_traverse which must return failure. */
-
-struct elf_info_failed
-{
- bfd_boolean failed;
- struct bfd_link_info *info;
- struct bfd_elf_version_tree *verdefs;
-};
-
-/* This structure is used to pass information to
- _bfd_elf_link_assign_sym_version. */
-
-struct elf_assign_sym_version_info
-{
- /* Output BFD. */
- bfd *output_bfd;
- /* General link information. */
- struct bfd_link_info *info;
- /* Version tree. */
- struct bfd_elf_version_tree *verdefs;
- /* Whether we had a failure. */
- bfd_boolean failed;
-};
-
-/* This structure is used to pass information to
- _bfd_elf_link_find_version_dependencies. */
-
-struct elf_find_verdep_info
-{
- /* Output BFD. */
- bfd *output_bfd;
- /* General link information. */
- struct bfd_link_info *info;
- /* The number of dependencies. */
- unsigned int vers;
- /* Whether we had a failure. */
- bfd_boolean failed;
-};
-
/* The maximum number of known object attributes for any target. */
#define NUM_KNOWN_OBJ_ATTRIBUTES 71
extern bfd_boolean _bfd_elf_hash_symbol (struct elf_link_hash_entry *);
-extern bfd_boolean _bfd_elf_add_default_symbol
- (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
- const char *, Elf_Internal_Sym *, asection **, bfd_vma *,
- bfd_boolean *, bfd_boolean);
-
-extern bfd_boolean _bfd_elf_export_symbol
- (struct elf_link_hash_entry *, void *);
-
-extern bfd_boolean _bfd_elf_link_find_version_dependencies
- (struct elf_link_hash_entry *, void *);
-
-extern bfd_boolean _bfd_elf_link_assign_sym_version
- (struct elf_link_hash_entry *, void *);
-
extern long _bfd_elf_link_lookup_local_dynindx
(struct bfd_link_info *, bfd *, long);
extern bfd_boolean _bfd_elf_compute_section_file_positions
extern Elf_Internal_Rela *_bfd_elf_link_read_relocs
(bfd *, asection *, void *, Elf_Internal_Rela *, bfd_boolean);
-extern bfd_boolean _bfd_elf_link_size_reloc_section
- (bfd *, Elf_Internal_Shdr *, asection *);
-
extern bfd_boolean _bfd_elf_link_output_relocs
(bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *,
struct elf_link_hash_entry **);
-extern bfd_boolean _bfd_elf_fix_symbol_flags
- (struct elf_link_hash_entry *, struct elf_info_failed *);
-
-extern bfd_boolean _bfd_elf_adjust_dynamic_symbol
- (struct elf_link_hash_entry *, void *);
-
extern bfd_boolean _bfd_elf_adjust_dynamic_copy
(struct elf_link_hash_entry *, asection *);
-extern bfd_boolean _bfd_elf_link_sec_merge_syms
- (struct elf_link_hash_entry *, void *);
-
extern bfd_boolean _bfd_elf_dynamic_symbol_p
(struct elf_link_hash_entry *, struct bfd_link_info *, bfd_boolean);
extern int bfd_elf_link_record_local_dynamic_symbol
(struct bfd_link_info *, bfd *, long);
-extern void bfd_elf_link_mark_dynamic_symbol
- (struct bfd_link_info *, struct elf_link_hash_entry *,
- Elf_Internal_Sym *);
-
extern bfd_boolean _bfd_elf_close_and_cleanup
(bfd *);
#include "libiberty.h"
#include "objalloc.h"
+/* This struct is used to pass information to routines called via
+ elf_link_hash_traverse which must return failure. */
+
+struct elf_info_failed
+{
+ struct bfd_link_info *info;
+ struct bfd_elf_version_tree *verdefs;
+ bfd_boolean failed;
+};
+
+/* This structure is used to pass information to
+ _bfd_elf_link_find_version_dependencies. */
+
+struct elf_find_verdep_info
+{
+ /* General link information. */
+ struct bfd_link_info *info;
+ /* The number of dependencies. */
+ unsigned int vers;
+ /* Whether we had a failure. */
+ bfd_boolean failed;
+};
+
+static bfd_boolean _bfd_elf_fix_symbol_flags
+ (struct elf_link_hash_entry *, struct elf_info_failed *);
+
/* Define a symbol in a dynamic linkage section. */
struct elf_link_hash_entry *
\f
/* Mark a symbol dynamic. */
-void
+static void
bfd_elf_link_mark_dynamic_symbol (struct bfd_link_info *info,
struct elf_link_hash_entry *h,
Elf_Internal_Sym *sym)
symbol is described by H, NAME, SYM, PSEC, VALUE, and OVERRIDE. We
set DYNSYM if the new indirect symbol is dynamic. */
-bfd_boolean
+static bfd_boolean
_bfd_elf_add_default_symbol (bfd *abfd,
struct bfd_link_info *info,
struct elf_link_hash_entry *h,
/* This routine is used to export all defined symbols into the dynamic
symbol table. It is called via elf_link_hash_traverse. */
-bfd_boolean
+static bfd_boolean
_bfd_elf_export_symbol (struct elf_link_hash_entry *h, void *data)
{
struct elf_info_failed *eif = data;
dependencies. This will be put into the .gnu.version_r section.
This function is called via elf_link_hash_traverse. */
-bfd_boolean
+static bfd_boolean
_bfd_elf_link_find_version_dependencies (struct elf_link_hash_entry *h,
void *data)
{
return TRUE;
/* See if we already know about this version. */
- for (t = elf_tdata (rinfo->output_bfd)->verref; t != NULL; t = t->vn_nextref)
+ for (t = elf_tdata (rinfo->info->output_bfd)->verref;
+ t != NULL;
+ t = t->vn_nextref)
{
if (t->vn_bfd != h->verinfo.verdef->vd_bfd)
continue;
if (t == NULL)
{
amt = sizeof *t;
- t = bfd_zalloc (rinfo->output_bfd, amt);
+ t = bfd_zalloc (rinfo->info->output_bfd, amt);
if (t == NULL)
{
rinfo->failed = TRUE;
}
t->vn_bfd = h->verinfo.verdef->vd_bfd;
- t->vn_nextref = elf_tdata (rinfo->output_bfd)->verref;
- elf_tdata (rinfo->output_bfd)->verref = t;
+ t->vn_nextref = elf_tdata (rinfo->info->output_bfd)->verref;
+ elf_tdata (rinfo->info->output_bfd)->verref = t;
}
amt = sizeof *a;
- a = bfd_zalloc (rinfo->output_bfd, amt);
+ a = bfd_zalloc (rinfo->info->output_bfd, amt);
if (a == NULL)
{
rinfo->failed = TRUE;
files, so until that point we don't know which symbols should be
local. This function is called via elf_link_hash_traverse. */
-bfd_boolean
+static bfd_boolean
_bfd_elf_link_assign_sym_version (struct elf_link_hash_entry *h, void *data)
{
- struct elf_assign_sym_version_info *sinfo;
+ struct elf_info_failed *sinfo;
struct bfd_link_info *info;
const struct elf_backend_data *bed;
struct elf_info_failed eif;
if (!h->def_regular)
return TRUE;
- bed = get_elf_backend_data (sinfo->output_bfd);
+ bed = get_elf_backend_data (info->output_bfd);
p = strchr (h->root.root.string, ELF_VER_CHR);
if (p != NULL && h->verinfo.vertree == NULL)
{
return TRUE;
amt = sizeof *t;
- t = bfd_zalloc (sinfo->output_bfd, amt);
+ t = bfd_zalloc (info->output_bfd, amt);
if (t == NULL)
{
sinfo->failed = TRUE;
generating a shared archive. Return an error. */
(*_bfd_error_handler)
(_("%B: version node not found for symbol %s"),
- sinfo->output_bfd, h->root.root.string);
+ info->output_bfd, h->root.root.string);
bfd_set_error (bfd_error_bad_value);
sinfo->failed = TRUE;
return FALSE;
/* Compute the size of, and allocate space for, REL_HDR which is the
section header for a section containing relocations for O. */
-bfd_boolean
+static bfd_boolean
_bfd_elf_link_size_reloc_section (bfd *abfd,
Elf_Internal_Shdr *rel_hdr,
asection *o)
assign_sym_version, which is unnecessary but perhaps more robust in
the face of future changes. */
-bfd_boolean
+static bfd_boolean
_bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h,
struct elf_info_failed *eif)
{
called via elf_link_hash_traverse, and also calls itself
recursively. */
-bfd_boolean
+static bfd_boolean
_bfd_elf_adjust_dynamic_symbol (struct elf_link_hash_entry *h, void *data)
{
struct elf_info_failed *eif = data;
/* Adjust all external symbols pointing into SEC_MERGE sections
to reflect the object merging within the sections. */
-bfd_boolean
+static bfd_boolean
_bfd_elf_link_sec_merge_syms (struct elf_link_hash_entry *h, void *data)
{
asection *sec;
bfd_size_type soname_indx;
bfd *dynobj;
const struct elf_backend_data *bed;
- struct elf_assign_sym_version_info asvinfo;
+ struct elf_info_failed asvinfo;
*sinterpptr = NULL;
}
/* Attach all the symbols to their version information. */
- asvinfo.output_bfd = output_bfd;
asvinfo.info = info;
asvinfo.verdefs = verdefs;
asvinfo.failed = FALSE;
{
struct elf_find_verdep_info sinfo;
- sinfo.output_bfd = output_bfd;
sinfo.info = info;
sinfo.vers = elf_tdata (output_bfd)->cverdefs;
if (sinfo.vers == 0)