aboutsummaryrefslogtreecommitdiff
path: root/bfd/ecoff.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2010-12-13 01:06:16 +0000
committerAlan Modra <amodra@gmail.com>2010-12-13 01:06:16 +0000
commit0e144ba71eacb7e00bff43fc66b707bd7f029c44 (patch)
tree4621646a912052f57c9a89b413e6d3c0f37c857d /bfd/ecoff.c
parent8d4f41361d6fff0e879d97f2583dbcbec8bf50c0 (diff)
downloadgdb-0e144ba71eacb7e00bff43fc66b707bd7f029c44.zip
gdb-0e144ba71eacb7e00bff43fc66b707bd7f029c44.tar.gz
gdb-0e144ba71eacb7e00bff43fc66b707bd7f029c44.tar.bz2
* aoutx.h (aout_link_check_ar_symbols): Formatting.
* cofflink.c (coff_link_check_ar_symbols): Likewise. * elflink.c (elf_link_add_archive_symbols): Likewise. * pdp11.c (aout_link_check_ar_symbols): Likewise. * xcofflink.c (xcoff_link_check_dynamic_ar_symbols, xcoff_link_check_dynamic_ar_symbols): Likewise. * aoutx.h (aout_link_check_archive_element): Simplify code dealing with add_archive_element substitute BFD. * cofflink.c (coff_link_check_archive_element): Likewise. * ecoff.c (ecoff_link_check_archive_element): Likewise. (ecoff_link_add_archive_symbols): Likewise. * linker.c (generic_link_check_archive_element): Likewise. * pdp11.c (aout_link_check_archive_element): Likewise. * vms-alpha.c (alpha_vms_link_add_archive_symbols): Likewise. * xcofflink.c (xcoff_link_check_archive_element): Likewise. * aoutx.h (aout_link_check_archive_element): Free symbols from old bfd if !keep_memory. * cofflink.c (coff_link_check_archive_element): Likewise. * pdp11.c (aout_link_check_archive_element): Likewise. * xcofflink.c (xcoff_link_check_archive_element): Likewise.
Diffstat (limited to 'bfd/ecoff.c')
-rw-r--r--bfd/ecoff.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/bfd/ecoff.c b/bfd/ecoff.c
index 4349486..f85627d 100644
--- a/bfd/ecoff.c
+++ b/bfd/ecoff.c
@@ -3600,7 +3600,7 @@ ecoff_link_check_archive_element (bfd *abfd,
EXTR esym;
bfd_boolean def;
const char *name;
- bfd *subsbfd;
+ bfd *oldbfd;
struct bfd_link_hash_entry *h;
(*swap_ext_in) (abfd, (void *) ext_ptr, &esym);
@@ -3645,18 +3645,17 @@ ecoff_link_check_archive_element (bfd *abfd,
continue;
/* Include this element. */
- subsbfd = NULL;
- if (! (*info->callbacks->add_archive_element)
- (info, abfd, name, &subsbfd))
+ oldbfd = abfd;
+ if (!(*info->callbacks
+ ->add_archive_element) (info, abfd, name, &abfd))
goto error_return;
/* Potentially, the add_archive_element hook may have set a
substitute BFD for us. */
- if (subsbfd
+ if (abfd != oldbfd
&& !reread_ext_syms_and_strs (&symhdr, &external_ext_size, &esize,
- &external_ext, &ssext, subsbfd, backend))
+ &external_ext, &ssext, abfd, backend))
goto error_return;
- if (! ecoff_link_add_externals (subsbfd ? subsbfd : abfd, info,
- external_ext, ssext))
+ if (! ecoff_link_add_externals (abfd, info, external_ext, ssext))
goto error_return;
*pneeded = TRUE;
@@ -3733,7 +3732,6 @@ ecoff_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info)
unsigned int file_offset;
const char *name;
bfd *element;
- bfd *subsbfd;
h = *pundef;
@@ -3820,13 +3818,10 @@ ecoff_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info)
/* Unlike the generic linker, we know that this element provides
a definition for an undefined symbol and we know that we want
to include it. We don't need to check anything. */
- subsbfd = NULL;
- if (! (*info->callbacks->add_archive_element)
- (info, element, name, &subsbfd))
+ if (!(*info->callbacks
+ ->add_archive_element) (info, element, name, &element))
return FALSE;
- /* Potentially, the add_archive_element hook may have set a
- substitute BFD for us. */
- if (! ecoff_link_add_object_symbols (subsbfd ? subsbfd : element, info))
+ if (! ecoff_link_add_object_symbols (element, info))
return FALSE;
pundef = &(*pundef)->u.undef.next;