diff options
author | Cary Coutant <ccoutant@google.com> | 2013-05-21 20:56:13 +0000 |
---|---|---|
committer | Cary Coutant <ccoutant@google.com> | 2013-05-21 20:56:13 +0000 |
commit | 60e8b3fccd5e6748c420c7ae5d78917af26345fc (patch) | |
tree | f3efcbbf25898d69c97a46c32e8119df8dd82959 /gold/object.cc | |
parent | c8c735b96348ead98a7ddeb25a5eed4912586396 (diff) | |
download | gdb-60e8b3fccd5e6748c420c7ae5d78917af26345fc.zip gdb-60e8b3fccd5e6748c420c7ae5d78917af26345fc.tar.gz gdb-60e8b3fccd5e6748c420c7ae5d78917af26345fc.tar.bz2 |
gold/
* object.cc (Sized_relobj_file::get_symbol_location_info): Set
type of enclosing symbol.
(Relocate_info::location): Check symbol type when describing symbol.
* object.h (Symbol_location_info): Remove unused line_number;
add enclosing_symbol_type.
* testsuite/debug_msg.sh: Adjust expected output.
Diffstat (limited to 'gold/object.cc')
-rw-r--r-- | gold/object.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/gold/object.cc b/gold/object.cc index 715f7ac..1f113d1 100644 --- a/gold/object.cc +++ b/gold/object.cc @@ -1,6 +1,6 @@ // object.cc -- support for an object file for linking in gold -// Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012 +// Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 // Free Software Foundation, Inc. // Written by Ian Lance Taylor <iant@google.com>. @@ -2687,6 +2687,7 @@ Sized_relobj_file<size, big_endian>::get_symbol_location_info( && (static_cast<off_t>(sym.get_st_value() + sym.get_st_size()) > offset)) { + info->enclosing_symbol_type = sym.get_st_type(); if (sym.get_st_name() > names_size) info->enclosing_symbol_name = "(invalid)"; else @@ -2996,12 +2997,10 @@ Relocate_info<size, big_endian>::location(size_t, off_t offset) const ret += ":"; ret += info.source_file; } - size_t len = info.enclosing_symbol_name.length() + 100; - char* buf = new char[len]; - snprintf(buf, len, _(":function %s"), - info.enclosing_symbol_name.c_str()); - ret += buf; - delete[] buf; + ret += ":"; + if (info.enclosing_symbol_type == elfcpp::STT_FUNC) + ret += _("function "); + ret += info.enclosing_symbol_name; return ret; } |