From 8474a88fd23a3c9c33dfc8ded31a9a15e31e7765 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 20 Jun 2016 12:28:20 -0700 Subject: gold/x86: Handle output without PLT If there is no PLT in output, return 0 for first_plt_entry_offset and plt_entry_size. PR gold/20245 * i386.cc (Target_i386::first_plt_entry_offset): Return 0 if plt_ is NULL. (Target_i386::plt_entry_size): Likewise. (Target_x86_64::first_plt_entry_offset): Likewise. (Target_x86_64::plt_entry_size): Likewise. --- gold/x86_64.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gold/x86_64.cc') diff --git a/gold/x86_64.cc b/gold/x86_64.cc index 81126ef..d069957 100644 --- a/gold/x86_64.cc +++ b/gold/x86_64.cc @@ -1822,6 +1822,8 @@ template unsigned int Target_x86_64::first_plt_entry_offset() const { + if (this->plt_ == NULL) + return 0; return this->plt_->first_plt_entry_offset(); } @@ -1831,6 +1833,8 @@ template unsigned int Target_x86_64::plt_entry_size() const { + if (this->plt_ == NULL) + return 0; return this->plt_->get_plt_entry_size(); } -- cgit v1.1