From 4212b42d795628dcc36bcffc7cf16175f7698305 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sat, 16 Jul 2016 13:29:35 +0930 Subject: Don't include libbfd.h outside of bfd, part 4 Not much to see here, just renaming a function. bfd/ * targets.c (bfd_seach_for_target): Rename to.. (bfd_iterate_over_targets): ..this. Rewrite doc. * bfd-in2.h: Regenerate. ld/ * ldlang.c (open_output): Replace bfd_search_for_target with bfd_iterate_over_targets. Localize vars. --- ld/ChangeLog | 5 +++++ ld/ldlang.c | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'ld') diff --git a/ld/ChangeLog b/ld/ChangeLog index b7be656..e4026ec 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,10 @@ 2016-07-16 Alan Modra + * ldlang.c (open_output): Replace bfd_search_for_target with + bfd_iterate_over_targets. Localize vars. + +2016-07-16 Alan Modra + * ldlang.c: Don't include libbfd.h. * emultempl/nds32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise. diff --git a/ld/ldlang.c b/ld/ldlang.c index 82d5582..aee8720 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -3113,15 +3113,15 @@ open_output (const char *name) line? */ if (command_line.endian != ENDIAN_UNSET) { - const bfd_target *target; - enum bfd_endian desired_endian; - /* Get the chosen target. */ - target = bfd_search_for_target (get_target, (void *) output_target); + const bfd_target *target + = bfd_iterate_over_targets (get_target, (void *) output_target); /* If the target is not supported, we cannot do anything. */ if (target != NULL) { + enum bfd_endian desired_endian; + if (command_line.endian == ENDIAN_BIG) desired_endian = BFD_ENDIAN_BIG; else @@ -3143,8 +3143,8 @@ open_output (const char *name) /* Try to find a target as similar as possible to the default target, but which has the desired endian characteristic. */ - bfd_search_for_target (closest_target_match, - (void *) target); + bfd_iterate_over_targets (closest_target_match, + (void *) target); /* Oh dear - we could not find any targets that satisfy our requirements. */ -- cgit v1.1