diff options
author | Chris Demetriou <cgd@google.com> | 2008-07-23 16:19:59 +0000 |
---|---|---|
committer | Chris Demetriou <cgd@google.com> | 2008-07-23 16:19:59 +0000 |
commit | 58e54ac21d936303bd34112d12b5ac5690df8b2e (patch) | |
tree | 0963d474e46b3b79ae218c9f17fc75d5010e113a | |
parent | 95d14cd31e8c12b180adeba4aa840250004ca534 (diff) | |
download | gdb-58e54ac21d936303bd34112d12b5ac5690df8b2e.zip gdb-58e54ac21d936303bd34112d12b5ac5690df8b2e.tar.gz gdb-58e54ac21d936303bd34112d12b5ac5690df8b2e.tar.bz2 |
2008-07-23 Simon Baldwin <simonb@google.com>
* symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
to zero for undefined symbols from dynamic libraries.
-rw-r--r-- | gold/ChangeLog | 5 | ||||
-rw-r--r-- | gold/symtab.cc | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog index 8693c76..cb28b25 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2008-07-23 Simon Baldwin <simonb@google.com> + + * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size + to zero for undefined symbols from dynamic libraries. + 2008-07-23 Ian Lance Taylor <iant@google.com> * symtab.cc (Symbol_table::resolve): Remove version parameter. diff --git a/gold/symtab.cc b/gold/symtab.cc index e3b0d9d..259004e 100644 --- a/gold/symtab.cc +++ b/gold/symtab.cc @@ -2354,8 +2354,11 @@ 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); - // Use a symbol size of zero for undefined symbols. - osym.put_st_size(shndx == elfcpp::SHN_UNDEF ? 0 : sym->symsize()); + // Use a symbol size of zero for undefined symbols from shared libraries. + if (shndx == elfcpp::SHN_UNDEF && sym->is_from_dynobj()) + osym.put_st_size(0); + else + osym.put_st_size(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())); |