This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] PR gold/18886: Unnecessary PLT entry for IFUNC function from DSO
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: binutils at sourceware dot org
- Cc: Cary Coutant <ccoutant at gmail dot com>
- Date: Sun, 30 Aug 2015 11:25:48 -0700
- Subject: [PATCH] PR gold/18886: Unnecessary PLT entry for IFUNC function from DSO
- Authentication-results: sourceware.org; auth=none
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
OK for master?
H.J.
--
PR gold/18886
* resolve.cc (Symbol::override_base): Turn IFUNC symbols from
shared libraries into normal FUNC symbols.
---
gold/resolve.cc | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/gold/resolve.cc b/gold/resolve.cc
index 2dcf7b5..dd5b6b6 100644
--- a/gold/resolve.cc
+++ b/gold/resolve.cc
@@ -98,7 +98,13 @@ Symbol::override_base(const elfcpp::Sym<size, big_endian>& sym,
this->is_ordinary_shndx_ = is_ordinary;
// Don't override st_type from plugin placeholder symbols.
if (object->pluginobj() == NULL)
- this->type_ = sym.get_st_type();
+ {
+ // Turn IFUNC symbols from shared libraries into normal FUNC symbols.
+ elfcpp::STT type = sym.get_st_type();
+ if (object->is_dynamic() && type == elfcpp::STT_GNU_IFUNC)
+ type = elfcpp::STT_FUNC;
+ this->type_ = type;
+ }
this->binding_ = sym.get_st_bind();
this->override_visibility(sym.get_st_visibility());
this->nonvis_ = sym.get_st_nonvis();
--
2.4.3