mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 17:18:55 +00:00
Fix internal error caused by IFUNC patch.
The previous commit to fix PR gold/18886 converted STT_IFUNC to STT_FUNC when resolving to a symbol defined in a shared library. This leads to an internal error if the shared library symbol is seen first, as we do not convert the symbol at all. We need to override the STT_IFUNC in add_from_dynobj() instead of in override_base(). gold/ PR gold/18930 PR gold/18886 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here. * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
This commit is contained in:
@@ -98,13 +98,7 @@ 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)
|
||||
{
|
||||
// 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->type_ = sym.get_st_type();
|
||||
this->binding_ = sym.get_st_bind();
|
||||
this->override_visibility(sym.get_st_visibility());
|
||||
this->nonvis_ = sym.get_st_nonvis();
|
||||
|
||||
Reference in New Issue
Block a user