diff options
author | Roger Sayle <roger@eyesopen.com> | 2006-11-02 00:56:38 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2006-11-02 00:56:38 +0000 |
commit | 68b92f787e534dd1a1fff4e239fdf9e9f6aeb88c (patch) | |
tree | b4c4ef2e2161d7f7ffc787b9cd387863c9bd470c /gcc | |
parent | fc354c12ad2ca565b7c45ef7493b43ae85d14f36 (diff) | |
download | gcc-68b92f787e534dd1a1fff4e239fdf9e9f6aeb88c.zip gcc-68b92f787e534dd1a1fff4e239fdf9e9f6aeb88c.tar.gz gcc-68b92f787e534dd1a1fff4e239fdf9e9f6aeb88c.tar.bz2 |
configure.ac (HAVE_AS_IX86_DIFF_SECT_DELTA): New test to determine whether the assembler supports taking the difference of...
* configure.ac (HAVE_AS_IX86_DIFF_SECT_DELTA): New test to determine
whether the assembler supports taking the difference of symbols in
different sections. On x86/Solaris, GAS does but Solaris as doesn't.
* configure: Regenerate.
* config.in: Regenerate.
* config/i386/sol2-10.h (JUMP_TABLES_IN_TEXT_SECTION): Define if
the assembler doesn't support taking the difference of symbols in
different sections, i.e. we're using the native solaris assembler.
From-SVN: r118405
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/config.in | 7 | ||||
-rw-r--r-- | gcc/config/i386/sol2-10.h | 10 | ||||
-rwxr-xr-x | gcc/configure | 39 | ||||
-rw-r--r-- | gcc/configure.ac | 12 |
5 files changed, 78 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e3a2435..65fdde0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2006-11-01 Roger Sayle <roger@eyesopen.com> + + * configure.ac (HAVE_AS_IX86_DIFF_SECT_DELTA): New test to determine + whether the assembler supports taking the difference of symbols in + different sections. On x86/Solaris, GAS does but Solaris as doesn't. + * configure: Regenerate. + * config.in: Regenerate. + * config/i386/sol2-10.h (JUMP_TABLES_IN_TEXT_SECTION): Define if + the assembler doesn't support taking the difference of symbols in + different sections, i.e. we're using the native solaris assembler. + 2006-11-01 Pete Steinmetz <steinmtz@us.ibm.com> Peter Bergner <bergner@vnet.ibm.com> diff --git a/gcc/config.in b/gcc/config.in index 0f5f011..a8e18bc 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -203,6 +203,13 @@ #endif +/* Define if your assembler supports the subtraction of symbols in different + sections. */ +#ifndef USED_FOR_TARGET +#undef HAVE_AS_IX86_DIFF_SECT_DELTA +#endif + + /* Define if your assembler supports the ffreep mnemonic. */ #ifndef USED_FOR_TARGET #undef HAVE_AS_IX86_FFREEP diff --git a/gcc/config/i386/sol2-10.h b/gcc/config/i386/sol2-10.h index af51b4c..587e56f 100644 --- a/gcc/config/i386/sol2-10.h +++ b/gcc/config/i386/sol2-10.h @@ -1,5 +1,5 @@ /* Solaris 10 configuration. - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2006 Free Software Foundation, Inc. Contributed by CodeSourcery, LLC. This file is part of GCC. @@ -34,6 +34,14 @@ Boston, MA 02110-1301, USA. */ "-s %(asm_cpu)" #endif +/* The native Solaris assembler can't calculate the difference between + symbols in different sections, which causes problems for -fPIC jump + tables in .rodata. */ +#ifndef HAVE_AS_IX86_DIFF_SECT_DELTA +#undef JUMP_TABLES_IN_TEXT_SECTION +#define JUMP_TABLES_IN_TEXT_SECTION 1 +#endif + #undef NO_PROFILE_COUNTERS #undef MCOUNT_NAME diff --git a/gcc/configure b/gcc/configure index 2e2b0bc..582e37b 100755 --- a/gcc/configure +++ b/gcc/configure @@ -15253,6 +15253,45 @@ _ACEOF fi + echo "$as_me:$LINENO: checking assembler for different section symbol subtraction" >&5 +echo $ECHO_N "checking assembler for different section symbol subtraction... $ECHO_C" >&6 +if test "${gcc_cv_as_ix86_diff_sect_delta+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + gcc_cv_as_ix86_diff_sect_delta=no + if test x$gcc_cv_as != x; then + echo '.section .rodata +.L1: + .long .L2-.L1 + .long .L3-.L1 + .text +.L3: nop +.L2: nop' > conftest.s + if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } + then + gcc_cv_as_ix86_diff_sect_delta=yes + else + echo "configure: failed program was" >&5 + cat conftest.s >&5 + fi + rm -f conftest.o conftest.s + fi +fi +echo "$as_me:$LINENO: result: $gcc_cv_as_ix86_diff_sect_delta" >&5 +echo "${ECHO_T}$gcc_cv_as_ix86_diff_sect_delta" >&6 +if test $gcc_cv_as_ix86_diff_sect_delta = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_AS_IX86_DIFF_SECT_DELTA 1 +_ACEOF + +fi + # This one is used unconditionally by i386.[ch]; it is to be defined # to 1 if the feature is present, 0 otherwise. echo "$as_me:$LINENO: checking assembler for GOTOFF in data" >&5 diff --git a/gcc/configure.ac b/gcc/configure.ac index fca9fed..b089f60 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -2850,6 +2850,18 @@ foo: nop [AC_DEFINE(HAVE_AS_IX86_FFREEP, 1, [Define if your assembler supports the ffreep mnemonic.])]) + gcc_GAS_CHECK_FEATURE([different section symbol subtraction], + gcc_cv_as_ix86_diff_sect_delta,,, + [.section .rodata +.L1: + .long .L2-.L1 + .long .L3-.L1 + .text +.L3: nop +.L2: nop],, + [AC_DEFINE(HAVE_AS_IX86_DIFF_SECT_DELTA, 1, + [Define if your assembler supports the subtraction of symbols in different sections.])]) + # This one is used unconditionally by i386.[ch]; it is to be defined # to 1 if the feature is present, 0 otherwise. gcc_GAS_CHECK_FEATURE([GOTOFF in data], |