This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Provide a sample object file for each ODR-violating location


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]