aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2013-08-27 01:06:43 +0000
committerAlan Modra <amodra@gmail.com>2013-08-27 01:06:43 +0000
commite5034e59e04c90d3a0b6c78af0cbfd3f73eb7809 (patch)
treeb251a82e4ee092ebf1bf38a0cf2eb2a28ae98fe4 /bfd/elflink.c
parentce4ea2bb179312d14090f190dd0d974a65d64536 (diff)
downloadgdb-e5034e59e04c90d3a0b6c78af0cbfd3f73eb7809.zip
gdb-e5034e59e04c90d3a0b6c78af0cbfd3f73eb7809.tar.gz
gdb-e5034e59e04c90d3a0b6c78af0cbfd3f73eb7809.tar.bz2
* elf-bfd.h (struct elf_backend_data): Remove as_needed_cleanup.
Add notice_as_needed. * elf64-ppc.c (elf_backend_as_needed_cleanup): Don't define. (elf_backend_notice_as_needed): Define. (ppc64_elf_as_needed_cleanup): Rename and adjust.. (ppc64_elf_notice_as_needed): ..to this. * elflink.c (_bfd_elf_notice_as_needed): New function, extracted.. (elf_link_add_object_symbols): ..from here. * elfxx-target.h (elf_backend_as_needed_cleanup): Don't define. (elf_backend_notice_as_needed): Define.. (elfNN_bed): ..and use here.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index c22f7e8..99b7ca1 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -3309,6 +3309,18 @@ _bfd_elf_relocs_compatible (const bfd_target *input,
return ibed->relocs_compatible == obed->relocs_compatible;
}
+/* Make a special call to the linker "notice" function to tell it that
+ we are about to handle an as-needed lib, or have finished
+ processing the lib. */
+
+bfd_boolean
+_bfd_elf_notice_as_needed (bfd *ibfd,
+ struct bfd_link_info *info,
+ enum notice_asneeded_action act)
+{
+ return (*info->callbacks->notice) (info, NULL, ibfd, NULL, act, 0, NULL);
+}
+
/* Add symbols from an ELF object file to the linker hash table. */
static bfd_boolean
@@ -3766,8 +3778,7 @@ error_free_dyn:
/* Make a special call to the linker "notice" function to
tell it that we are about to handle an as-needed lib. */
- if (!(*info->callbacks->notice) (info, NULL, abfd, NULL,
- notice_as_needed, 0, NULL))
+ if (!(*bed->notice_as_needed) (abfd, info, notice_as_needed))
goto error_free_vers;
/* Clone the symbol table. Remember some pointers into the
@@ -4461,8 +4472,6 @@ error_free_dyn:
unsigned int i;
/* Restore the symbol table. */
- if (bed->as_needed_cleanup)
- (*bed->as_needed_cleanup) (abfd, info);
old_ent = (char *) old_tab + tabsize;
memset (elf_sym_hashes (abfd), 0,
extsymcount * sizeof (struct elf_link_hash_entry *));
@@ -4524,8 +4533,7 @@ error_free_dyn:
/* Make a special call to the linker "notice" function to
tell it that symbols added for crefs may need to be removed. */
- if (!(*info->callbacks->notice) (info, NULL, abfd, NULL,
- notice_not_needed, 0, NULL))
+ if (!(*bed->notice_as_needed) (abfd, info, notice_not_needed))
goto error_free_vers;
free (old_tab);
@@ -4538,8 +4546,7 @@ error_free_dyn:
if (old_tab != NULL)
{
- if (!(*info->callbacks->notice) (info, NULL, abfd, NULL,
- notice_needed, 0, NULL))
+ if (!(*bed->notice_as_needed) (abfd, info, notice_needed))
goto error_free_vers;
free (old_tab);
old_tab = NULL;