From: Chris Demetriou Date: Tue, 22 Jul 2008 21:02:44 +0000 (+0000) Subject: 2008-07-22 Simon Baldwin X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3f7c5e1d995c658ef8709e5fae244f25434db931;p=binutils-gdb.git 2008-07-22 Simon Baldwin * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size to zero when writing undefined symbols. --- diff --git a/gold/ChangeLog b/gold/ChangeLog index c1dc3095c79..5901d3d18f6 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2008-07-22 Simon Baldwin + + * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size + to zero when writing undefined symbols. + 2008-07-22 Ian Lance Taylor * output.cc (Output_section::add_input_section): Don't try to diff --git a/gold/symtab.cc b/gold/symtab.cc index a482bfeee19..f9bbcc0b2f2 100644 --- a/gold/symtab.cc +++ b/gold/symtab.cc @@ -2334,7 +2334,8 @@ Symbol_table::sized_write_symbol( elfcpp::Sym_write osym(p); osym.put_st_name(pool->get_offset(sym->name())); osym.put_st_value(value); - osym.put_st_size(sym->symsize()); + // Use a symbol size of zero for undefined symbols. + osym.put_st_size(shndx == elfcpp::SHN_UNDEF ? 0 : sym->symsize()); // 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()));