aboutsummaryrefslogtreecommitdiff
path: root/gold/symtab.cc
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2008-04-17 22:45:47 +0000
committerCary Coutant <ccoutant@google.com>2008-04-17 22:45:47 +0000
commitc5818ff112aac72067c827a4a4fad732eae40741 (patch)
tree7d56ba982473581ec9aab6c40269137cb4a9ea35 /gold/symtab.cc
parente9bbd7c5e43873cff4050cad26808f727294f7cc (diff)
downloadgdb-c5818ff112aac72067c827a4a4fad732eae40741.zip
gdb-c5818ff112aac72067c827a4a4fad732eae40741.tar.gz
gdb-c5818ff112aac72067c827a4a4fad732eae40741.tar.bz2
* errors.cc (Errors::info): New function.
(gold_info): New function. * errors.h (Errors::info): New function. * gold.h (gold_info): New function. * object.cc (Input_objects::add_object): Print trace output. * options.cc (options::parse_set): New function. (General_options::parse_wrap): Deleted. (General_options::General_options): Deleted initializer. * options.h (options::String_set): New typedef. (options::parse_set): New function. (DEFINE_set): New macro. (General_options::wrap): Changed to use DEFINE_set. Changed callers of any_wrap_symbols and is_wrap_symbol. (General_options::trace, General_options::trace_symbol): New options. (General_options::any_wrap_symbols, General_options::is_wrap_symbol) (General_options::wrap_symbols_): Deleted. * symtab.cc (Symbol_table::add_from_object): Print trace output.
Diffstat (limited to 'gold/symtab.cc')
-rw-r--r--gold/symtab.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/gold/symtab.cc b/gold/symtab.cc
index dc86582..517d011 100644
--- a/gold/symtab.cc
+++ b/gold/symtab.cc
@@ -495,7 +495,7 @@ Symbol_table::wrap_symbol(Object* object, const char* name,
++name;
}
- if (parameters->options().is_wrap_symbol(name))
+ if (parameters->options().is_wrap(name))
{
// Turn NAME into __wrap_NAME.
std::string s;
@@ -513,7 +513,7 @@ Symbol_table::wrap_symbol(Object* object, const char* name,
const char* const real_prefix = "__real_";
const size_t real_prefix_length = strlen(real_prefix);
if (strncmp(name, real_prefix, real_prefix_length) == 0
- && parameters->options().is_wrap_symbol(name + real_prefix_length))
+ && parameters->options().is_wrap(name + real_prefix_length))
{
// Turn __real_NAME into NAME.
std::string s;
@@ -565,10 +565,19 @@ Symbol_table::add_from_object(Object* object,
const elfcpp::Sym<size, big_endian>& sym,
const elfcpp::Sym<size, big_endian>& orig_sym)
{
+ // Print a message if this symbol is being traced.
+ if (parameters->options().is_trace_symbol(name))
+ {
+ if (orig_sym.get_st_shndx() == elfcpp::SHN_UNDEF)
+ gold_info(_("%s: reference to %s"), object->name().c_str(), name);
+ else
+ gold_info(_("%s: definition of %s"), object->name().c_str(), name);
+ }
+
// For an undefined symbol, we may need to adjust the name using
// --wrap.
if (orig_sym.get_st_shndx() == elfcpp::SHN_UNDEF
- && parameters->options().any_wrap_symbols())
+ && parameters->options().any_wrap())
{
const char* wrap_name = this->wrap_symbol(object, name, &name_key);
if (wrap_name != name)