diff options
author | Kai Tietz <ktietz@redhat.com> | 2011-09-28 10:07:39 +0200 |
---|---|---|
committer | Kai Tietz <ktietz@gcc.gnu.org> | 2011-09-28 10:07:39 +0200 |
commit | 08c71c82b8b1ea89b092f06bb2e84dc40ad3cd2f (patch) | |
tree | 54fa8e39315a2300568c6f1addebf0270867b3ce /gcc | |
parent | 5e3a0ed1a7e8d1c08052cb5939fb86529623cab9 (diff) | |
download | gcc-08c71c82b8b1ea89b092f06bb2e84dc40ad3cd2f.zip gcc-08c71c82b8b1ea89b092f06bb2e84dc40ad3cd2f.tar.gz gcc-08c71c82b8b1ea89b092f06bb2e84dc40ad3cd2f.tar.bz2 |
configure.ac: Add test for new section attribute specifier "e" via define...
* 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.
Otherwise we mark section withc SECTION_EXCLUDE flag
as never-load.
From-SVN: r179308
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/config.in | 6 | ||||
-rw-r--r-- | gcc/config/i386/winnt.c | 11 | ||||
-rwxr-xr-x | gcc/configure | 38 | ||||
-rw-r--r-- | gcc/configure.ac | 9 |
5 files changed, 75 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 25f5ca8..417ba5b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2011-09-28 Kai Tietz <ktietz@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. + Otherwise we mark section withc SECTION_EXCLUDE flag + as never-load. + 2011-09-28 Richard Sandiford <rdsandiford@googlemail.com> * config/m32r/m32r.md: Use match_test rather than eq/ne symbol_ref diff --git a/gcc/config.in b/gcc/config.in index d9b9805..f2847d8 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -1015,6 +1015,12 @@ #endif +/* Define if your assembler supports specifying the section flag e. */ +#ifndef USED_FOR_TARGET +#undef HAVE_GAS_SECTION_EXCLUDE +#endif + + /* Define 0/1 if your assembler supports marking sections with SHF_MERGE flag. */ #ifndef USED_FOR_TARGET diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c index 8e7043f..af3f975 100644 --- a/gcc/config/i386/winnt.c +++ b/gcc/config/i386/winnt.c @@ -484,6 +484,11 @@ i386_pe_asm_named_section (const char *name, unsigned int flags, { char flagchars[8], *f = flagchars; +#if defined (HAVE_GAS_SECTION_EXCLUDE) && HAVE_GAS_SECTION_EXCLUDE == 1 + if ((flags & SECTION_EXCLUDE) != 0) + *f++ = 'e'; +#endif + if ((flags & (SECTION_CODE | SECTION_WRITE)) == 0) /* readonly data */ { @@ -498,6 +503,12 @@ i386_pe_asm_named_section (const char *name, unsigned int flags, *f++ = 'w'; if (flags & SECTION_PE_SHARED) *f++ = 's'; +#if !defined (HAVE_GAS_SECTION_EXCLUDE) || HAVE_GAS_SECTION_EXCLUDE == 0 + /* If attribute "e" isn't supported we mark this section as + never-load. */ + if ((flags & SECTION_EXCLUDE) != 0) + *f++ = 'n'; +#endif } /* LTO sections need 1-byte alignment to avoid confusing the diff --git a/gcc/configure b/gcc/configure index c183881..e067f38 100755 --- a/gcc/configure +++ b/gcc/configure @@ -24232,6 +24232,44 @@ $as_echo "$as_me: WARNING: LTO for $target requires binutils >= 2.20.1, but vers ;; esac fi + # Test if the assembler supports the section flag 'e' for specifying + # an excluded section. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .section with e" >&5 +$as_echo_n "checking assembler for .section with e... " >&6; } +if test "${gcc_cv_as_section_has_e+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + gcc_cv_as_section_has_e=no + if test $in_tree_gas = yes; then + if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 22 \) \* 1000 + 51` + then gcc_cv_as_section_has_e=yes +fi + elif test x$gcc_cv_as != x; then + $as_echo '.section foo1,"e" +.byte 0,0,0,0' > conftest.s + if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then + gcc_cv_as_section_has_e=yes + else + echo "configure: failed program was" >&5 + cat conftest.s >&5 + fi + rm -f conftest.o conftest.s + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_section_has_e" >&5 +$as_echo "$gcc_cv_as_section_has_e" >&6; } + + +cat >>confdefs.h <<_ACEOF +#define HAVE_GAS_SECTION_EXCLUDE `if test $gcc_cv_as_section_has_e = yes; then echo 1; else echo 0; fi` +_ACEOF + ;; esac diff --git a/gcc/configure.ac b/gcc/configure.ac index 8069e6a..3df77c3 100644 --- a/gcc/configure.ac +++ b/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 |