This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Check return value of bfd_new_link_order


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]