82a184107bb37ba9193e2f6bf3b7b329c263d210
[deliverable/binutils-gdb.git] / gas / config / tc-ppc.h
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.
4
5 This file is part of GAS, the GNU Assembler.
6
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)
10 any later version.
11
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.
16
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. */
20
21 #define TC_PPC
22
23 #ifndef BFD_ASSEMBLER
24 #error PowerPC support requires BFD_ASSEMBLER
25 #endif
26
27 /* The target BFD architecture. */
28 #define TARGET_ARCH (ppc_arch ())
29 extern enum bfd_architecture ppc_arch PARAMS ((void));
30
31 /* The target BFD format. */
32 #ifdef OBJ_COFF
33 #define TARGET_FORMAT "aixcoff-rs6000"
34 #endif
35 #ifdef OBJ_ELF
36 #define TARGET_FORMAT "elf32-powerpc"
37 #endif
38
39 /* Permit temporary numeric labels. */
40 #define LOCAL_LABELS_FB
41
42 /* $ is used to refer to the current location. */
43 #define DOLLAR_DOT
44
45 /* Strings do not use backslash escapes. */
46 #define NO_STRING_ESCAPES
47
48 #ifdef OBJ_COFF
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
52 #endif
53 #ifdef OBJ_ELF
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"
58 #endif
59
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
64 #endif
65 #endif
66
67 #ifdef TARGET_BYTES_BIG_ENDIAN
68 #define PPC_BIG_ENDIAN 1
69 #else
70 #define PPC_BIG_ENDIAN 0
71 #endif
72
73 /* We don't need to handle .word strangely. */
74 #define WORKING_DOT_WORD
75
76 /* We set the fx_done field appropriately in md_apply_fix. */
77 #define TC_HANDLES_FX_DONE
78 \f
79 #ifdef OBJ_COFF
80
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
84 tc-ppc. */
85
86 /* We need to keep some information for symbols. */
87 struct ppc_tc_sy
88 {
89 /* We keep a few linked lists of symbols. */
90 struct symbol *next;
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. */
94 int output;
95 /* The symbol class. */
96 int class;
97 /* The real name, if the symbol was renamed. */
98 char *real_name;
99 /* For a csect symbol, the subsegment we are using. This is zero
100 for symbols that are not csects. */
101 subsegT subseg;
102 /* For a csect or common symbol, the alignment to use. */
103 int align;
104 /* For a function symbol, a symbol whose value is the size. The
105 field is NULL if there is no size. */
106 struct symbol *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;
111 };
112
113 #define TC_SYMFIELD_TYPE struct ppc_tc_sy
114
115 /* We need an additional auxent for function symbols. */
116 #define OBJ_COFF_MAX_AUXENTRIES 2
117
118 /* Square and curly brackets are permitted in symbol names. */
119 #define LEX_BR 3
120
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 *));
124
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 *));
128
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 *));
132
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 *));
136
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 *));
140
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 *));
144
145 /* Finish up the file. */
146 #define tc_frob_file() ppc_frob_file ()
147 extern void ppc_frob_file PARAMS ((void));
148
149 #endif /* OBJ_COFF */
150
151 #ifdef OBJ_ELF
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_"
156 #endif
157 #endif
This page took 0.044585 seconds and 4 git commands to generate.