* elf64-ppc.c (elf_backend_add_symbol_hook): Define.

(ppc64_elf_add_symbol_hook): New function.
	* elf-bfd.h (struct elf_backend_data <elf_add_symbol_hook>): Remove
	const from Elf_Internal_Sym param.
	* elflink.c (elf_link_add_object_symbols): Adjust.
	* elf-hppa.h (elf_hppa_add_symbol_hook): Adjust.
	* elf32-frv.c (elf32_frv_add_symbol_hook): Adjust.
	* elf32-i370.c (elf_backend_add_symbol_hook): Adjust.
	* elf32-m32r.c (m32r_elf_add_symbol_hook): Adjust.
	* elf32-m68hc1x.c (elf32_m68hc11_add_symbol_hook): Adjust.
	* elf32-m68hc1x.h (elf32_m68hc11_add_symbol_hook): Adjust.
	* elf32-ppc.c (ppc_elf_add_symbol_hook): Adjust.
	* elf32-sh64.c (sh64_elf_add_symbol_hook): Adjust.
	* elf32-v850.c (v850_elf_add_symbol_hook): Adjust.
	* elf64-alpha.c (elf64_alpha_add_symbol_hook): Adjust.
	* elf64-mmix.c (mmix_elf_add_symbol_hook): Adjust.
	* elf64-sh64.c (sh64_elf64_add_symbol_hook): Adjust.
	* elf64-sparc.c (sparc64_elf_add_symbol_hook): Adjust.
	* elfxx-ia64.c (elfNN_ia64_add_symbol_hook): Adjust.
	* elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Adjust.
	* elfxx-mips.h (_bfd_mips_elf_add_symbol_hook): Adjust.
This commit is contained in:
Alan Modra 2004-03-26 06:13:40 +00:00
parent 4ad4eba5b2
commit 555cd47695
20 changed files with 73 additions and 31 deletions

View File

@ -1,3 +1,27 @@
2004-03-26 Alan Modra <amodra@bigpond.net.au>
* elf64-ppc.c (elf_backend_add_symbol_hook): Define.
(ppc64_elf_add_symbol_hook): New function.
* elf-bfd.h (struct elf_backend_data <elf_add_symbol_hook>): Remove
const from Elf_Internal_Sym param.
* elflink.c (elf_link_add_object_symbols): Adjust.
* elf-hppa.h (elf_hppa_add_symbol_hook): Adjust.
* elf32-frv.c (elf32_frv_add_symbol_hook): Adjust.
* elf32-i370.c (elf_backend_add_symbol_hook): Adjust.
* elf32-m32r.c (m32r_elf_add_symbol_hook): Adjust.
* elf32-m68hc1x.c (elf32_m68hc11_add_symbol_hook): Adjust.
* elf32-m68hc1x.h (elf32_m68hc11_add_symbol_hook): Adjust.
* elf32-ppc.c (ppc_elf_add_symbol_hook): Adjust.
* elf32-sh64.c (sh64_elf_add_symbol_hook): Adjust.
* elf32-v850.c (v850_elf_add_symbol_hook): Adjust.
* elf64-alpha.c (elf64_alpha_add_symbol_hook): Adjust.
* elf64-mmix.c (mmix_elf_add_symbol_hook): Adjust.
* elf64-sh64.c (sh64_elf64_add_symbol_hook): Adjust.
* elf64-sparc.c (sparc64_elf_add_symbol_hook): Adjust.
* elfxx-ia64.c (elfNN_ia64_add_symbol_hook): Adjust.
* elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Adjust.
* elfxx-mips.h (_bfd_mips_elf_add_symbol_hook): Adjust.
2004-03-26 Alan Modra <amodra@bigpond.net.au>
* elfxx-target.h (bfd_elfNN_bfd_link_add_symbols): Define.

View File

@ -625,7 +625,7 @@ struct elf_backend_data
indices, and must set at least *FLAGS and *SEC for each processor
dependent case; failure to do so will cause a link error. */
bfd_boolean (*elf_add_symbol_hook)
(bfd *abfd, struct bfd_link_info *info, const Elf_Internal_Sym *,
(bfd *abfd, struct bfd_link_info *info, Elf_Internal_Sym *,
const char **name, flagword *flags, asection **sec, bfd_vma *value);
/* If this field is not NULL, it is called by the elf_link_output_sym

View File

@ -1,5 +1,6 @@
/* Common code for PA ELF implementations.
Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Copyright 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -1070,7 +1071,7 @@ static bfd_boolean elf_hppa_sort_unwind (bfd *abfd)
static bfd_boolean
elf_hppa_add_symbol_hook (bfd *abfd,
struct bfd_link_info *info ATTRIBUTE_UNUSED,
const Elf_Internal_Sym *sym,
Elf_Internal_Sym *sym,
const char **namep ATTRIBUTE_UNUSED,
flagword *flagsp ATTRIBUTE_UNUSED,
asection **secp,

View File

@ -52,7 +52,7 @@ static bfd_boolean elf32_frv_relocate_section
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
static bfd_boolean elf32_frv_add_symbol_hook
PARAMS (( bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
PARAMS (( bfd *, struct bfd_link_info *, Elf_Internal_Sym *,
const char **, flagword *, asection **, bfd_vma *));
static bfd_reloc_status_type frv_final_link_relocate
PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *,
@ -2584,7 +2584,7 @@ static bfd_boolean
elf32_frv_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
bfd *abfd;
struct bfd_link_info *info;
const Elf_Internal_Sym *sym;
Elf_Internal_Sym *sym;
const char **namep ATTRIBUTE_UNUSED;
flagword *flagsp ATTRIBUTE_UNUSED;
asection **secp;

View File

@ -1548,7 +1548,7 @@ static int i370_noop ()
#define elf_backend_add_symbol_hook \
(bfd_boolean (*) \
PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *, \
PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Sym *, \
const char **, flagword *, asection **, bfd_vma *))) i370_noop
#define elf_backend_finish_dynamic_symbol \
(bfd_boolean (*) \

View File

@ -51,7 +51,7 @@ bfd_boolean _bfd_m32r_elf_section_from_bfd_section
void _bfd_m32r_elf_symbol_processing
PARAMS ((bfd *, asymbol *));
static bfd_boolean m32r_elf_add_symbol_hook
PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Sym *,
const char **, flagword *, asection **, bfd_vma *));
static bfd_boolean m32r_elf_relocate_section
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
@ -1391,7 +1391,7 @@ static bfd_boolean
m32r_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
bfd *abfd;
struct bfd_link_info *info;
const Elf_Internal_Sym *sym;
Elf_Internal_Sym *sym;
const char **namep;
flagword *flagsp ATTRIBUTE_UNUSED;
asection **secp;

View File

@ -181,7 +181,7 @@ m68hc12_add_stub (const char *stub_name, asection *section,
bfd_boolean
elf32_m68hc11_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
const Elf_Internal_Sym *sym,
Elf_Internal_Sym *sym,
const char **namep ATTRIBUTE_UNUSED,
flagword *flagsp ATTRIBUTE_UNUSED,
asection **secp ATTRIBUTE_UNUSED,

View File

@ -1,5 +1,5 @@
/* Motorola 68HC11/68HC12-specific support for 32-bit ELF
Copyright 2003 Free Software Foundation, Inc.
Copyright 2003, 2004 Free Software Foundation, Inc.
Contributed by Stephane Carrez (stcarrez@nerim.fr)
This file is part of BFD, the Binary File Descriptor library.
@ -178,7 +178,7 @@ bfd_boolean elf32_m68hc11_relocate_section
bfd_boolean elf32_m68hc11_add_symbol_hook
(bfd *abfd, struct bfd_link_info *info,
const Elf_Internal_Sym *sym, const char **namep,
Elf_Internal_Sym *sym, const char **namep,
flagword *flagsp, asection **secp,
bfd_vma *valp);

View File

@ -4376,7 +4376,7 @@ ppc_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED,
static bfd_boolean
ppc_elf_add_symbol_hook (bfd *abfd,
struct bfd_link_info *info,
const Elf_Internal_Sym *sym,
Elf_Internal_Sym *sym,
const char **namep ATTRIBUTE_UNUSED,
flagword *flagsp ATTRIBUTE_UNUSED,
asection **secp,

View File

@ -1,5 +1,5 @@
/* SuperH SH64-specific support for 32-bit ELF
Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -56,7 +56,7 @@ static bfd_boolean shmedia_prepare_reloc
static int sh64_elf_get_symbol_type
(Elf_Internal_Sym *, int);
static bfd_boolean sh64_elf_add_symbol_hook
(bfd *, struct bfd_link_info *, const Elf_Internal_Sym *, const char **,
(bfd *, struct bfd_link_info *, Elf_Internal_Sym *, const char **,
flagword *, asection **, bfd_vma *);
static bfd_boolean sh64_elf_link_output_symbol_hook
(struct bfd_link_info *, const char *, Elf_Internal_Sym *, asection *,
@ -374,7 +374,7 @@ sh64_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type)
static bfd_boolean
sh64_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
const Elf_Internal_Sym *sym, const char **namep,
Elf_Internal_Sym *sym, const char **namep,
flagword *flagsp ATTRIBUTE_UNUSED,
asection **secp, bfd_vma *valp)
{

View File

@ -73,7 +73,7 @@ static bfd_boolean v850_elf_section_from_bfd_section
static void v850_elf_symbol_processing
PARAMS ((bfd *, asymbol *));
static bfd_boolean v850_elf_add_symbol_hook
PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Sym *,
const char **, flagword *, asection **, bfd_vma *));
static bfd_boolean v850_elf_link_output_symbol_hook
PARAMS ((struct bfd_link_info *, const char *, Elf_Internal_Sym *,
@ -2124,7 +2124,7 @@ static bfd_boolean
v850_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
bfd *abfd;
struct bfd_link_info *info ATTRIBUTE_UNUSED;
const Elf_Internal_Sym *sym;
Elf_Internal_Sym *sym;
const char **namep ATTRIBUTE_UNUSED;
flagword *flagsp ATTRIBUTE_UNUSED;
asection **secp;

View File

@ -123,7 +123,7 @@ static bfd_boolean elf64_alpha_size_rela_got_section
static bfd_boolean elf64_alpha_size_rela_got_1
PARAMS ((struct alpha_elf_link_hash_entry *, struct bfd_link_info *));
static bfd_boolean elf64_alpha_add_symbol_hook
PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Sym *,
const char **, flagword *, asection **, bfd_vma *));
static struct alpha_elf_got_entry *get_got_entry
PARAMS ((bfd *, struct alpha_elf_link_hash_entry *, unsigned long,
@ -2363,7 +2363,7 @@ static bfd_boolean
elf64_alpha_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
bfd *abfd;
struct bfd_link_info *info;
const Elf_Internal_Sym *sym;
Elf_Internal_Sym *sym;
const char **namep ATTRIBUTE_UNUSED;
flagword *flagsp ATTRIBUTE_UNUSED;
asection **secp;

View File

@ -205,7 +205,7 @@ static bfd_boolean mmix_elf_section_from_bfd_section
PARAMS ((bfd *, asection *, int *));
static bfd_boolean mmix_elf_add_symbol_hook
PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Sym *,
const char **, flagword *, asection **, bfd_vma *));
static bfd_boolean mmix_elf_is_local_label_name
@ -2175,7 +2175,7 @@ bfd_boolean
mmix_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
bfd *abfd;
struct bfd_link_info *info ATTRIBUTE_UNUSED;
const Elf_Internal_Sym *sym;
Elf_Internal_Sym *sym;
const char **namep ATTRIBUTE_UNUSED;
flagword *flagsp ATTRIBUTE_UNUSED;
asection **secp;

View File

@ -82,6 +82,7 @@ static bfd_reloc_status_type ppc64_elf_unhandled_reloc
#define elf_backend_grok_psinfo ppc64_elf_grok_psinfo
#define elf_backend_create_dynamic_sections ppc64_elf_create_dynamic_sections
#define elf_backend_copy_indirect_symbol ppc64_elf_copy_indirect_symbol
#define elf_backend_add_symbol_hook ppc64_elf_add_symbol_hook
#define elf_backend_check_relocs ppc64_elf_check_relocs
#define elf_backend_gc_mark_hook ppc64_elf_gc_mark_hook
#define elf_backend_gc_sweep_hook ppc64_elf_gc_sweep_hook
@ -3474,6 +3475,22 @@ ppc64_elf_mark_entry_syms (struct bfd_link_info *info)
return TRUE;
}
/* Hack symbols defined in .opd sections to be function type. */
static bfd_boolean
ppc64_elf_add_symbol_hook (bfd *ibfd ATTRIBUTE_UNUSED,
struct bfd_link_info *info ATTRIBUTE_UNUSED,
Elf_Internal_Sym *isym,
const char **name ATTRIBUTE_UNUSED,
flagword *flags ATTRIBUTE_UNUSED,
asection **sec,
bfd_vma *value ATTRIBUTE_UNUSED)
{
if (strcmp (bfd_get_section_name (ibfd, *sec), ".opd") == 0)
isym->st_info = ELF_ST_INFO (ELF_ST_BIND (isym->st_info), STT_FUNC);
return TRUE;
}
static bfd_boolean
update_local_sym_info (bfd *abfd, Elf_Internal_Shdr *symtab_hdr,
unsigned long r_symndx, bfd_vma r_addend, int tls_type)

View File

@ -141,7 +141,7 @@ static bfd_boolean sh_elf64_check_relocs
static int sh64_elf64_get_symbol_type
(Elf_Internal_Sym *, int);
static bfd_boolean sh64_elf64_add_symbol_hook
(bfd *, struct bfd_link_info *, const Elf_Internal_Sym *, const char **,
(bfd *, struct bfd_link_info *, Elf_Internal_Sym *, const char **,
flagword *, asection **, bfd_vma *);
static bfd_boolean sh64_elf64_link_output_symbol_hook
(struct bfd_link_info *, const char *, Elf_Internal_Sym *, asection *,
@ -2887,7 +2887,7 @@ sh64_elf64_get_symbol_type (Elf_Internal_Sym * elf_sym, int type)
static bfd_boolean
sh64_elf64_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
const Elf_Internal_Sym *sym, const char **namep,
Elf_Internal_Sym *sym, const char **namep,
flagword *flagsp ATTRIBUTE_UNUSED,
asection **secp, bfd_vma *valp)
{

View File

@ -61,7 +61,7 @@ static bfd_boolean sparc64_elf_size_dynamic_sections
static int sparc64_elf_get_symbol_type
PARAMS (( Elf_Internal_Sym *, int));
static bfd_boolean sparc64_elf_add_symbol_hook
PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Sym *,
const char **, flagword *, asection **, bfd_vma *));
static bfd_boolean sparc64_elf_output_arch_syms
PARAMS ((bfd *, struct bfd_link_info *, PTR,
@ -1385,7 +1385,7 @@ static bfd_boolean
sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
bfd *abfd;
struct bfd_link_info *info;
const Elf_Internal_Sym *sym;
Elf_Internal_Sym *sym;
const char **namep;
flagword *flagsp ATTRIBUTE_UNUSED;
asection **secp ATTRIBUTE_UNUSED;

View File

@ -2848,7 +2848,7 @@ static bfd_boolean
elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
{
bfd_boolean (*add_symbol_hook)
(bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
(bfd *, struct bfd_link_info *, Elf_Internal_Sym *,
const char **, flagword *, asection **, bfd_vma *);
bfd_boolean (*check_relocs)
(bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *);

View File

@ -192,7 +192,7 @@ static bfd_boolean elfNN_ia64_fake_sections
static void elfNN_ia64_final_write_processing
PARAMS ((bfd *abfd, bfd_boolean linker));
static bfd_boolean elfNN_ia64_add_symbol_hook
PARAMS ((bfd *abfd, struct bfd_link_info *info, const Elf_Internal_Sym *sym,
PARAMS ((bfd *abfd, struct bfd_link_info *info, Elf_Internal_Sym *sym,
const char **namep, flagword *flagsp, asection **secp,
bfd_vma *valp));
static int elfNN_ia64_additional_program_headers
@ -1430,7 +1430,7 @@ static bfd_boolean
elfNN_ia64_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
bfd *abfd;
struct bfd_link_info *info;
const Elf_Internal_Sym *sym;
Elf_Internal_Sym *sym;
const char **namep ATTRIBUTE_UNUSED;
flagword *flagsp ATTRIBUTE_UNUSED;
asection **secp;

View File

@ -4715,7 +4715,7 @@ _bfd_mips_elf_section_from_bfd_section (bfd *abfd ATTRIBUTE_UNUSED,
bfd_boolean
_bfd_mips_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
const Elf_Internal_Sym *sym, const char **namep,
Elf_Internal_Sym *sym, const char **namep,
flagword *flagsp ATTRIBUTE_UNUSED,
asection **secp, bfd_vma *valp)
{

View File

@ -1,5 +1,5 @@
/* MIPS ELF specific backend routines.
Copyright 2002, 2003 Free Software Foundation, Inc.
Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -35,7 +35,7 @@ extern bfd_boolean _bfd_mips_elf_fake_sections
extern bfd_boolean _bfd_mips_elf_section_from_bfd_section
(bfd *, asection *, int *);
extern bfd_boolean _bfd_mips_elf_add_symbol_hook
(bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
(bfd *, struct bfd_link_info *, Elf_Internal_Sym *,
const char **, flagword *, asection **, bfd_vma *);
extern bfd_boolean _bfd_mips_elf_link_output_symbol_hook
(struct bfd_link_info *, const char *, Elf_Internal_Sym *,