1 /* tc-ppc.h -- Header file for tc-ppc.c.
2 Copyright (C) 1994 Free Software Foundation, Inc.
3 Written by Ian Lance Taylor, Cygnus Support.
5 This file is part of GAS, the GNU Assembler.
7 GAS is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 GAS is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GAS; see the file COPYING. If not, write to
19 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
24 #error PowerPC support requires BFD_ASSEMBLER
27 /* The target BFD architecture. */
28 #define TARGET_ARCH (ppc_arch ())
29 extern enum bfd_architecture ppc_arch
PARAMS ((void));
31 /* The target BFD format. */
33 #define TARGET_FORMAT "aixcoff-rs6000"
36 #define TARGET_FORMAT "elf32-powerpc"
39 /* Permit temporary numeric labels. */
40 #define LOCAL_LABELS_FB
42 /* $ is used to refer to the current location. */
45 /* Strings do not use backslash escapes. */
46 #define NO_STRING_ESCAPES
49 /* When using COFF, we determine whether or not to output a symbol
50 based on sy_tc.output, not on the name. */
51 #define LOCAL_LABEL(name) 0
54 /* When using ELF, local labels start with '.'. */
55 #define LOCAL_LABEL(name) (name[0] == '.' \
56 && (name[1] == 'L' || name[1] == '.'))
57 #define FAKE_LABEL_NAME ".L0\001"
60 /* Set the endianness we are using. Default to big endian. */
61 #ifndef TARGET_BYTES_BIG_ENDIAN
62 #ifndef TARGET_BYTES_LITTLE_ENDIAN
63 #define TARGET_BYTES_BIG_ENDIAN
67 #ifdef TARGET_BYTES_BIG_ENDIAN
68 #define PPC_BIG_ENDIAN 1
70 #define PPC_BIG_ENDIAN 0
73 /* We don't need to handle .word strangely. */
74 #define WORKING_DOT_WORD
76 /* We set the fx_done field appropriately in md_apply_fix. */
77 #define TC_HANDLES_FX_DONE
81 /* Declarations needed when generating XCOFF code. XCOFF is an
82 extension of COFF, used only on the RS/6000. Rather than create an
83 obj-xcoff, we just use obj-coff, and handle the extensions here in
86 /* We need to keep some information for symbols. */
89 /* We keep a few linked lists of symbols. */
91 /* Non-zero if the symbol should be output. The RS/6000 assembler
92 only outputs symbols that are external or are mentioned in a
93 .globl or .lglobl statement. */
95 /* The symbol class. */
97 /* The real name, if the symbol was renamed. */
99 /* For a csect symbol, the subsegment we are using. This is zero
100 for symbols that are not csects. */
102 /* For a csect or common symbol, the alignment to use. */
104 /* For a function symbol, a symbol whose value is the size. The
105 field is NULL if there is no size. */
107 /* For a csect symbol, the last symbol which has been defined in
108 this csect, or NULL if none have been defined so far. For a .bs
109 symbol, the referenced csect symbol. */
110 struct symbol
*within
;
113 #define TC_SYMFIELD_TYPE struct ppc_tc_sy
115 /* We need an additional auxent for function symbols. */
116 #define OBJ_COFF_MAX_AUXENTRIES 2
118 /* Square and curly brackets are permitted in symbol names. */
121 /* Canonicalize the symbol name. */
122 #define tc_canonicalize_symbol_name(name) ppc_canonicalize_symbol_name (name)
123 extern char *ppc_canonicalize_symbol_name
PARAMS ((char *));
125 /* Get the symbol class from the name. */
126 #define tc_symbol_new_hook(sym) ppc_symbol_new_hook (sym)
127 extern void ppc_symbol_new_hook
PARAMS ((struct symbol
*));
129 /* Set the symbol class of a label based on the csect. */
130 #define tc_frob_label(sym) ppc_frob_label (sym)
131 extern void ppc_frob_label
PARAMS ((struct symbol
*));
133 /* TOC relocs requires special handling. */
134 #define tc_fix_adjustable(fixp) ppc_fix_adjustable (fixp)
135 extern int ppc_fix_adjustable
PARAMS ((struct fix
*));
137 /* We need to set the section VMA. */
138 #define tc_frob_section(sec) ppc_frob_section (sec)
139 extern void ppc_frob_section
PARAMS ((asection
*));
141 /* Finish up the symbol. */
142 #define tc_frob_symbol(sym, punt) punt = ppc_frob_symbol (sym)
143 extern int ppc_frob_symbol
PARAMS ((struct symbol
*));
145 /* Finish up the file. */
146 #define tc_frob_file() ppc_frob_file ()
147 extern void ppc_frob_file
PARAMS ((void));
149 #endif /* OBJ_COFF */
152 /* The name of the global offset table generated by the compiler. Allow
153 this to be overridden if need be. */
154 #ifndef GLOBAL_OFFSET_TABLE_NAME
155 #define GLOBAL_OFFSET_TABLE_NAME "_GLOBAL_OFFSET_TABLE_"