PATCH: Add gold support for -t and -y options
Ian Lance Taylor
iant@google.com
Thu Apr 17 20:02:00 GMT 2008
"Cary Coutant" <ccoutant@google.com> writes:
> + // Whether to trace SYMBOL.
> + bool
> + is_trace_symbol(const char* symbol) const
> + {
> + return (this->trace_symbols_.find(std::string(symbol))
> + != this->trace_symbols_.end());
> + }
> + // 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);
> + }
> +
This is going to insert a std::string constructor and destructor to
every symbol seen in every object file whether or not -y is used.
That is too expensive for such an uncommon feature. You need to guard
the call to is_trace_symbol with a call to an (inlined) function like
any_trace_symbols. Compare to any_wrap_symbols.
Ok with that change.
Thanks.
Ian
More information about the Binutils
mailing list