summaryrefslogtreecommitdiff
path: root/gcc/config/pa/som.h
diff options
context:
space:
mode:
authordanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-16 00:34:45 +0000
committerdanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-16 00:34:45 +0000
commit45fc02af8ecc7c7415976692e7cb48a42f094b11 (patch)
tree2cb9964dd1c8c5cce2af849f133edc3faab40ab1 /gcc/config/pa/som.h
parentb1ca781a0ecf73b7d921dd831bd5e2273992cfe6 (diff)
downloadgcc-45fc02af8ecc7c7415976692e7cb48a42f094b11.tar.gz
* som.h (SUPPORTS_WEAK, SUPPORTS_ONE_ONLY, MAKE_DECL_ONE_ONLY,
ASM_WEAKEN_LABEL, GTHREAD_USE_WEAK): Define. * pa.h (TARGET_SOM_SDEF): Define. * pa-hpux11.h (TARGET_SOM_SDEF): Define. * config/os/hpux/os_defines.h (_GLIBCPP_GTHREAD_USE_WEAK): Define for __hppa__. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61372 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/pa/som.h')
-rw-r--r--gcc/config/pa/som.h51
1 files changed, 50 insertions, 1 deletions
diff --git a/gcc/config/pa/som.h b/gcc/config/pa/som.h
index aa509bd08c7..577a67ea31e 100644
--- a/gcc/config/pa/som.h
+++ b/gcc/config/pa/som.h
@@ -1,5 +1,5 @@
/* Definitions for SOM assembler support.
- Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -371,3 +371,52 @@ do { \
/* Aggregates with a single float or double field should be passed and
returned in the general registers. */
#define MEMBER_TYPE_FORCES_BLK(FIELD, MODE) (MODE==SFmode || MODE==DFmode)
+
+/* If GAS supports weak, we can support weak when we have working linker
+ support for secondary definitions and are generating code for GAS. */
+#ifdef HAVE_GAS_WEAK
+#define SUPPORTS_WEAK (TARGET_SOM_SDEF && TARGET_GAS)
+#else
+#define SUPPORTS_WEAK 0
+#endif
+
+/* We can support one only if we support weak. */
+#define SUPPORTS_ONE_ONLY SUPPORTS_WEAK
+
+/* Use weak (secondary definitions) to make one only declarations. */
+#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+
+/* This is how we tell the assembler that a symbol is weak. The SOM
+ weak implementation uses the secondary definition (sdef) flag.
+
+ The behavior of sdef symbols is similar to ELF weak symbols in that
+ multiple definitions can occur without incurring a link error.
+ However, they differ in the following ways:
+ 1) Undefined sdef symbols are not allowed.
+ 2) The linker searches for undefined sdef symbols and will load an
+ archive library member to resolve an undefined sdef symbol.
+ 3) The exported symbol from a shared library is a primary symbol
+ rather than a sdef symbol. Thus, more care is needed in the
+ ordering of libraries.
+
+ It appears that the linker discards extra copies of "weak" functions
+ when linking shared libraries, independent of whether or not they
+ are in their own section. In linking final executables, -Wl,-O can
+ be used to remove dead procedures. Thus, support for named sections
+ is not needed and in previous testing caused problems with various
+ HP tools. */
+#define ASM_WEAKEN_LABEL(FILE,NAME) \
+ do { fputs ("\t.weak\t", FILE); \
+ assemble_name (FILE, NAME); \
+ fputc ('\n', FILE); \
+ if (! FUNCTION_NAME_P (NAME)) \
+ { \
+ fputs ("\t.EXPORT ", FILE); \
+ assemble_name (FILE, NAME); \
+ fputs (",DATA\n", FILE); \
+ } \
+ } while (0)
+
+/* We can't handle weak aliases, and therefore can't support pragma weak.
+ Suppress the use of pragma weak in gthr-dce.h and gthr-posix.h. */
+#define GTHREAD_USE_WEAK 0