Message ID | CAEwic4bDd=-UUN8jwF2MGaJO4bj8iQTjdV7AXctXvtEYk13ZXQ@mail.gmail.com |
---|---|
State | New |
Headers | show |
On 09/27/2011 12:58 PM, Kai Tietz wrote: > +#ifdef HAVE_GAS_SECTION_EXCLUDE > + if ((flags & SECTION_EXCLUDE) != 0) > + *f++ = 'e'; > +#endif If 'e' is not supported, I wonder if we should emit 'n'? Otherwise ok. r~
2011/9/27 Richard Henderson <rth@redhat.com>: > On 09/27/2011 12:58 PM, Kai Tietz wrote: >> +#ifdef HAVE_GAS_SECTION_EXCLUDE >> + if ((flags & SECTION_EXCLUDE) != 0) >> + *f++ = 'e'; >> +#endif > > If 'e' is not supported, I wonder if we should emit 'n'? > > Otherwise ok. > > > r~ This sounds fair. At least we take care that section doesn't get loaded into memory. I adjust patch, retest it and then apply. Thanks, Kai
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