This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Simplify is_ir_dummy_bfd test
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Thu, 14 Aug 2014 13:51:57 +0930
- Subject: Simplify is_ir_dummy_bfd test
- Authentication-results: sourceware.org; auth=none
is_ir_dummy_bfd started life before BFD_PLUGIN was invented.
* plugin.c (is_ir_dummy_bfd): Test BFD_PLUGIN flag rather than
flags.claimed.
diff --git a/ld/plugin.c b/ld/plugin.c
index 652cde1..f02a97f 100644
--- a/ld/plugin.c
+++ b/ld/plugin.c
@@ -271,17 +271,12 @@ plugin_get_ir_dummy_bfd (const char *name, bfd *srctemplate)
}
/* Check if the BFD passed in is an IR dummy object file. */
-static bfd_boolean
+static inline bfd_boolean
is_ir_dummy_bfd (const bfd *abfd)
{
/* ABFD can sometimes legitimately be NULL, e.g. when called from one
- of the linker callbacks for a symbol in the *ABS* or *UND* sections.
- Likewise, the usrdata field may be NULL if ABFD was added by the
- backend without a corresponding input statement, as happens e.g.
- when processing DT_NEEDED dependencies. */
- return (abfd
- && abfd->usrdata
- && ((lang_input_statement_type *)(abfd->usrdata))->flags.claimed);
+ of the linker callbacks for a symbol in the *ABS* or *UND* sections. */
+ return abfd != NULL && (abfd->flags & BFD_PLUGIN) != 0;
}
/* Helpers to convert between BFD and GOLD symbol formats. */
--
Alan Modra
Australia Development Lab, IBM