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]

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


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.

Jeffrey Yasskin

Attachment: sample_object_for_odr.patch
Description: Binary data


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