This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Initialize input statement created in add_archive_member
- From: Thomas Preud'homme <thopre01 at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 31 Oct 2016 09:49:15 -0000
- Subject: [binutils-gdb] Initialize input statement created in add_archive_member
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=fb47deda560b754008c35b5ec13fe02ef0593019
commit fb47deda560b754008c35b5ec13fe02ef0593019
Author: Thomas Preud'homme <thomas.preudhomme@arm.com>
Date: Mon Oct 31 09:44:18 2016 +0000
Initialize input statement created in add_archive_member
2016-10-31 Thomas Preud'homme <thomas.preudhomme@arm.com>
ld/
* ldmain.c (add_archive_element): Initialize input->header.type.
* plugin.c (plugin_maybe_claim): Assert the statement is an input
statement.
Diff:
---
ld/ChangeLog | 6 ++++++
ld/ldmain.c | 1 +
ld/plugin.c | 1 +
3 files changed, 8 insertions(+)
diff --git a/ld/ChangeLog b/ld/ChangeLog
index c7a20f1..dacdf8e 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,9 @@
+2016-10-31 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ * ldmain.c (add_archive_element): Initialize input->header.type.
+ * plugin.c (plugin_maybe_claim): Assert the statement is an input
+ statement.
+
2016-10-15 Alan Modra <amodra@gmail.com>
* emultempl/spu_ovl.o_c: Regenerate.
diff --git a/ld/ldmain.c b/ld/ldmain.c
index 29ef77f..2f15ba7 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -800,6 +800,7 @@ add_archive_element (struct bfd_link_info *info,
input = (lang_input_statement_type *)
xcalloc (1, sizeof (lang_input_statement_type));
+ input->header.type = lang_input_statement_enum;
input->filename = abfd->filename;
input->local_sym_name = abfd->filename;
input->the_bfd = abfd;
diff --git a/ld/plugin.c b/ld/plugin.c
index 80d22e2..8042940 100644
--- a/ld/plugin.c
+++ b/ld/plugin.c
@@ -1195,6 +1195,7 @@ plugin_object_p (bfd *ibfd)
void
plugin_maybe_claim (lang_input_statement_type *entry)
{
+ ASSERT (entry->header.type == lang_input_statement_enum);
if (plugin_object_p (entry->the_bfd))
{
bfd *abfd = entry->the_bfd->plugin_dummy_bfd;