warning message.
// See if any of the input definitions violate the One Definition Rule.
// TODO: if this is too slow, do this as a task, rather than inline.
- symtab->detect_odr_violations();
+ symtab->detect_odr_violations(options.output_file_name());
// Define some sections and symbols needed for a dynamic link. This
// handles some cases we want to see before we read the relocs.
// but apparently different definitions (different source-file/line-no).
void
-Symbol_table::detect_odr_violations() const
+Symbol_table::detect_odr_violations(const char* output_file_name) const
{
for (Odr_map::const_iterator it = candidate_odr_violations_.begin();
it != candidate_odr_violations_.end();
if (line_nums.size() > 1)
{
- gold_warning(_("symbol %s defined in multiple places "
- "(possible ODR violation):"), symbol_name);
+ gold_warning(_("while linking %s: symbol %s defined in multiple "
+ "places (possible ODR violation):"),
+ output_file_name, symbol_name);
for (std::set<std::string>::const_iterator it2 = line_nums.begin();
it2 != line_nums.end();
++it2)
// Check candidate_odr_violations_ to find symbols with the same name
// but apparently different definitions (different source-file/line-no).
void
- detect_odr_violations() const;
+ detect_odr_violations(const char* output_file_name) const;
// SYM is defined using a COPY reloc. Return the dynamic object
// where the original definition was found.
check "debug_msg.o: in function int testfn<double>(double):${srcdir}/debug_msg.cc:45: undefined reference to 'undef_int'"
# Check we detected the ODR (One Definition Rule) violation.
-check "warning: symbol Ordering::operator()(int, int) *defined in multiple places (possible ODR violation):"
+check ": symbol Ordering::operator()(int, int) *defined in multiple places (possible ODR violation):"
check "odr_violation1.cc:5"
check "odr_violation2.cc:5"