aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2014-08-14 10:43:41 +0930
committerAlan Modra <amodra@gmail.com>2014-08-14 13:39:40 +0930
commit23ebe1a0bd86fdae83ca738cf75be67b58703756 (patch)
treebfbdee07fb5f0368a83812fad423736e7563f6e7
parent8123365312729e65a4a36bc9174a8b229afc29fa (diff)
downloadgdb-23ebe1a0bd86fdae83ca738cf75be67b58703756.zip
gdb-23ebe1a0bd86fdae83ca738cf75be67b58703756.tar.gz
gdb-23ebe1a0bd86fdae83ca738cf75be67b58703756.tar.bz2
Simplify is_ir_dummy_bfd test
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.
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/plugin.c11
2 files changed, 8 insertions, 8 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index fa7cab6..791bc74 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2014-08-14 Alan Modra <amodra@gmail.com>
+
+ * plugin.c (is_ir_dummy_bfd): Test BFD_PLUGIN flag rather than
+ flags.claimed.
+
2014-08-13 Yaakov Selkowitz <yselkowi@redhat.com>
* pe-dll.c (autofilter_entry_type autofilter_symbollist_i386): Add
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. */