]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/darwin-sections.def
re PR c++/46904 (g++.dg/tree-prof/(indir-call-prof.C|inline_mismatch_args.C) fail...
[thirdparty/gcc.git] / gcc / config / darwin-sections.def
1 /* Copyright (C) 2005, 2006, 2010 Free Software Foundation, Inc.
2
3 This file is part of GCC.
4
5 GCC is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free
7 Software Foundation; either version 3, or (at your option) any later
8 version.
9
10 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with GCC; see the file COPYING3. If not see
17 <http://www.gnu.org/licenses/>. */
18
19 /* Since Darwin's ld will not allow zero-sized objects, and gcc wants them,
20 we emit one byte (in darwin.c) when such an object is encountered.
21
22 This messes up section anchoring because the emitted byte is not counted
23 outside the port. To cope with this, we set aside sections for zero-sized
24 objects and disallow those sections from participating in section anchors
25 ("zobj_" sections, below).
26
27 Items that might be coalesced by the linker are prevented from participating,
28 (and those in mergeable sections are disallowed in varasm.c). */
29
30 /* .text handled in varasm.c */
31 DEF_SECTION (text_coal_section, SECTION_CODE|SECTION_NO_ANCHOR,
32 ".section __TEXT,__textcoal_nt,coalesced,pure_instructions", 0)
33 DEF_SECTION (text_unlikely_coal_section, SECTION_CODE|SECTION_NO_ANCHOR,
34 ".section __TEXT,__text_unlikely_coal,"
35 "coalesced,pure_instructions", 0)
36
37 DEF_SECTION (text_hot_section, SECTION_CODE,
38 ".section __TEXT,__text_hot,regular,pure_instructions", 0)
39 DEF_SECTION (text_cold_section, SECTION_CODE,
40 ".section __TEXT,__text_cold,regular,pure_instructions", 0)
41 DEF_SECTION (text_startup_section, SECTION_CODE,
42 ".section __TEXT,__text_startup,regular,pure_instructions", 0)
43 DEF_SECTION (text_exit_section, SECTION_CODE,
44 ".section __TEXT,__text_exit,regular,pure_instructions", 0)
45
46 DEF_SECTION (text_hot_coal_section, SECTION_CODE,
47 ".section __TEXT,__text_hot_coal,coalesced,pure_instructions", 0)
48 DEF_SECTION (text_cold_coal_section, SECTION_CODE,
49 ".section __TEXT,__text_cold_coal,coalesced,pure_instructions", 0)
50 DEF_SECTION (text_startup_coal_section, SECTION_CODE,
51 ".section __TEXT,__text_stt_coal,coalesced,pure_instructions", 0)
52 DEF_SECTION (text_exit_coal_section, SECTION_CODE,
53 ".section __TEXT,__text_exit_coal,coalesced,pure_instructions", 0)
54
55 /* const */
56 DEF_SECTION (const_section, 0, ".const", 0)
57 DEF_SECTION (const_coal_section, SECTION_NO_ANCHOR,
58 ".section __TEXT,__const_coal,coalesced", 0)
59 /* Place to put zero-sized to avoid issues with section anchors. */
60 DEF_SECTION (zobj_const_section, SECTION_NO_ANCHOR,
61 ".section\t__DATA,__zobj_const", 0)
62
63 /* Write-able data. '.data' handled in varasm.c */
64 DEF_SECTION (static_data_section, SECTION_WRITE, ".static_data", 0)
65 DEF_SECTION (data_coal_section, SECTION_WRITE|SECTION_NO_ANCHOR,
66 ".section __DATA,__datacoal_nt,coalesced", 0)
67 /* Place to put zero-sized to avoid issues with section anchors. */
68 DEF_SECTION (zobj_data_section, SECTION_WRITE|SECTION_NO_ANCHOR,
69 ".section\t__DATA,__zobj_data", 0)
70
71 /* BSS - .lcomm / .zerofill __DATA,__bss sections cannot be switched to
72 explicitly (will create an assembler error). */
73 DEF_SECTION (zobj_bss_section, SECTION_WRITE|SECTION_BSS|SECTION_NO_ANCHOR,
74 ".section\t__DATA,__zobj_bss", 0)
75
76 /* const data */
77 DEF_SECTION (const_data_section, 0, ".const_data", 0)
78 DEF_SECTION (const_data_coal_section, SECTION_NO_ANCHOR,
79 ".section __DATA,__const_coal,coalesced", 0)
80 /* Place to put zero-sized to avoid issues with section anchors. */
81 DEF_SECTION (zobj_const_data_section, SECTION_NO_ANCHOR,
82 ".section\t__DATA,__zobj_const_data", 0)
83
84 /* Strings and other literals. */
85 DEF_SECTION (cstring_section, SECTION_MERGE | SECTION_STRINGS, ".cstring", 0)
86 DEF_SECTION (literal4_section, SECTION_MERGE, ".literal4", 0)
87 DEF_SECTION (literal8_section, SECTION_MERGE, ".literal8", 0)
88 DEF_SECTION (literal16_section, SECTION_MERGE, ".literal16", 0)
89 /* Unlike constant NSStrings, constant CFStrings do not live in the
90 __OBJC segment since they may also occur in pure C or C++ programs. */
91 DEF_SECTION (cfstring_constant_object_section, 0,
92 ".section __DATA, __cfstring", 0)
93
94 /* Module init, term, constructors & destructors. */
95 DEF_SECTION (mod_init_section, 0, ".mod_init_func", 0)
96 DEF_SECTION (mod_term_section, 0, ".mod_term_func", 0)
97 DEF_SECTION (constructor_section, 0, ".constructor", 0)
98 DEF_SECTION (destructor_section, 0, ".destructor", 0)
99
100 /* Objective-C (V1) sections. */
101 DEF_SECTION (objc_class_section, 0, ".objc_class", 1)
102 DEF_SECTION (objc_meta_class_section, 0, ".objc_meta_class", 1)
103 DEF_SECTION (objc_category_section, 0, ".objc_category", 1)
104 DEF_SECTION (objc_class_vars_section, 0, ".objc_class_vars", 1)
105 DEF_SECTION (objc_instance_vars_section, 0, ".objc_instance_vars", 1)
106 DEF_SECTION (objc_cls_meth_section, 0, ".objc_cls_meth", 1)
107 DEF_SECTION (objc_inst_meth_section, 0, ".objc_inst_meth", 1)
108 DEF_SECTION (objc_cat_cls_meth_section, 0, ".objc_cat_cls_meth", 1)
109 DEF_SECTION (objc_cat_inst_meth_section, 0, ".objc_cat_inst_meth", 1)
110 DEF_SECTION (objc_selector_refs_section, SECTION_MERGE, ".objc_message_refs", 1)
111 DEF_SECTION (objc_selector_fixup_section, 0,
112 ".section __OBJC, __sel_fixup, regular, no_dead_strip", 1)
113 DEF_SECTION (objc_symbols_section, 0, ".objc_symbols", 1)
114 DEF_SECTION (objc_module_info_section, 0, ".objc_module_info", 1)
115 DEF_SECTION (objc_protocol_section, 0, ".objc_protocol", 1)
116 DEF_SECTION (objc_string_object_section, 0, ".objc_string_object", 1)
117 DEF_SECTION (objc_constant_string_object_section, 0,
118 ".section __OBJC, __cstring_object, regular, no_dead_strip", 1)
119
120 /* Fix-and-Continue image marker. */
121 DEF_SECTION (objc_image_info_section, 0,
122 ".section __OBJC, __image_info, regular, no_dead_strip", 1)
123 DEF_SECTION (objc_class_names_section, 0, ".objc_class_names", 1)
124 DEF_SECTION (objc_meth_var_names_section, 0, ".objc_meth_var_names", 1)
125 DEF_SECTION (objc_meth_var_types_section, 0, ".objc_meth_var_types", 1)
126 DEF_SECTION (objc_cls_refs_section, SECTION_MERGE, ".objc_cls_refs", 1)
127
128 /* Stubs and symbol indirection sections. */
129 /* lazy symbol pointers. */
130 DEF_SECTION (machopic_lazy_symbol_ptr_section, SECTION_NO_ANCHOR,
131 ".lazy_symbol_pointer", 0)
132 DEF_SECTION (machopic_lazy_symbol_ptr2_section, SECTION_NO_ANCHOR,
133 ".section __DATA, __la_sym_ptr2,lazy_symbol_pointers", 0)
134 DEF_SECTION (machopic_lazy_symbol_ptr3_section, SECTION_NO_ANCHOR,
135 ".section __DATA, __la_sym_ptr3,lazy_symbol_pointers", 0)
136 /* non-lazy symbol pointers. */
137 DEF_SECTION (machopic_nl_symbol_ptr_section, SECTION_NO_ANCHOR,
138 MACHOPIC_NL_SYMBOL_PTR_SECTION, 0)
139 /* Symbol stubs. */
140 DEF_SECTION (machopic_symbol_stub_section, SECTION_NO_ANCHOR,
141 ".symbol_stub", 0)
142 DEF_SECTION (machopic_symbol_stub1_section, SECTION_NO_ANCHOR,
143 ".section __TEXT,__symbol_stub1,symbol_stubs,"
144 "pure_instructions,16", 0)
145 /* PIC symbol stubs. */
146 DEF_SECTION (machopic_picsymbol_stub_section, SECTION_NO_ANCHOR,
147 ".picsymbol_stub", 0)
148 DEF_SECTION (machopic_picsymbol_stub1_section, SECTION_NO_ANCHOR,
149 ".section __TEXT,__picsymbolstub1,symbol_stubs,"
150 "pure_instructions,32", 0)
151 DEF_SECTION (machopic_picsymbol_stub2_section, SECTION_NO_ANCHOR,
152 ".section __TEXT,__picsymbolstub2,symbol_stubs,pure_instructions,25", 0)
153 DEF_SECTION (machopic_picsymbol_stub3_section, SECTION_NO_ANCHOR,
154 ".section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5", 0)
155
156 /* Exception-related. */
157 DEF_SECTION (darwin_exception_section, SECTION_NO_ANCHOR,
158 ".section __DATA,__gcc_except_tab", 0)
159 DEF_SECTION (darwin_eh_frame_section, SECTION_NO_ANCHOR,
160 ".section " EH_FRAME_SECTION_NAME ",__eh_frame"
161 EH_FRAME_SECTION_ATTR, 0)