summaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2013-08-27 01:06:43 +0000
committerAlan Modra <amodra@bigpond.net.au>2013-08-27 01:06:43 +0000
commitfb009b0246de0c65c2aed80f012805f656f88f91 (patch)
treefa7bbc487ec69118c3cea15a66e8d16ec3882cab /bfd/elflink.c
parent3df0792ff3de8141d53ac0e4c36266094bc3483e (diff)
downloadbinutils-redhat-fb009b0246de0c65c2aed80f012805f656f88f91.tar.gz
* 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 c22f7e8ad6..99b7ca1c22 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;