]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: Improve code for a couple more messages
authorPetr Machata <pmachata@redhat.com>
Wed, 4 Nov 2009 14:25:08 +0000 (15:25 +0100)
committerPetr Machata <pmachata@redhat.com>
Wed, 18 Aug 2010 12:55:12 +0000 (14:55 +0200)
src/dwarflint/check_debug_abbrev.cc
src/dwarflint/reloc.cc

index 3aadd1d37d93c419fbdc8121bc0e5f2800aafe49..dba3b59224d2f1a6a19f7dce84105c7c1d30ba6d 100644 (file)
@@ -224,12 +224,9 @@ check_debug_abbrev::check_debug_abbrev (dwarflint &lint)
 
       struct abbrev *original = abbrev_table_find_abbrev (section, abbr_code);
       if (unlikely (original != NULL))
-       {
-         std::stringstream ss;
-         ss << ": duplicate abbrev code " << abbr_code
-            << "; already defined at " << where_fmt (&original->where) << '.';
-         wr_error (&where, "%s\n", ss.str ().c_str ());
-       }
+       wr_error (where)
+         << "duplicate abbrev code " << abbr_code
+         << "; already defined at " << original->where << '.' << std::endl;
 
       struct abbrev fake;
       struct abbrev *cur;
index af50a326fe4d004d9b74e8f78c6fc92072fd855a..695d57783c542232c2d23232ed97a97133bd6425 100644 (file)
@@ -227,16 +227,10 @@ relocate_one (struct elf_file *file,
              wr_error (&reloc_where, "%s\n", ss.str ().c_str ());
            }
          else if ((id = file->sec[section_index].id) != offset_into)
-           {
-             std::stringstream ss;
-             ss << ": relocation references section "
-                << (id != sec_invalid
-                    ? where_fmt (WHERE (id, NULL))
-                    : file->sec[section_index].name)
-                << ", but " << where_fmt (WHERE (offset_into, NULL))
-                << " was expected.";
-             wr_error (&reloc_where, "%s\n", ss.str ().c_str ());
-           }
+           wr_error (reloc_where)
+             << "relocation references section "
+             << file->sec[section_index].name << ", but "
+             << WHERE (offset_into, NULL) << " was expected." << std::endl;
        }
 
       /* Only do the actual relocation if we have ET_REL files.  For