mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 12:23:31 +08:00
* elf-bfd.h (struct elf_backend_data): Add as_needed_cleanup hook.
* elfxx-target.h (elf_backend_as_needed_cleanup): Define. (elfNN_bed): Add as_needed_cleanup hook. * elflink.c (elf_link_add_object_symbols): Call it when reverting hash table changes for unneeded --as-needed input. * elf64-ppc64.c (elf_backend_as_needed_cleanup): Define. (ppc64_elf_as_needed_cleanup): New function.
This commit is contained in:
@ -1,3 +1,13 @@
|
|||||||
|
2006-12-23 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
* elf-bfd.h (struct elf_backend_data): Add as_needed_cleanup hook.
|
||||||
|
* elfxx-target.h (elf_backend_as_needed_cleanup): Define.
|
||||||
|
(elfNN_bed): Add as_needed_cleanup hook.
|
||||||
|
* elflink.c (elf_link_add_object_symbols): Call it when reverting
|
||||||
|
hash table changes for unneeded --as-needed input.
|
||||||
|
* elf64-ppc64.c (elf_backend_as_needed_cleanup): Define.
|
||||||
|
(ppc64_elf_as_needed_cleanup): New function.
|
||||||
|
|
||||||
2006-12-19 Kazu Hirata <kazu@codesourcery.com>
|
2006-12-19 Kazu Hirata <kazu@codesourcery.com>
|
||||||
|
|
||||||
* elf32-m68k.c (elf32_m68k_object_p,
|
* elf32-m68k.c (elf32_m68k_object_p,
|
||||||
|
@ -711,6 +711,13 @@ struct elf_backend_data
|
|||||||
bfd_boolean (*check_directives)
|
bfd_boolean (*check_directives)
|
||||||
(bfd *abfd, struct bfd_link_info *info);
|
(bfd *abfd, struct bfd_link_info *info);
|
||||||
|
|
||||||
|
/* The AS_NEEDED_CLEANUP function is called once per --as-needed
|
||||||
|
input file that was not needed by the add_symbols phase of the
|
||||||
|
ELF backend linker. The function must undo any target specific
|
||||||
|
changes in the symbol hash table. */
|
||||||
|
bfd_boolean (*as_needed_cleanup)
|
||||||
|
(bfd *abfd, struct bfd_link_info *info);
|
||||||
|
|
||||||
/* The ADJUST_DYNAMIC_SYMBOL function is called by the ELF backend
|
/* The ADJUST_DYNAMIC_SYMBOL function is called by the ELF backend
|
||||||
linker for every symbol which is defined by a dynamic object and
|
linker for every symbol which is defined by a dynamic object and
|
||||||
referenced by a regular object. This is called after all the
|
referenced by a regular object. This is called after all the
|
||||||
|
@ -88,6 +88,7 @@ static bfd_vma opd_entry_value
|
|||||||
#define elf_backend_copy_indirect_symbol ppc64_elf_copy_indirect_symbol
|
#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_add_symbol_hook ppc64_elf_add_symbol_hook
|
||||||
#define elf_backend_check_directives ppc64_elf_check_directives
|
#define elf_backend_check_directives ppc64_elf_check_directives
|
||||||
|
#define elf_backend_as_needed_cleanup ppc64_elf_as_needed_cleanup
|
||||||
#define elf_backend_archive_symbol_lookup ppc64_elf_archive_symbol_lookup
|
#define elf_backend_archive_symbol_lookup ppc64_elf_archive_symbol_lookup
|
||||||
#define elf_backend_check_relocs ppc64_elf_check_relocs
|
#define elf_backend_check_relocs ppc64_elf_check_relocs
|
||||||
#define elf_backend_gc_mark_dynamic_ref ppc64_elf_gc_mark_dynamic_ref
|
#define elf_backend_gc_mark_dynamic_ref ppc64_elf_gc_mark_dynamic_ref
|
||||||
@ -4247,6 +4248,17 @@ ppc64_elf_check_directives (bfd *ibfd, struct bfd_link_info *info)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Undo hash table changes when an --as-needed input file is determined
|
||||||
|
not to be needed. */
|
||||||
|
|
||||||
|
static bfd_boolean
|
||||||
|
ppc64_elf_as_needed_cleanup (bfd *ibfd ATTRIBUTE_UNUSED,
|
||||||
|
struct bfd_link_info *info)
|
||||||
|
{
|
||||||
|
ppc_hash_table (info)->dot_syms = NULL;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static bfd_boolean
|
static bfd_boolean
|
||||||
update_local_sym_info (bfd *abfd, Elf_Internal_Shdr *symtab_hdr,
|
update_local_sym_info (bfd *abfd, Elf_Internal_Shdr *symtab_hdr,
|
||||||
unsigned long r_symndx, bfd_vma r_addend, int tls_type)
|
unsigned long r_symndx, bfd_vma r_addend, int tls_type)
|
||||||
|
@ -4251,6 +4251,8 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
|
|||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
/* Restore the symbol table. */
|
/* Restore the symbol table. */
|
||||||
|
if (bed->as_needed_cleanup)
|
||||||
|
(*bed->as_needed_cleanup) (abfd, info);
|
||||||
old_hash = (char *) old_tab + tabsize;
|
old_hash = (char *) old_tab + tabsize;
|
||||||
old_ent = (char *) old_hash + hashsize;
|
old_ent = (char *) old_hash + hashsize;
|
||||||
sym_hash = elf_sym_hashes (abfd);
|
sym_hash = elf_sym_hashes (abfd);
|
||||||
|
@ -372,6 +372,9 @@
|
|||||||
#ifndef elf_backend_check_directives
|
#ifndef elf_backend_check_directives
|
||||||
#define elf_backend_check_directives 0
|
#define elf_backend_check_directives 0
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef elf_backend_as_needed_cleanup
|
||||||
|
#define elf_backend_as_needed_cleanup 0
|
||||||
|
#endif
|
||||||
#ifndef elf_backend_adjust_dynamic_symbol
|
#ifndef elf_backend_adjust_dynamic_symbol
|
||||||
#define elf_backend_adjust_dynamic_symbol 0
|
#define elf_backend_adjust_dynamic_symbol 0
|
||||||
#endif
|
#endif
|
||||||
@ -604,6 +607,7 @@ static struct elf_backend_data elfNN_bed =
|
|||||||
elf_backend_omit_section_dynsym,
|
elf_backend_omit_section_dynsym,
|
||||||
elf_backend_check_relocs,
|
elf_backend_check_relocs,
|
||||||
elf_backend_check_directives,
|
elf_backend_check_directives,
|
||||||
|
elf_backend_as_needed_cleanup,
|
||||||
elf_backend_adjust_dynamic_symbol,
|
elf_backend_adjust_dynamic_symbol,
|
||||||
elf_backend_always_size_sections,
|
elf_backend_always_size_sections,
|
||||||
elf_backend_size_dynamic_sections,
|
elf_backend_size_dynamic_sections,
|
||||||
|
Reference in New Issue
Block a user