]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint recognizes --gnu option.
authorPetr Machata <pmachata@redhat.com>
Wed, 7 Jan 2009 16:51:49 +0000 (17:51 +0100)
committerPetr Machata <pmachata@redhat.com>
Wed, 7 Jan 2009 16:51:49 +0000 (17:51 +0100)
src/ChangeLog
src/dwarflint.c

index 91053919d25975a08ea9816883a68dfcb88dac4c..d4c2103319d0bac8217526dd2050cde1481c9eee 100644 (file)
@@ -1,3 +1,8 @@
+2009-01-07  Petr Machata  <pmachata@redhat.com>
+
+       * dwarflint.c: Add --gnu option.  Don't warn about unnecessary
+       padding when --gnu was on command line.
+
 2009-01-07  Petr Machata  <pmachata@redhat.com>
 
        * dwarflint.c: More checking DW_AT_sibling correctness.
index 4e5e275c8b27461f9e3579b4362f3b384ba279c5..68c66db87b17c22acae283d2c068a17757bc8703 100644 (file)
@@ -51,6 +51,7 @@
 const char *argp_program_bug_address = PACKAGE_BUGREPORT;
 
 #define ARGP_strict    300
+#define ARGP_gnu       301
 
 /* Definitions of arguments for argp functions.  */
 static const struct argp_option options[] =
@@ -59,6 +60,9 @@ static const struct argp_option options[] =
   { "strict", ARGP_strict, NULL, 0,
     N_("Be extremely strict, flag level 2 features."), 0 },
   { "quiet", 'q', NULL, 0, N_("Do not print anything if successful"), 0 },
+  { "gnu", ARGP_gnu, NULL, 0,
+    N_("Binary has been created with GNU toolchain and is therefore known to be \
+broken in certain ways"), 0 },
   { NULL, 0, NULL, 0, NULL, 0 }
 };
 
@@ -99,6 +103,9 @@ static bool be_strict;
 /* True if no message is to be printed if the run is succesful.  */
 static bool be_quiet;
 
+/* True if binary is assumed to be generated with GNU toolchain.  */
+static bool assume_gnu;
+
 int
 main (int argc, char *argv[])
 {
@@ -185,6 +192,10 @@ parse_opt (int key, char *arg __attribute__ ((unused)),
       be_strict = true;
       break;
 
+    case ARGP_gnu:
+      assume_gnu = true;
+      break;
+
     case 'q':
       be_quiet = true;
       break;
@@ -661,7 +672,7 @@ abbrev_table_load (struct read_ctx *ctx)
          prev_abbr_off = abbr_off;
        }
 
-      if (zero_seq_off != (uint64_t)-1)
+      if (!assume_gnu && zero_seq_off != (uint64_t)-1)
        WARNING (PRI_ABBR": unnecessary padding with zero bytes.\n", zero_seq_off);
 
       if (SECTION_ENDS)