Commit | Line | Data |
---|---|---|
e57f8c65 | 1 | /* Mach-O object file format for gas, the assembler. |
68588f95 | 2 | Copyright 2009, 2011, 2012 Free Software Foundation, Inc. |
e57f8c65 TG |
3 | |
4 | This file is part of GAS, the GNU Assembler. | |
5 | ||
6 | GAS is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License as | |
8 | published by the Free Software Foundation; either version 3, | |
9 | or (at your option) any later version. | |
10 | ||
11 | GAS is distributed in the hope that it will be useful, but | |
12 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See | |
14 | the GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with GAS; see the file COPYING. If not, write to the Free | |
18 | Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA | |
19 | 02110-1301, USA. */ | |
20 | ||
a4551119 TG |
21 | #ifndef _OBJ_MACH_O_H |
22 | #define _OBJ_MACH_O_H | |
23 | ||
e57f8c65 TG |
24 | /* Tag to validate Mach-O object file format processing */ |
25 | #define OBJ_MACH_O 1 | |
26 | ||
a4551119 TG |
27 | #include "bfd/mach-o.h" |
28 | ||
e57f8c65 TG |
29 | #include "targ-cpu.h" |
30 | ||
31 | #define OUTPUT_FLAVOR bfd_target_mach_o_flavour | |
32 | ||
bcf0aac6 IS |
33 | /* We want to control how the sections are pre-defined on startup. */ |
34 | #define obj_begin() mach_o_begin () | |
35 | extern void mach_o_begin (void); | |
36 | ||
a4551119 TG |
37 | /* All our align expressions are power of two. */ |
38 | #define USE_ALIGN_PTWO | |
39 | ||
40 | /* Common symbols can carry alignment information. */ | |
41 | #ifndef S_SET_ALIGN | |
42 | #define S_SET_ALIGN(S,V) do {\ | |
b22161d6 IS |
43 | bfd_mach_o_asymbol *___s = (bfd_mach_o_asymbol *) symbol_get_bfdsym (S);\ |
44 | ___s->n_desc = (___s->n_desc & 0xf0ff) | (((V) & 0x0f) << 8);\ | |
a4551119 TG |
45 | } while (0) |
46 | #endif | |
47 | ||
e57f8c65 TG |
48 | extern const pseudo_typeS mach_o_pseudo_table[]; |
49 | ||
50 | #ifndef obj_pop_insert | |
51 | #define obj_pop_insert() pop_insert (mach_o_pseudo_table) | |
52 | #endif | |
53 | ||
54 | #define obj_sec_sym_ok_for_reloc(SEC) 1 | |
55 | ||
56 | #define obj_read_begin_hook() {;} | |
57 | #define obj_symbol_new_hook(s) {;} | |
58 | ||
b22161d6 IS |
59 | #define obj_frob_label(s) obj_macho_frob_label(s) |
60 | extern void obj_macho_frob_label (struct symbol *); | |
61 | ||
62 | #define obj_frob_symbol(s, punt) punt = obj_macho_frob_symbol(s) | |
63 | extern int obj_macho_frob_symbol (struct symbol *); | |
64 | ||
c3402d20 IS |
65 | #define md_post_relax_hook obj_mach_o_post_relax_hook() |
66 | void obj_mach_o_post_relax_hook (void); | |
67 | ||
50d10658 IS |
68 | #define obj_frob_file_after_relocs obj_mach_o_frob_file_after_relocs |
69 | extern void obj_mach_o_frob_file_after_relocs (void); | |
70 | ||
34dd18bc IS |
71 | void obj_mach_o_reorder_section_relocs (asection *, arelent **, unsigned int); |
72 | ||
73 | #define SET_SECTION_RELOCS(sec, relocs, n) \ | |
74 | obj_mach_o_reorder_section_relocs (sec, relocs, n) | |
75 | ||
854ac8ba IS |
76 | /* Emit relocs for local subtracts, to cater for subsections-via-symbols. */ |
77 | #define md_allow_local_subtract(LEFT, RIGHT, SECTION) \ | |
78 | obj_mach_o_allow_local_subtract (LEFT, RIGHT, SECTION) | |
79 | extern int obj_mach_o_allow_local_subtract (expressionS *, expressionS *, | |
80 | segT); | |
81 | ||
e57f8c65 | 82 | #define EMIT_SECTION_SYMBOLS 0 |
a4551119 | 83 | |
68588f95 IS |
84 | #define OBJ_PROCESS_STAB(SEG,W,S,T,O,D) obj_mach_o_process_stab(W,S,T,O,D) |
85 | extern void obj_mach_o_process_stab (int, const char *,int, int, int); | |
86 | ||
a4551119 | 87 | #endif /* _OBJ_MACH_O_H */ |