[gold patch] Fix usage of invalidated version string in Symbol_table::define_special_symbol
Ian Lance Taylor
iant@google.com
Wed Sep 28 00:56:00 GMT 2011
Viktor Kutuzov <vkutuzov@accesssoftek.com> writes:
> I found that the Symbol_table::define_special_symbol method can return a
> pointer to an invalidated version string from the local std::string
> object (v) in case of condition only_if_ref == true. This patch should
> fix this problem.
>
> -Viktor.
>
> * symtab.cc (Symbol_table::define_special_symbol): Fix usage of
> the invalidated version string.
Thanks for the bug report and patch. I don't think your approach is
entirely correct. If the version is the default, we still want to look
up the symbol with a NULL version. Also, if is_default_version is true
we know that *pversion != NULL. I think this patch will fix the
problem. Committed to mainline and 2.22 branch.
Ian
2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
Ian Lance Taylor <iant@google.com>
* symtab.cc (Symbol_table::define_special_symbol): Always
canonicalize version string.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.patch
Type: text/x-diff
Size: 560 bytes
Desc: patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20110928/b44f38e1/attachment.bin>
More information about the Binutils
mailing list