From 1a9c54a35da528ea0ed834cd8303b31767be0c1f Mon Sep 17 00:00:00 2001 From: rsandifo Date: Sat, 16 Jan 2010 12:14:09 +0000 Subject: [PATCH] gcc/ * configure.ac (HAVE_AS_REF): New C macro. * configure: Regenerate. * config.in: Likewise. * collect2.c (main): Only postpone SCAN_DWEH to the second pass if HAVE_AS_REF. * config/rs6000/aix.h (ASM_OUTPUT_DWARF_TABLE_REF): Only define if HAVE_AS_REF. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155961 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 10 ++++++++++ gcc/collect2.c | 7 +++++-- gcc/config.in | 6 ++++++ gcc/config/rs6000/aix.h | 2 ++ gcc/configure | 44 ++++++++++++++++++++++++++++++++++++++++++++ gcc/configure.ac | 15 +++++++++++++++ 6 files changed, 82 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 85e0dae..7d3889e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2010-01-16 Richard Sandiford + + * configure.ac (HAVE_AS_REF): New C macro. + * configure: Regenerate. + * config.in: Likewise. + * collect2.c (main): Only postpone SCAN_DWEH to the second pass + if HAVE_AS_REF. + * config/rs6000/aix.h (ASM_OUTPUT_DWARF_TABLE_REF): Only define + if HAVE_AS_REF. + 2010-01-16 Joern Rennecke * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. diff --git a/gcc/collect2.c b/gcc/collect2.c index 777510b..914015f 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -1677,8 +1677,11 @@ main (int argc, char **argv) control whether we need a first pass link later on or not, and what will remain to be scanned there. */ - scanfilter this_filter - = shared_obj ? ld1_filter : (ld1_filter & ~SCAN_DWEH); + scanfilter this_filter = ld1_filter; +#if HAVE_AS_REF + if (!shared_obj) + this_filter &= ~SCAN_DWEH; +#endif while (export_object_lst < object) scan_prog_file (*export_object_lst++, PASS_OBJ, this_filter); diff --git a/gcc/config.in b/gcc/config.in index 1686be9..a3744f9 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -393,6 +393,12 @@ #endif +/* Define if your assembler supports .ref */ +#ifndef USED_FOR_TARGET +#undef HAVE_AS_REF +#endif + + /* Define if your assembler supports .register. */ #ifndef USED_FOR_TARGET #undef HAVE_AS_REGISTER_PSEUDO_OP diff --git a/gcc/config/rs6000/aix.h b/gcc/config/rs6000/aix.h index 4676110..380b0b8 100644 --- a/gcc/config/rs6000/aix.h +++ b/gcc/config/rs6000/aix.h @@ -43,11 +43,13 @@ collect has a chance to see them, so scan the object files directly. */ #define COLLECT_EXPORT_LIST +#if HAVE_AS_REF /* Issue assembly directives that create a reference to the given DWARF table identifier label from the current function section. This is defined to ensure we drag frame frame tables associated with needed function bodies in a link with garbage collection activated. */ #define ASM_OUTPUT_DWARF_TABLE_REF rs6000_aix_asm_output_dwarf_table_ref +#endif /* Handle #pragma weak and #pragma pack. */ #define HANDLE_SYSV_PRAGMA 1 diff --git a/gcc/configure b/gcc/configure index c150ee0..d6c8dc4 100755 --- a/gcc/configure +++ b/gcc/configure @@ -23630,6 +23630,50 @@ if test $gcc_cv_as_powerpc_tls_markers = yes; then $as_echo "#define HAVE_AS_TLS_MARKERS 1" >>confdefs.h fi + + case $target in + *-*-aix*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .ref support" >&5 +$as_echo_n "checking assembler for .ref support... " >&6; } +if test "${gcc_cv_as_aix_ref+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + gcc_cv_as_aix_ref=no + if test $in_tree_gas = yes; then + if test $gcc_cv_gas_vers -ge `expr \( \( 2.21.0 \* 1000 \) + gcc_cv_as_aix_ref=yes \) \* 1000 + ` + then : +fi + elif test x$gcc_cv_as != x; then + echo ' .csect stuff[rw] + stuff: + .long 1 + .extern sym + .ref sym + ' > 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_aix_ref=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_aix_ref" >&5 +$as_echo "$gcc_cv_as_aix_ref" >&6; } +if test $gcc_cv_as_aix_ref = yes; then + +$as_echo "#define HAVE_AS_REF 1" >>confdefs.h + +fi + ;; + esac ;; mips*-*-*) diff --git a/gcc/configure.ac b/gcc/configure.ac index e5d9baf..6247d32 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -3326,6 +3326,21 @@ LCF0: [ bl __tls_get_addr(x@tlsgd)],, [AC_DEFINE(HAVE_AS_TLS_MARKERS, 1, [Define if your assembler supports arg info for __tls_get_addr.])]) + + case $target in + *-*-aix*) + gcc_GAS_CHECK_FEATURE([.ref support], + gcc_cv_as_aix_ref, [2.21.0],, + [ .csect stuff[[rw]] + stuff: + .long 1 + .extern sym + .ref sym + ],, + [AC_DEFINE(HAVE_AS_REF, 1, + [Define if your assembler supports .ref])]) + ;; + esac ;; mips*-*-*) -- 2.7.4