* config/tc-arm.h: Add definitions for OBJ_ELF.
[deliverable/binutils-gdb.git] / gas / config / tc-arm.h
1 /* This file is tc-arm.h
2 Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
3 Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
4 Modified by David Taylor (dtaylor@armltd.co.uk)
5
6 This file is part of GAS, the GNU Assembler.
7
8 GAS 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.
12
13 GAS 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.
17
18 You should have received a copy of the GNU General Public License
19 along with GAS; see the file COPYING. If not, write to the Free
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
21 02111-1307, USA. */
22
23 #define TC_ARM 1
24
25 #ifndef TARGET_BYTES_BIG_ENDIAN
26 #define TARGET_BYTES_BIG_ENDIAN 0
27 #endif
28
29 #define WORKING_DOT_WORD
30
31 #define COFF_MAGIC ARMMAGIC
32 #define TARGET_ARCH bfd_arch_arm
33
34 #define AOUT_MACHTYPE 0
35
36 #define DIFF_EXPR_OK
37
38 #ifdef LITTLE_ENDIAN
39 #undef LITTLE_ENDIAN
40 #endif
41 #ifdef BIG_ENDIAN
42 #undef BIG_ENDIAN
43 #endif
44
45 #define LITTLE_ENDIAN 1234
46 #define BIG_ENDIAN 4321
47
48 #ifdef OBJ_AOUT
49 #ifdef TE_RISCIX
50 #define TARGET_FORMAT "a.out-riscix"
51 #else
52 #define ARM_BI_ENDIAN
53 #define TARGET_FORMAT \
54 (target_big_endian ? "a.out-arm-big" : "a.out-arm-little")
55 #endif
56 #endif
57
58 #ifdef OBJ_AIF
59 #define TARGET_FORMAT "aif"
60 #endif
61
62 #ifdef OBJ_COFF
63 # define ARM_BI_ENDIAN
64 extern boolean arm_validate_fix ();
65 # define TC_VALIDATE_FIX(fixP,segType,Label) if (arm_validate_fix (fixP)) add_symbolP = fixP->fx_addsy
66 # ifdef TE_PE
67 # define TC_FORCE_RELOCATION(x) ((x)->fx_r_type==BFD_RELOC_RVA)
68 # define TARGET_FORMAT (target_big_endian ? "pe-arm-big" : "pe-arm-little")
69 # else
70 # define TARGET_FORMAT (target_big_endian ? "coff-arm-big" : "coff-arm-little")
71 /* Tell tc-arm.c to support runtime endian selection. */
72 # endif
73 #endif
74
75 /* start-sanitize-armelf */
76 #ifdef OBJ_ELF
77 extern boolean arm_validate_fix ();
78 #define TC_VALIDATE_FIX(fixP,segType,Label) if (arm_validate_fix (fixP)) add_symbolP = fixP->fx_addsy
79 #define ARM_BI_ENDIAN
80 #define TARGET_FORMAT (target_big_endian ? "elf32-bigarm" : "elf32-littlearm")
81 #endif
82 /* end-sanitize-armelf */
83
84 #define md_convert_frag(b,s,f) {as_fatal (_("arm convert_frag\n"));}
85
86 extern void arm_cleanup PARAMS ((void));
87 extern void arm_start_line_hook PARAMS ((void));
88 extern void arm_frob_label PARAMS ((struct symbol *));
89 #define md_cleanup() arm_cleanup ()
90 #define md_start_line_hook() arm_start_line_hook ()
91 #define tc_frob_label(S) arm_frob_label (S)
92 /* We also need to mark assembler created symbols: */
93 #define tc_frob_fake_label(S) arm_frob_label (S)
94 /* NOTE: The fake label creation in stabs.c:s_stab_generic() has
95 deliberately not been updated to mark assembler created stabs
96 symbols as Thumb. */
97
98 #define obj_fix_adjustable(fixP) 0
99
100 /* We need to keep some local information on symbols. */
101
102 #define TC_SYMFIELD_TYPE unsigned int
103 #define ARM_GET_FLAG(s) ((s)->sy_tc)
104 #define ARM_SET_FLAG(s,v) ((s)->sy_tc |= (v))
105 #define ARM_RESET_FLAG(s,v) ((s)->sy_tc &= ~(v))
106
107 #define ARM_FLAG_THUMB (1 << 0) /* The symbol is a Thumb symbol rather than an Arm symbol. */
108 #define ARM_FLAG_INTERWORK (1 << 1) /* The symbol is attached to code that suppports interworking. */
109 #define THUMB_FLAG_FUNC (1 << 2) /* The symbol is attached to the start of a Thumb function. */
110
111 #define ARM_IS_THUMB(s) (ARM_GET_FLAG (s) & ARM_FLAG_THUMB)
112 #define ARM_IS_INTERWORK(s) (ARM_GET_FLAG (s) & ARM_FLAG_INTERWORK)
113 #define THUMB_IS_FUNC(s) (ARM_GET_FLAG (s) & THUMB_FLAG_FUNC)
114
115 #define ARM_SET_THUMB(s,t) ((t) ? ARM_SET_FLAG (s, ARM_FLAG_THUMB) : ARM_RESET_FLAG (s, ARM_FLAG_THUMB))
116 #define ARM_SET_INTERWORK(s,t) ((t) ? ARM_SET_FLAG (s, ARM_FLAG_INTERWORK) : ARM_RESET_FLAG (s, ARM_FLAG_INTERWORK))
117 #define THUMB_SET_FUNC(s,t) ((t) ? ARM_SET_FLAG (s, THUMB_FLAG_FUNC) : ARM_RESET_FLAG (s, THUMB_FLAG_FUNC))
118
119
120 #define TC_FIX_TYPE PTR
121 #define TC_INIT_FIX_DATA(FIXP) ((FIXP)->tc_fix_data = NULL)
122
123 #define TC_START_LABEL(C,STR) \
124 (c == ':' || (c == '/' && arm_data_in_code ()))
125 int arm_data_in_code PARAMS ((void));
126
127 #define tc_canonicalize_symbol_name(str) \
128 arm_canonicalize_symbol_name (str);
129 char *arm_canonicalize_symbol_name PARAMS ((char *));
130
131 #if 0 /* It isn't as simple as this */
132 #define tc_frob_symbol(sym,punt) \
133 { if (S_IS_LOCAL (sym)) \
134 { \
135 punt = 1; \
136 sym->sy_used_in_reloc = 0; \
137 }}
138 #endif
139
140 /* Finish processing the entire symbol table: */
141 #define tc_adjust_symtab() arm_adjust_symtab ()
142 extern void arm_adjust_symtab PARAMS ((void));
143
144 #if 0
145 #define tc_crawl_symbol_chain(a) {;} /* not used */
146 #define tc_headers_hook(a) {;} /* not used */
147 #endif
148
149 #define tc_aout_pre_write_hook(x) {;} /* not used */
150
151 #define LISTING_HEADER "ARM GAS "
152
153 #define OPTIONAL_REGISTER_PREFIX '%'
154
155 #define md_operand(x)
156
157 #define TC_HANDLES_FX_DONE
158
159 #define MD_APPLY_FIX3
160
161 #define LOCAL_LABELS_FB 1
162
163 /* end of tc-arm.h */
This page took 0.044724 seconds and 5 git commands to generate.