This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: Add gold support for -t and -y options
- From: Ian Lance Taylor <iant at google dot com>
- To: "Cary Coutant" <ccoutant at google dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Thu, 17 Apr 2008 13:02:18 -0700
- Subject: Re: PATCH: Add gold support for -t and -y options
- References: <c17be2b30804171138y3e7697eci757077370fb3178f@mail.gmail.com>
"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