From 358de98820c5e9caa222846ba8b646de6cc091c8 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 2 Sep 2015 04:14:21 -0700 Subject: Turn IFUNC symbols from shared libraries into normal FUNC symbols Turn IFUNC symbols from shared libraries into normal FUNC symbols when we are resolving symbol references, instead of when we are writing out the symbol table. PR gold/18886 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from shared libraries into normal FUNC symbols. * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC symbols aren't from shared libraries. --- gold/resolve.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gold/resolve.cc') diff --git a/gold/resolve.cc b/gold/resolve.cc index 2dcf7b5b1e8..dd5b6b6afa6 100644 --- a/gold/resolve.cc +++ b/gold/resolve.cc @@ -98,7 +98,13 @@ Symbol::override_base(const elfcpp::Sym& 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(); -- cgit v1.2.1