aboutsummaryrefslogtreecommitdiff
path: root/gold/symtab.cc
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.cc
parentf43525316b6a7a4c300e3198e4dc0bb886cc8dd7 (diff)
downloadgdb-53d7974cd89aa01148a771e83a8ea5a97359f13c.zip
gdb-53d7974cd89aa01148a771e83a8ea5a97359f13c.tar.gz
gdb-53d7974cd89aa01148a771e83a8ea5a97359f13c.tar.bz2
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.cc')
-rw-r--r--gold/symtab.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/gold/symtab.cc b/gold/symtab.cc
index 7427f8e..7e8a890 100644
--- a/gold/symtab.cc
+++ b/gold/symtab.cc
@@ -2810,11 +2810,16 @@ Symbol_table::sized_write_symbol(
osym.put_st_size(0);
else
osym.put_st_size(sym->symsize());
+ elfcpp::STT type = sym->type();
+ // Turn IFUNC symbols from shared libraries into normal FUNC symbols.
+ if (type == elfcpp::STT_GNU_IFUNC
+ && sym->is_from_dynobj())
+ type = elfcpp::STT_FUNC;
// A version script may have overridden the default binding.
if (sym->is_forced_local())
- osym.put_st_info(elfcpp::elf_st_info(elfcpp::STB_LOCAL, sym->type()));
+ osym.put_st_info(elfcpp::elf_st_info(elfcpp::STB_LOCAL, type));
else
- osym.put_st_info(elfcpp::elf_st_info(sym->binding(), sym->type()));
+ osym.put_st_info(elfcpp::elf_st_info(sym->binding(), type));
osym.put_st_other(elfcpp::elf_st_other(sym->visibility(), sym->nonvis()));
osym.put_st_shndx(shndx);
}