Initial revision
[official-gcc.git] / gcc / config / rs6000 / aix3newas.h
blob9659794d7c89fd3a9fb6c11fe7373eabb0510b8a
1 /* Definitions of target machine for GNU compiler,
2 for IBM RS/6000 POWER running AIX version 3.x with the fixed assembler.
3 Copyright (C) 1995, 1996 Free Software Foundation, Inc.
4 Contributed by Jason Merrill (jason@cygnus.com).
6 This file is part of GNU CC.
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
24 /* Enable AIX XL compiler calling convention breakage compatibility. */
25 #define MASK_XL_CALL 0x40000000
26 #define TARGET_XL_CALL (target_flags & MASK_XL_CALL)
27 #undef SUBTARGET_SWITCHES
28 #define SUBTARGET_SWITCHES \
29 {"xl-call", MASK_XL_CALL}, \
30 {"no-xl-call", - MASK_XL_CALL},
32 #include "rs6000/rs6000.h"
34 /* Tell the assembler to assume that all undefined names are external. */
36 #undef ASM_SPEC
37 #define ASM_SPEC "-u %(asm_cpu)"
39 #undef ASM_DEFAULT_SPEC
40 #define ASM_DEFAULT_SPEC "-mpwr"
42 /* Define the options for the binder: Start text at 512, align all segments
43 to 512 bytes, and warn if there is text relocation.
45 The -bhalt:4 option supposedly changes the level at which ld will abort,
46 but it also suppresses warnings about multiply defined symbols and is
47 used by the AIX cc command. So we use it here.
49 -bnodelcsect undoes a poor choice of default relating to multiply-defined
50 csects. See AIX documentation for more information about this.
52 -bM:SRE tells the linker that the output file is Shared REusable. Note
53 that to actually build a shared library you will also need to specify an
54 export list with the -Wl,-bE option.
56 If -mcpu=common, export the architecture dependent multiply/divide routines
57 as per README.RS6000. */
59 #undef LINK_SPEC
60 #ifndef CROSS_COMPILE
61 #define LINK_SPEC "-T512 -H512 %{!r:-btextro} -bhalt:4 -bnodelcsect\
62 %{static:-bnso -bI:/lib/syscalls.exp} \
63 %{mcpu=common: milli.exp%s} \
64 %{!shared:%{g*:-bexport:/usr/lib/libg.exp}} %{shared:-bM:SRE}"
65 #else
66 #define LINK_SPEC "-T512 -H512 %{!r:-btextro} -bhalt:4 -bnodelcsect\
67 %{static:-bnso} \
68 %{mcpu=common: milli.exp%s} \
69 %{shared:-bM:SRE}"
70 #endif
72 /* These are not necessary when we pass -u to the assembler, and undefining
73 them saves a great deal of space in object files. */
75 #undef ASM_OUTPUT_EXTERNAL
76 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
77 #define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
78 { rtx _symref = XEXP (DECL_RTL (DECL), 0); \
79 if ((TREE_CODE (DECL) == VAR_DECL \
80 || TREE_CODE (DECL) == FUNCTION_DECL) \
81 && (NAME)[strlen (NAME) - 1] != ']') \
82 { \
83 char *_name = (char *) permalloc (strlen (XSTR (_symref, 0)) + 5); \
84 strcpy (_name, XSTR (_symref, 0)); \
85 strcat (_name, TREE_CODE (DECL) == FUNCTION_DECL ? "[DS]" : "[RW]"); \
86 XSTR (_symref, 0) = _name; \
87 } \