aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2016-07-16 13:29:35 +0930
committerAlan Modra <amodra@gmail.com>2016-07-16 13:29:35 +0930
commit4212b42d795628dcc36bcffc7cf16175f7698305 (patch)
treeccc4026c32f6e7b701444b1309a0fa126d04e1bf /ld
parent16412c3bc4b00ecbf87251bfd2c92584615412bb (diff)
downloadgdb-4212b42d795628dcc36bcffc7cf16175f7698305.zip
gdb-4212b42d795628dcc36bcffc7cf16175f7698305.tar.gz
gdb-4212b42d795628dcc36bcffc7cf16175f7698305.tar.bz2
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.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/ldlang.c12
2 files changed, 11 insertions, 6 deletions
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 <amodra@gmail.com>
+ * ldlang.c (open_output): Replace bfd_search_for_target with
+ bfd_iterate_over_targets. Localize vars.
+
+2016-07-16 Alan Modra <amodra@gmail.com>
+
* 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. */