Hi,

this patch enables same feature as in thread "[google] Add
SECTION_EXCLUDE flag and exclude .gnu.callgraph sections
(issue5126041)" for pe-coff x86 and x64 targets.

ChangeLog

2011-09-27  Kai Tietz  <kti...@redhat.com>

        * configure.ac: Add test for new section attribute
        specifier "e" via define HAVE_GAS_SECTION_EXCLUDE.
        * config.in: Regenerated.
        * configure: Regenerated.
        * config/i386/winnt.c (i386_pe_asm_named_section): Emit
        new section flag "e" for excluded sections, if supported.

Tested for x86_64-w64-mingw32, i686-w64-mingw32, and i686-pc-cygwin.
Ok for apply?

Index: gcc/gcc/config/i386/winnt.c
===================================================================
--- gcc.orig/gcc/config/i386/winnt.c
+++ gcc/gcc/config/i386/winnt.c
@@ -484,6 +484,11 @@ i386_pe_asm_named_section (const char *n
 {
   char flagchars[8], *f = flagchars;

+#ifdef HAVE_GAS_SECTION_EXCLUDE
+  if ((flags & SECTION_EXCLUDE) != 0)
+    *f++ = 'e';
+#endif
+
   if ((flags & (SECTION_CODE | SECTION_WRITE)) == 0)
     /* readonly data */
     {
Index: gcc/gcc/configure.ac
===================================================================
--- gcc.orig/gcc/configure.ac
+++ gcc/gcc/configure.ac
@@ -3553,6 +3553,15 @@ foo:     nop
              ;;
          esac
        fi
+       # 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],,
+[.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.])
        ;;
     esac

Reply via email to