aboutsummaryrefslogtreecommitdiff
path: root/ld/ldwrite.c
diff options
context:
space:
mode:
authorTobias Ulmer <tobiasu@tmux.org>2017-12-01 19:25:19 +1030
committerAlan Modra <amodra@gmail.com>2017-12-01 19:26:45 +1030
commit7b2d20948528f94b405af3e951931758e92e8e4d (patch)
tree3f229122acc34f55fb1fbcae99e1f1d76d824b15 /ld/ldwrite.c
parent0fbdde942914bd9834860b65f2943577be1e46e5 (diff)
downloadgdb-7b2d20948528f94b405af3e951931758e92e8e4d.zip
gdb-7b2d20948528f94b405af3e951931758e92e8e4d.tar.gz
gdb-7b2d20948528f94b405af3e951931758e92e8e4d.tar.bz2
Check return value of bfd_new_link_order
* ldwrite.c (build_link_order): Check return value of all bfd_new_link_order calls.
Diffstat (limited to 'ld/ldwrite.c')
-rw-r--r--ld/ldwrite.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ld/ldwrite.c b/ld/ldwrite.c
index 1cd111d..1abea29 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;