This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Provide a sample object file for each ODR-violating location
- From: Ian Lance Taylor <iant at google dot com>
- To: Jeffrey Yasskin <jyasskin at google dot com>
- Cc: binutils at sourceware dot org
- Date: Sat, 26 Jun 2010 23:17:52 -0700
- Subject: Re: [PATCH] Provide a sample object file for each ODR-violating location
- References: <AANLkTinGrneiIkd55juzpnKVVYSdNS5ekdVvsLC9LCXu@mail.gmail.com>
Jeffrey Yasskin <jyasskin@google.com> writes:
> Right now, gold produces errors like
>
> warning: while linking my_exe: symbol 'ns::Tpl<Arg>::~Tpl()' defined
> in multiple places (possible ODR violation):
> ./path/to/some_header.h:38
> ./path/to/other_header.h:490
>
> While trying to figure out why this is happening, I wanted to know
> which object files those definitions came from. The attached patch
> changes the output to:
>
> warning: while linking my_exe: symbol 'ns::Tpl<Arg>::~Tpl()' defined
> in multiple places (possible ODR violation):
> ./path/to/some_header.h:38 from libfoo.a(obj1.o)
> ./path/to/other_header.h:490 from libfoo.a(obj2.o)
>
> where the object file after "from" is an arbitrary object file
> including that location. This may be spammy in ordinary use, but it
> should be useful while we iron out the false positives.
Thanks. Approved and applied, with this ChangeLog entry.
2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
* symtab.cc (detect_odr_violations): When reporting an ODR
violation, report an object where the symbol is defined.
Ian