aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/ldlang.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index e4e3f74..5a3b2dd 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2019-11-21 Nick Clifton <nickc@redhat.com>
+
+ * ldlang.h (LANG_FOR_EACH_INPUT_STATEMENT): Check for an empty
+ file chain before examining the first input statement.
+
2019-11-21 Alan Modra <amodra@gmail.com>
PR 46
diff --git a/ld/ldlang.h b/ld/ldlang.h
index 8cc5cf7..3e3e6a0 100644
--- a/ld/ldlang.h
+++ b/ld/ldlang.h
@@ -574,7 +574,7 @@ extern asection *section_for_dot
#define LANG_FOR_EACH_INPUT_STATEMENT(statement) \
lang_input_statement_type *statement; \
- for (statement = &file_chain.head->input_statement; \
+ for (statement = file_chain.head == NULL ? NULL : &file_chain.head->input_statement; \
statement != NULL; \
statement = statement->next)