diff options
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 24 | ||||
-rw-r--r-- | bfd/elf-bfd.h | 2 | ||||
-rw-r--r-- | bfd/elf-hppa.h | 5 | ||||
-rw-r--r-- | bfd/elf32-frv.c | 4 | ||||
-rw-r--r-- | bfd/elf32-i370.c | 2 | ||||
-rw-r--r-- | bfd/elf32-m32r.c | 4 | ||||
-rw-r--r-- | bfd/elf32-m68hc1x.c | 2 | ||||
-rw-r--r-- | bfd/elf32-m68hc1x.h | 4 | ||||
-rw-r--r-- | bfd/elf32-ppc.c | 2 | ||||
-rw-r--r-- | bfd/elf32-sh64.c | 6 | ||||
-rw-r--r-- | bfd/elf32-v850.c | 4 | ||||
-rw-r--r-- | bfd/elf64-alpha.c | 4 | ||||
-rw-r--r-- | bfd/elf64-mmix.c | 4 | ||||
-rw-r--r-- | bfd/elf64-ppc.c | 17 | ||||
-rw-r--r-- | bfd/elf64-sh64.c | 4 | ||||
-rw-r--r-- | bfd/elf64-sparc.c | 4 | ||||
-rw-r--r-- | bfd/elflink.c | 2 | ||||
-rw-r--r-- | bfd/elfxx-ia64.c | 4 | ||||
-rw-r--r-- | bfd/elfxx-mips.c | 2 | ||||
-rw-r--r-- | bfd/elfxx-mips.h | 4 |
20 files changed, 73 insertions, 31 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 3ccef11600..0b8b69cb01 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,29 @@ 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. * elf-bfd.h (_bfd_elf_link_add_archive_symbols): Delete. (_bfd_elf_sort_symbol, _bfd_elf_add_dt_needed_tag): Delete. diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 6b7730ae4a..484a4923e1 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -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 diff --git a/bfd/elf-hppa.h b/bfd/elf-hppa.h index f5aba51e55..534dd11453 100644 --- a/bfd/elf-hppa.h +++ b/bfd/elf-hppa.h @@ -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, diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c index 46a5ea4f7c..039b4a3b47 100644 --- a/bfd/elf32-frv.c +++ b/bfd/elf32-frv.c @@ -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; diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c index dd84b2dc6f..f782925008 100644 --- a/bfd/elf32-i370.c +++ b/bfd/elf32-i370.c @@ -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 (*) \ diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c index 605abcf83a..812b3ca045 100644 --- a/bfd/elf32-m32r.c +++ b/bfd/elf32-m32r.c @@ -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; diff --git a/bfd/elf32-m68hc1x.c b/bfd/elf32-m68hc1x.c index 00b75df0a7..9de2f8b20e 100644 --- a/bfd/elf32-m68hc1x.c +++ b/bfd/elf32-m68hc1x.c @@ -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, diff --git a/bfd/elf32-m68hc1x.h b/bfd/elf32-m68hc1x.h index 59640232d8..f6b2001a33 100644 --- a/bfd/elf32-m68hc1x.h +++ b/bfd/elf32-m68hc1x.h @@ -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); diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 019545463d..515a9296b8 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -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, diff --git a/bfd/elf32-sh64.c b/bfd/elf32-sh64.c index eac444af46..f013e6fea8 100644 --- a/bfd/elf32-sh64.c +++ b/bfd/elf32-sh64.c @@ -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) { diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c index 747095213e..2aba9cd5a8 100644 --- a/bfd/elf32-v850.c +++ b/bfd/elf32-v850.c @@ -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; diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index c84dddf71c..1683683f77 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -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; diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c index 0e1da0650e..7f34a83b67 100644 --- a/bfd/elf64-mmix.c +++ b/bfd/elf64-mmix.c @@ -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; diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index cf15f92977..a2aebfea21 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -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) diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c index 652a4f8ac4..87b754e31b 100644 --- a/bfd/elf64-sh64.c +++ b/bfd/elf64-sh64.c @@ -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) { diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c index 219a434d80..6c9d302564 100644 --- a/bfd/elf64-sparc.c +++ b/bfd/elf64-sparc.c @@ -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; diff --git a/bfd/elflink.c b/bfd/elflink.c index 61495fcc6d..a11e7cdea8 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -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 *); diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index 27b5aa59f3..c1d6622006 100644 --- a/bfd/elfxx-ia64.c +++ b/bfd/elfxx-ia64.c @@ -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; diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index b82e109317..12eb566941 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -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) { diff --git a/bfd/elfxx-mips.h b/bfd/elfxx-mips.h index 9e5d7afe42..0a684d9086 100644 --- a/bfd/elfxx-mips.h +++ b/bfd/elfxx-mips.h @@ -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 *, |