Commit e41f3691 by John David Anglin Committed by John David Anglin

re PR c++/17242 (Testsuite fails due to duplicate symbols)

	PR c++/17242
	* configure.ac: Add GAS check for HP-UX .nsubspa comdat.
	* configure, config.in: Rebuilt.
	* config/pa/pa-hpux10.h (SUPPORTS_ONE_ONLY, MAKE_DECL_ONE_ONLY): Delete
	defines.
	* config/pa/pa.c (pa_select_section): Allow uninitialized variables in
	one-only (comdat) subspaces.
	* config/pa/som.h (SUPPORTS_SOM_COMDAT): New define.
	(SUPPORTS_ONE_ONLY): True if SUPPORTS_WEAK or SUPPORTS_SOM_COMDAT are
	true.
	(MAKE_DECL_ONE_ONLY): Place uninitialized variables in common.

From-SVN: r92177
parent 6b25a558
2004-12-14 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR c++/17242
* configure.ac: Add GAS check for HP-UX .nsubspa comdat.
* configure, config.in: Rebuilt.
* config/pa/pa-hpux10.h (SUPPORTS_ONE_ONLY, MAKE_DECL_ONE_ONLY): Delete
defines.
* config/pa/pa.c (pa_select_section): Allow uninitialized variables in
one-only (comdat) subspaces.
* config/pa/som.h (SUPPORTS_SOM_COMDAT): New define.
(SUPPORTS_ONE_ONLY): True if SUPPORTS_WEAK or SUPPORTS_SOM_COMDAT are
true.
(MAKE_DECL_ONE_ONLY): Place uninitialized variables in common.
2004-12-14 Ian Lance Taylor <ian@wasabisystems.com>
* combine.c (combine_validate_cost): Consider cost of
......
......@@ -297,6 +297,9 @@
skip when using the GAS .p2align command. */
#undef HAVE_GAS_MAX_SKIP_P2ALIGN
/* Define if your assembler supports .nsubspa comdat option. */
#undef HAVE_GAS_NSUBSPA_COMDAT
/* Define if your assembler and linker support 32-bit section relative relocs
via '.secrel32 label'. */
#undef HAVE_GAS_PE_SECREL32_RELOC
......
......@@ -147,10 +147,3 @@ Boston, MA 02111-1307, USA. */
better than the assembler shipped with older versions of hpux. */
#undef NEW_HP_ASSEMBLER
#define NEW_HP_ASSEMBLER 1
/* CVS GAS as of 4/28/04 supports a comdat parameter for the .nsubspa
directive. This provides one only linkage semantics even though we
don't have weak support. */
#undef SUPPORTS_ONE_ONLY
#define SUPPORTS_ONE_ONLY (TARGET_GAS)
#undef MAKE_DECL_ONE_ONLY
......@@ -9350,8 +9350,7 @@ pa_select_section (tree exp, int reloc,
else if (TARGET_SOM
&& TREE_CODE (exp) == VAR_DECL
&& DECL_ONE_ONLY (exp)
&& !DECL_WEAK (exp)
&& DECL_INITIAL (exp))
&& !DECL_WEAK (exp))
som_one_only_data_section ();
else
data_section ();
......
......@@ -311,11 +311,30 @@ do { \
#define SUPPORTS_WEAK 0
#endif
/* We can support one only if we support weak. */
#define SUPPORTS_ONE_ONLY SUPPORTS_WEAK
/* CVS GAS as of 4/28/04 supports a comdat parameter for the .nsubspa
directive. This provides one-only linkage semantics even though we
don't have weak support. */
#ifdef HAVE_GAS_NSUBSPA_COMDAT
#define SUPPORTS_SOM_COMDAT (TARGET_GAS)
#else
#define SUPPORTS_SOM_COMDAT 0
#endif
/* Use weak (secondary definitions) to make one only declarations. */
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
/* We can support one only if we support weak or comdat. */
#define SUPPORTS_ONE_ONLY (SUPPORTS_WEAK || SUPPORTS_SOM_COMDAT)
/* We use DECL_COMMON for uninitialized one-only variables as we don't
have linkonce .bss. We use SOM secondary definitions or comdat for
initialized variables and functions. */
#define MAKE_DECL_ONE_ONLY(DECL) \
do { \
if (TREE_CODE (DECL) == VAR_DECL \
&& (DECL_INITIAL (DECL) == 0 \
|| DECL_INITIAL (DECL) == error_mark_node)) \
DECL_COMMON (DECL) = 1; \
else if (SUPPORTS_WEAK) \
DECL_WEAK (DECL) = 1; \
} while (0)
/* This is how we tell the assembler that a symbol is weak. The SOM
weak implementation uses the secondary definition (sdef) flag.
......
......@@ -13212,6 +13212,44 @@ _ACEOF
fi
echo "$as_me:$LINENO: checking assembler for .nsubspa comdat" >&5
echo $ECHO_N "checking assembler for .nsubspa comdat... $ECHO_C" >&6
if test "${gcc_cv_as_nsubspa_comdat+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
gcc_cv_as_nsubspa_comdat=no
if test $in_tree_gas = yes; then
if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 15 \) \* 1000 + 91`
then gcc_cv_as_nsubspa_comdat=yes
fi
elif test x$gcc_cv_as != x; then
echo ' .SPACE $TEXT$
.NSUBSPA $CODE$,COMDAT' > 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_nsubspa_comdat=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_nsubspa_comdat" >&5
echo "${ECHO_T}$gcc_cv_as_nsubspa_comdat" >&6
if test $gcc_cv_as_nsubspa_comdat = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_GAS_NSUBSPA_COMDAT 1
_ACEOF
fi
# .hidden needs to be supported in both the assembler and the linker,
# because GNU LD versions before 2.12.1 have buggy support for STV_HIDDEN.
# This is irritatingly difficult to feature test for; we have to check the
......
......@@ -2047,6 +2047,12 @@ gcc_GAS_CHECK_FEATURE([.weak], gcc_cv_as_weak,
[ .weak foobar],,
[AC_DEFINE(HAVE_GAS_WEAK, 1, [Define if your assembler supports .weak.])])
gcc_GAS_CHECK_FEATURE([.nsubspa comdat], gcc_cv_as_nsubspa_comdat,
[2,15,91],,
[ .SPACE $TEXT$
.NSUBSPA $CODE$,COMDAT],,
[AC_DEFINE(HAVE_GAS_NSUBSPA_COMDAT, 1, [Define if your assembler supports .nsubspa comdat option.])])
# .hidden needs to be supported in both the assembler and the linker,
# because GNU LD versions before 2.12.1 have buggy support for STV_HIDDEN.
# This is irritatingly difficult to feature test for; we have to check the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment