summaryrefslogtreecommitdiff
path: root/gcc/config/pa/som.h
diff options
context:
space:
mode:
authordanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-15 05:10:57 +0000
committerdanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-15 05:10:57 +0000
commit2455c36bf85189a56aa9161a997b71f40282d779 (patch)
treee8baa9d18aa0f3809f95d03f1a1736703aaf70e5 /gcc/config/pa/som.h
parentc231e334dff662a02f18c1fc3443b9cf0b73d1b5 (diff)
downloadgcc-2455c36bf85189a56aa9161a997b71f40282d779.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92177 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/pa/som.h')
-rw-r--r--gcc/config/pa/som.h27
1 files changed, 23 insertions, 4 deletions
diff --git a/gcc/config/pa/som.h b/gcc/config/pa/som.h
index ac01ca1de4f..96dc2a9077f 100644
--- a/gcc/config/pa/som.h
+++ b/gcc/config/pa/som.h
@@ -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.