Make default compression gABI compliant
[deliverable/binutils-gdb.git] / gas / as.c
index 781cf8b5476429e3b0054b3569adeff1852d4bd5..6fb28e97a836d4ca203e22917ded7a66021133b1 100644 (file)
--- a/gas/as.c
+++ b/gas/as.c
@@ -245,14 +245,12 @@ Options:\n\
 
   fprintf (stream, _("\
   --alternate             initially turn on alternate macro syntax\n"));
-#ifdef HAVE_ZLIB_H
   fprintf (stream, _("\
-  --compress-debug-sections\n\
+  --compress-debug-sections[={none|zlib|zlib-gnu|zlib-gabi}]\n\
                           compress DWARF debug sections using zlib\n"));
   fprintf (stream, _("\
   --nocompress-debug-sections\n\
                           don't compress DWARF debug sections\n"));
-#endif /* HAVE_ZLIB_H */
   fprintf (stream, _("\
   -D                      produce assembler debugging messages\n"));
   fprintf (stream, _("\
@@ -286,6 +284,8 @@ Options:\n\
   fprintf (stream, _("\
   --size-check=[error|warning]\n\
                          ELF .size directive check (default --size-check=error)\n"));
+  fprintf (stream, _("\
+  --sectname-subst        enable section name substitution sequences\n"));
 #endif
   fprintf (stream, _("\
   -f                      skip whitespace and comment preprocessing\n"));
@@ -449,6 +449,7 @@ parse_args (int * pargc, char *** pargv)
       OPTION_EXECSTACK,
       OPTION_NOEXECSTACK,
       OPTION_SIZE_CHECK,
+      OPTION_SECTNAME_SUBST,
       OPTION_ALTERNATE,
       OPTION_AL,
       OPTION_HASH_TABLE_SIZE,
@@ -473,7 +474,7 @@ parse_args (int * pargc, char *** pargv)
     ,{"a", optional_argument, NULL, 'a'}
     /* Handle -al=<FILE>.  */
     ,{"al", optional_argument, NULL, OPTION_AL}
-    ,{"compress-debug-sections", no_argument, NULL, OPTION_COMPRESS_DEBUG}
+    ,{"compress-debug-sections", optional_argument, NULL, OPTION_COMPRESS_DEBUG}
     ,{"nocompress-debug-sections", no_argument, NULL, OPTION_NOCOMPRESS_DEBUG}
     ,{"debug-prefix-map", required_argument, NULL, OPTION_DEBUG_PREFIX_MAP}
     ,{"defsym", required_argument, NULL, OPTION_DEFSYM}
@@ -483,6 +484,7 @@ parse_args (int * pargc, char *** pargv)
     ,{"execstack", no_argument, NULL, OPTION_EXECSTACK}
     ,{"noexecstack", no_argument, NULL, OPTION_NOEXECSTACK}
     ,{"size-check", required_argument, NULL, OPTION_SIZE_CHECK}
+    ,{"sectname-subst", no_argument, NULL, OPTION_SECTNAME_SUBST}
 #endif
     ,{"fatal-warnings", no_argument, NULL, OPTION_WARN_FATAL}
     ,{"gdwarf-2", no_argument, NULL, OPTION_GDWARF2}
@@ -626,7 +628,7 @@ parse_args (int * pargc, char *** pargv)
        case OPTION_VERSION:
          /* This output is intended to follow the GNU standards document.  */
          printf (_("GNU assembler %s\n"), BFD_VERSION_STRING);
-         printf (_("Copyright (C) 2014-2015 Free Software Foundation, Inc.\n"));
+         printf (_("Copyright (C) 2015 Free Software Foundation, Inc.\n"));
          printf (_("\
 This program is free software; you may redistribute it under the terms of\n\
 the GNU General Public License version 3 or later.\n\
@@ -657,15 +659,31 @@ This program has absolutely no warranty.\n"));
          exit (EXIT_SUCCESS);
 
        case OPTION_COMPRESS_DEBUG:
-#ifdef HAVE_ZLIB_H
-         flag_compress_debug = 1;
+         if (optarg)
+           {
+#if defined OBJ_ELF || defined OBJ_MAYBE_ELF
+             if (strcasecmp (optarg, "none") == 0)
+               flag_compress_debug = COMPRESS_DEBUG_NONE;
+             else if (strcasecmp (optarg, "zlib") == 0)
+               flag_compress_debug = COMPRESS_DEBUG_GABI_ZLIB;
+             else if (strcasecmp (optarg, "zlib-gnu") == 0)
+               flag_compress_debug = COMPRESS_DEBUG_GNU_ZLIB;
+             else if (strcasecmp (optarg, "zlib-gabi") == 0)
+               flag_compress_debug = COMPRESS_DEBUG_GABI_ZLIB;
+             else
+               as_fatal (_("Invalid --compress-debug-sections option: `%s'"),
+                         optarg);
 #else
-         as_warn (_("cannot compress debug sections (zlib not installed)"));
-#endif /* HAVE_ZLIB_H */
+             as_fatal (_("--compress-debug-sections=%s is unsupported"),
+                       optarg);
+#endif
+           }
+         else
+           flag_compress_debug = COMPRESS_DEBUG_GABI_ZLIB;
          break;
 
        case OPTION_NOCOMPRESS_DEBUG:
-         flag_compress_debug = 0;
+         flag_compress_debug = COMPRESS_DEBUG_NONE;
          break;
 
        case OPTION_DEBUG_PREFIX_MAP:
@@ -834,6 +852,10 @@ This program has absolutely no warranty.\n"));
          else
            as_fatal (_("Invalid --size-check= option: `%s'"), optarg);
          break;
+
+       case OPTION_SECTNAME_SUBST:
+         flag_sectname_subst = 1;
+         break;
 #endif
        case 'Z':
          flag_always_generate_output = 1;
This page took 0.028125 seconds and 4 git commands to generate.