aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2016-06-20 12:28:20 -0700
committerH.J. Lu <hjl.tools@gmail.com>2016-06-20 12:28:32 -0700
commit8474a88fd23a3c9c33dfc8ded31a9a15e31e7765 (patch)
tree5c315d56351d5fd8f310aee641a0cba4966419ba /gold
parenta8ecc9fe61d0fdb1f694c5f3fac910802468d43f (diff)
downloadfsf-binutils-gdb-8474a88fd23a3c9c33dfc8ded31a9a15e31e7765.zip
fsf-binutils-gdb-8474a88fd23a3c9c33dfc8ded31a9a15e31e7765.tar.gz
fsf-binutils-gdb-8474a88fd23a3c9c33dfc8ded31a9a15e31e7765.tar.bz2
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<size>::first_plt_entry_offset): Likewise. (Target_x86_64<size>::plt_entry_size): Likewise.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog9
-rw-r--r--gold/i386.cc4
-rw-r--r--gold/x86_64.cc4
3 files changed, 17 insertions, 0 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index a4c9d6c..ae2ccb3 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,12 @@
+2016-06-20 H.J. Lu <hongjiu.lu@intel.com>
+
+ 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<size>::first_plt_entry_offset): Likewise.
+ (Target_x86_64<size>::plt_entry_size): Likewise.
+
2016-06-20 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
* mips.cc (Target_mips::Target_mips): Initialize rld_map_.
diff --git a/gold/i386.cc b/gold/i386.cc
index 8aaa2a8..87e6a6d 100644
--- a/gold/i386.cc
+++ b/gold/i386.cc
@@ -1565,6 +1565,8 @@ Target_i386::plt_entry_count() const
unsigned int
Target_i386::first_plt_entry_offset() const
{
+ if (this->plt_ == NULL)
+ return 0;
return this->plt_->first_plt_entry_offset();
}
@@ -1573,6 +1575,8 @@ Target_i386::first_plt_entry_offset() const
unsigned int
Target_i386::plt_entry_size() const
{
+ if (this->plt_ == NULL)
+ return 0;
return this->plt_->get_plt_entry_size();
}
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<int size>
unsigned int
Target_x86_64<size>::first_plt_entry_offset() const
{
+ if (this->plt_ == NULL)
+ return 0;
return this->plt_->first_plt_entry_offset();
}
@@ -1831,6 +1833,8 @@ template<int size>
unsigned int
Target_x86_64<size>::plt_entry_size() const
{
+ if (this->plt_ == NULL)
+ return 0;
return this->plt_->get_plt_entry_size();
}