# HG changeset patch
# Parent 2c8ad65d830fdf48991fa8f278e5d0d896120b86
Support Solaris as SHF_EXCLUDE flag syntax
@@ -45240,6 +45240,15 @@ i386_solaris_elf_named_section (const ch
solaris_elf_asm_comdat_section (name, flags, decl);
return;
}
+
+ /* Solaris/x86 as uses the same syntax for the SHF_EXCLUDE flags as the
+ SPARC assembler. One cannot mix single-letter flags and #exclude, so
+ only emit the latter here. */
+ if (flags & SECTION_EXCLUDE)
+ {
+ fprintf (asm_out_file, "\t.section\t%s,#exclude\n", name);
+ return;
+ }
#endif
default_elf_asm_named_section (name, flags, decl);
@@ -10502,6 +10502,10 @@ sparc_solaris_elf_asm_named_section (con
if (!(flags & SECTION_DEBUG))
fputs (",#alloc", asm_out_file);
+#if HAVE_GAS_SECTION_EXCLUDE
+ if (flags & SECTION_EXCLUDE)
+ fputs (",#exclude", asm_out_file);
+#endif
if (flags & SECTION_WRITE)
fputs (",#write", asm_out_file);
if (flags & SECTION_TLS)
@@ -2953,6 +2953,34 @@ if test $gcc_cv_as_eh_frame = buggy; the
[Define if your assembler mis-optimizes .eh_frame data.])
fi
+# Test if the assembler supports the section flag 'e' or #exclude for
+# specifying an excluded section.
+gcc_GAS_CHECK_FEATURE([section exclude flag], gcc_cv_as_section_exclude_e,
+ [2,22,51], [--fatal-warnings],
+ [.section foo1,"e"
+ .byte 0,0,0,0])
+if test $gcc_cv_as_section_exclude_e = no; then
+ case "${target}" in
+ # Solaris as uses #exclude instead.
+ *-*-solaris2*)
+ case "${target}" in
+ sparc*-*-solaris2*)
+ conftest_s='.section "foo1", #exclude'
+ ;;
+ i?86-*-solaris2* | x86_64-*-solaris2*)
+ conftest_s='.section foo1, #exclude'
+ ;;
+ esac
+ ;;
+ esac
+ gcc_GAS_CHECK_FEATURE([section exclude flag], gcc_cv_as_section_exclude_hash,,,
+ [$conftest_s
+ .byte 0,0,0,0])
+fi
+AC_DEFINE_UNQUOTED(HAVE_GAS_SECTION_EXCLUDE,
+ [`if test $gcc_cv_as_section_exclude_e = yes || test $gcc_cv_as_section_exclude_hash = yes; then echo 1; else echo 0; fi`],
+[Define if your assembler supports specifying the exclude section flag.])
+
gcc_GAS_CHECK_FEATURE(section merging support, gcc_cv_as_shf_merge,
[elf,2,12,0], [--fatal-warnings],
[.section .rodata.str, "aMS", @progbits, 1])
@@ -4202,16 +4230,6 @@ foo: nop
[AC_DEFINE(HAVE_AS_XBRACE_COMMENT_OPTION, 1,
[Define if your assembler supports -xbrace_comment option.])])
- # Test if the assembler supports the section flag 'e' for specifying
- # an excluded section.
- gcc_GAS_CHECK_FEATURE([.section with e], gcc_cv_as_section_has_e,
- [2,22,51], [--fatal-warnings],
-[.section foo1,"e"
-.byte 0,0,0,0])
- AC_DEFINE_UNQUOTED(HAVE_GAS_SECTION_EXCLUDE,
- [`if test $gcc_cv_as_section_has_e = yes; then echo 1; else echo 0; fi`],
- [Define if your assembler supports specifying the section flag e.])
-
gcc_GAS_CHECK_FEATURE([filds and fists mnemonics],
gcc_cv_as_ix86_filds,,,
[filds (%ebp); fists (%ebp)],,
@@ -6427,7 +6427,7 @@ default_elf_asm_named_section (const cha
{
if (!(flags & SECTION_DEBUG))
*f++ = 'a';
-#if defined (HAVE_GAS_SECTION_EXCLUDE) && HAVE_GAS_SECTION_EXCLUDE == 1
+#if HAVE_GAS_SECTION_EXCLUDE
if (flags & SECTION_EXCLUDE)
*f++ = 'e';
#endif