aboutsummaryrefslogtreecommitdiff
path: root/gold/symtab.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gold/symtab.cc')
-rw-r--r--gold/symtab.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gold/symtab.cc b/gold/symtab.cc
index a482bfe..f9bbcc0 100644
--- a/gold/symtab.cc
+++ b/gold/symtab.cc
@@ -2334,7 +2334,8 @@ Symbol_table::sized_write_symbol(
elfcpp::Sym_write<size, big_endian> 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()));