summaryrefslogtreecommitdiff
path: root/gold/symtab.h
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2009-12-07 17:14:55 +0000
committerH.J. Lu <hjl.tools@gmail.com>2009-12-07 17:14:55 +0000
commit53d7974cd89aa01148a771e83a8ea5a97359f13c (patch)
tree90c35e6efd81254ec9dc191905ab178acc2fe0ff /gold/symtab.h
parentf43525316b6a7a4c300e3198e4dc0bb886cc8dd7 (diff)
downloadbinutils-gdb-53d7974cd89aa01148a771e83a8ea5a97359f13c.tar.gz
2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
PR gold/10893 * i386.cc (Target_i386::Scan::globa): Use is_func instead of checking elfcpp::STT_FUNC. (Target_i386::Relocate::relocate): Likewise. * x86_64.cc (Target_x86_64::Scan::global): Likewise. * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC symbols from shared libraries into normal FUNC symbols. * symtab.h (Symbol): Add is_func and use it.
Diffstat (limited to 'gold/symtab.h')
-rw-r--r--gold/symtab.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/gold/symtab.h b/gold/symtab.h
index 544712db9f5..c153150e1be 100644
--- a/gold/symtab.h
+++ b/gold/symtab.h
@@ -205,6 +205,14 @@ class Symbol
type() const
{ return this->type_; }
+ // Return true for function symbol.
+ bool
+ is_func() const
+ {
+ return (this->type_ == elfcpp::STT_FUNC
+ || this->type_ == elfcpp::STT_GNU_IFUNC);
+ }
+
// Return the symbol visibility.
elfcpp::STV
visibility() const
@@ -543,7 +551,7 @@ class Symbol
return (!parameters->doing_static_link()
&& !parameters->options().pie()
- && this->type() == elfcpp::STT_FUNC
+ && this->is_func()
&& (this->is_from_dynobj()
|| this->is_undefined()
|| this->is_preemptible()));
@@ -734,7 +742,7 @@ class Symbol
return (!parameters->options().shared()
&& parameters->options().copyreloc()
&& this->is_from_dynobj()
- && this->type() != elfcpp::STT_FUNC);
+ && !this->is_func());
}
protected: