[PATCH] Check return value of bfd_new_link_order
Tobias Ulmer
tobiasu@tmux.org
Thu Nov 30 14:05:00 GMT 2017
Signed-off-by: Tobias Ulmer <tobiasu@tmux.org>
---
ld/ldwrite.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/ld/ldwrite.c b/ld/ldwrite.c
index 1cd111d2..1abea29b 100644
--- a/ld/ldwrite.c
+++ b/ld/ldwrite.c
@@ -254,6 +254,8 @@ build_link_order (lang_statement_union_type *statement)
link_order = bfd_new_link_order (link_info.output_bfd,
output_section);
+ if (link_order == NULL)
+ einfo (_("%P%F: bfd_new_link_order failed\n"));
if ((i->flags & SEC_NEVER_LOAD) != 0
&& (i->flags & SEC_DEBUGGING) == 0)
@@ -293,6 +295,8 @@ build_link_order (lang_statement_union_type *statement)
link_order = bfd_new_link_order (link_info.output_bfd,
output_section);
+ if (link_order == NULL)
+ einfo (_("%P%F: bfd_new_link_order failed\n"));
link_order->type = bfd_data_link_order;
link_order->size = statement->padding_statement.size;
link_order->offset = statement->padding_statement.output_offset;
--
2.15.0
More information about the Binutils
mailing list