aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorChris Demetriou <cgd@google.com>2008-07-22 21:02:44 +0000
committerChris Demetriou <cgd@google.com>2008-07-22 21:02:44 +0000
commit3f7c5e1d995c658ef8709e5fae244f25434db931 (patch)
tree4b4aff6c6a74fac5fbfe5e745998b08657e8c44a /gold
parent308cb401d61ed41e7aa5c7113feb7adde8dbdc36 (diff)
downloadgdb-3f7c5e1d995c658ef8709e5fae244f25434db931.zip
gdb-3f7c5e1d995c658ef8709e5fae244f25434db931.tar.gz
gdb-3f7c5e1d995c658ef8709e5fae244f25434db931.tar.bz2
2008-07-22 Simon Baldwin <simonb@google.com>
* symtab.cc (Symbol_table::sized_write_symbol): Set symbol size to zero when writing undefined symbols.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog5
-rw-r--r--gold/symtab.cc3
2 files changed, 7 insertions, 1 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index c1dc309..5901d3d 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,8 @@
+2008-07-22 Simon Baldwin <simonb@google.com>
+
+ * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
+ to zero when writing undefined symbols.
+
2008-07-22 Ian Lance Taylor <iant@google.com>
* output.cc (Output_section::add_input_section): Don't try to
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()));