summaryrefslogtreecommitdiffstats
path: root/gcc/config/rs6000/aix31.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/rs6000/aix31.h')
-rw-r--r--gcc/config/rs6000/aix31.h41
1 files changed, 40 insertions, 1 deletions
diff --git a/gcc/config/rs6000/aix31.h b/gcc/config/rs6000/aix31.h
index 46bd03c38fb..34d3628e8bd 100644
--- a/gcc/config/rs6000/aix31.h
+++ b/gcc/config/rs6000/aix31.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler,
for IBM RS/6000 running AIX version 3.1.
- Copyright (C) 1993,1997 Free Software Foundation, Inc.
+ Copyright (C) 1993,1997, 2000 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@nyu.edu)
This file is part of GNU CC.
@@ -22,6 +22,45 @@ Boston, MA 02111-1307, USA. */
#include "rs6000/rs6000.h"
+#include "rs6000/aix.h"
+
+/* Output something to declare an external symbol to the assembler. Most
+ assemblers don't need this.
+
+ If we haven't already, add "[RW]" (or "[DS]" for a function) to the
+ name. Normally we write this out along with the name. In the few cases
+ where we can't, it gets stripped off. */
+
+#undef ASM_OUTPUT_EXTERNAL
+#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
+{ rtx _symref = XEXP (DECL_RTL (DECL), 0); \
+ if ((TREE_CODE (DECL) == VAR_DECL \
+ || TREE_CODE (DECL) == FUNCTION_DECL) \
+ && (NAME)[strlen (NAME) - 1] != ']') \
+ { \
+ char *_name = (char *) permalloc (strlen (XSTR (_symref, 0)) + 5); \
+ strcpy (_name, XSTR (_symref, 0)); \
+ strcat (_name, TREE_CODE (DECL) == FUNCTION_DECL ? "[DS]" : "[RW]"); \
+ XSTR (_symref, 0) = _name; \
+ } \
+ fputs ("\t.extern ", FILE); \
+ assemble_name (FILE, XSTR (_symref, 0)); \
+ if (TREE_CODE (DECL) == FUNCTION_DECL) \
+ { \
+ fputs ("\n\t.extern .", FILE); \
+ RS6000_OUTPUT_BASENAME (FILE, XSTR (_symref, 0)); \
+ } \
+ putc ('\n', FILE); \
+}
+
+/* Similar, but for libcall. We only have to worry about the function name,
+ not that of the descriptor. */
+
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
+{ fputs ("\t.extern .", FILE); \
+ assemble_name (FILE, XSTR (FUN, 0)); \
+ putc ('\n', FILE); \
+}
/* AIX 3.2 defined _AIX32, but older versions do not. */
#undef CPP_PREDEFINES
OpenPOWER on IntegriCloud