/* as.c - GAS main program.
- Copyright (C) 1987-2014 Free Software Foundation, Inc.
+ Copyright (C) 1987-2015 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
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, _("\
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"));
OPTION_EXECSTACK,
OPTION_NOEXECSTACK,
OPTION_SIZE_CHECK,
+ OPTION_SECTNAME_SUBST,
OPTION_ALTERNATE,
OPTION_AL,
OPTION_HASH_TABLE_SIZE,
,{"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}
,{"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}
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 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\
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:
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;
read_a_source_file ("");
}
\f
-#ifdef OBJ_ELF
-static void
-create_obj_attrs_section (void)
-{
- segT s;
- char *p;
- offsetT size;
- const char *name;
-
- size = bfd_elf_obj_attr_size (stdoutput);
- if (size)
- {
- name = get_elf_backend_data (stdoutput)->obj_attrs_section;
- if (!name)
- name = ".gnu.attributes";
- s = subseg_new (name, 0);
- elf_section_type (s)
- = get_elf_backend_data (stdoutput)->obj_attrs_section_type;
- bfd_set_section_flags (stdoutput, s, SEC_READONLY | SEC_DATA);
- frag_now_fix ();
- p = frag_more (size);
- bfd_elf_set_obj_attr_contents (stdoutput, (bfd_byte *)p, size);
- }
-}
-#endif
-\f
int
main (int argc, char ** argv)
md_end ();
#endif
-#ifdef OBJ_ELF
- if (IS_ELF)
- create_obj_attrs_section ();
-#endif
-
#if defined OBJ_ELF || defined OBJ_MAYBE_ELF
if ((flag_execstack || flag_noexecstack)
&& OUTPUT_FLAVOR == bfd_target_elf_flavour)