* Fix ld uninitialized read of script ASSERT data structure
@ 2017-03-07 2:27 Alan Modra
0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2017-03-07 2:27 UTC (permalink / raw)
To: binutils
Another bug that's been around for a while, but only noticed by me
this morning. lang_assignment_statement serves both assignments and
asserts.
* ldlang.c (open_input_bfds): Check that lang_assignment_statement
is not an assert before referencing defsym.
diff --git a/ld/ChangeLog b/ld/ChangeLog
index cbe44a2..3883bcb 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2017-03-07 Alan Modra <amodra@gmail.com>
+
+ * ldlang.c (open_input_bfds): Check that lang_assignment_statement
+ is not an assert before referencing defsym.
+
2017-03-05 Alan Modra <amodra@gmail.com>
* testsuite/ld-elf/eh3.d: Adjust for eh_frame alignment change.
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 1396c5b..ff6ef39 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -3374,7 +3374,8 @@ open_input_bfds (lang_statement_union_type *s, enum open_bfd_mode mode)
#endif
break;
case lang_assignment_statement_enum:
- if (s->assignment_statement.exp->assign.defsym)
+ if (s->assignment_statement.exp->type.node_class != etree_assert
+ && s->assignment_statement.exp->assign.defsym)
/* This is from a --defsym on the command line. */
exp_fold_tree_no_dot (s->assignment_statement.exp);
break;
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-03-07 2:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-07 2:27 Fix ld uninitialized read of script ASSERT data structure Alan Modra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).