2008-07-22 Simon Baldwin <simonb@google.com>
authorChris Demetriou <cgd@google.com>
Tue, 22 Jul 2008 21:02:44 +0000 (21:02 +0000)
committerChris Demetriou <cgd@google.com>
Tue, 22 Jul 2008 21:02:44 +0000 (21:02 +0000)
        * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
        to zero when writing undefined symbols.

gold/ChangeLog
gold/symtab.cc

index c1dc3095c79fe72d32a9e213627ea5d219505566..5901d3d18f683fbb0e944f9933bf3de9a980e8f3 100644 (file)
@@ -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
index a482bfeee1918764605590c3b3f22048440a0838..f9bbcc0b2f24333400a36309725b560338666669 100644 (file)
@@ -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()));