]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/config/darwin-sections.def
Update copyright years.
[thirdparty/gcc.git] / gcc / config / darwin-sections.def
index d6151977744f678b6a5ec5b25ee81dd74eb49660..b46d3468796db460d985df03d06b5e9f4a7fba17 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2024 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -17,7 +17,7 @@ along with GCC; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */
 
 /* Since Darwin's ld will not allow zero-sized objects, and gcc wants them,
-   we emit one byte (in darwin.c) when such an object is encountered.
+   we emit one byte (in darwin.cc) when such an object is encountered.
 
    This messes up section anchoring because the emitted byte is not counted
    outside the port.  To cope with this, we set aside sections for zero-sized
@@ -25,14 +25,16 @@ along with GCC; see the file COPYING3.  If not see
    ("zobj_" sections, below).
    
    Items that might be coalesced by the linker are prevented from participating,
-   (and those in mergeable sections are disallowed in varasm.c).  */
+   (and those in mergeable sections are disallowed in varasm.cc).  */
 
-/* .text handled in varasm.c  */
+/* The .text section is generated in varasm.cc  */
 DEF_SECTION (text_coal_section, SECTION_CODE|SECTION_NO_ANCHOR,
             ".section __TEXT,__textcoal_nt,coalesced,pure_instructions", 0)
-DEF_SECTION (text_unlikely_coal_section, SECTION_CODE|SECTION_NO_ANCHOR,
-            ".section __TEXT,__text_unlikely_coal,"
-            "coalesced,pure_instructions", 0)
+
+/* We define a picbase thunks section separately, so that we can override the
+   def to be '.text' for versions of ld64 that handle coalescing.  */
+DEF_SECTION (picbase_thunk_section, SECTION_CODE|SECTION_NO_ANCHOR,
+            ".section __TEXT,__textcoal_nt,coalesced,pure_instructions", 0)
 
 DEF_SECTION (text_hot_section, SECTION_CODE,
             ".section __TEXT,__text_hot,regular,pure_instructions", 0)
@@ -60,7 +62,7 @@ DEF_SECTION (const_coal_section, SECTION_NO_ANCHOR,
 DEF_SECTION (zobj_const_section, SECTION_NO_ANCHOR, 
             ".section\t__DATA,__zobj_const", 0)
 
-/* Write-able data.  '.data'  handled in varasm.c  */
+/* Write-able data.  '.data'  handled in varasm.cc  */
 DEF_SECTION (static_data_section, SECTION_WRITE, ".static_data", 0)
 DEF_SECTION (data_coal_section, SECTION_WRITE|SECTION_NO_ANCHOR,
             ".section __DATA,__datacoal_nt,coalesced", 0)
@@ -79,7 +81,7 @@ DEF_SECTION (const_data_coal_section, SECTION_NO_ANCHOR,
             ".section __DATA,__const_coal,coalesced", 0)
 /* Place to put zero-sized to avoid issues with section anchors.  */
 DEF_SECTION (zobj_const_data_section, SECTION_NO_ANCHOR, 
-            ".section\t__DATA,__zobj_const_data", 0)
+            ".section\t__DATA,__zobj_cnst_data", 0)
 
 /* Strings and other literals.  */
 DEF_SECTION (cstring_section, SECTION_MERGE | SECTION_STRINGS, ".cstring", 0)
@@ -96,8 +98,10 @@ DEF_SECTION (mod_init_section, 0, ".mod_init_func", 0)
 DEF_SECTION (mod_term_section, 0, ".mod_term_func", 0)
 DEF_SECTION (constructor_section, 0, ".constructor", 0)
 DEF_SECTION (destructor_section, 0, ".destructor", 0)
+DEF_SECTION (static_init_section, SECTION_CODE,
+            ".section\t__TEXT,__StaticInit,regular,pure_instructions", 0)
 
-/* Objective-C (V1) sections.  */
+/* Objective-C ABI=0 (Original version) sections.  */
 DEF_SECTION (objc_class_section, 0, ".objc_class", 1)
 DEF_SECTION (objc_meta_class_section, 0, ".objc_meta_class", 1)
 DEF_SECTION (objc_category_section, 0, ".objc_category", 1)
@@ -115,7 +119,7 @@ DEF_SECTION (objc_module_info_section, 0, ".objc_module_info", 1)
 DEF_SECTION (objc_protocol_section, 0, ".objc_protocol", 1)
 DEF_SECTION (objc_string_object_section, 0, ".objc_string_object", 1)
 DEF_SECTION (objc_constant_string_object_section, 0,
-            ".section __OBJC, __cstring_object, regular, no_dead_strip", 1)
+            ".section __OBJC, __cstring_object, regular, no_dead_strip", 0)
 
 /* Fix-and-Continue image marker.  */
 DEF_SECTION (objc_image_info_section, 0,
@@ -155,7 +159,59 @@ DEF_SECTION (machopic_picsymbol_stub3_section, SECTION_NO_ANCHOR,
 
 /* Exception-related.  */
 DEF_SECTION (darwin_exception_section, SECTION_NO_ANCHOR,
-            ".section __DATA,__gcc_except_tab", 0)
+            ".section __TEXT,__gcc_except_tab", 0)
 DEF_SECTION (darwin_eh_frame_section, SECTION_NO_ANCHOR,
             ".section " EH_FRAME_SECTION_NAME ",__eh_frame"
             EH_FRAME_SECTION_ATTR, 0)
+
+/* Sections for ObjC ABI=1 (ObjC 'V1' extensions) */
+DEF_SECTION (objc1_class_ext_section, 0,
+           ".section __OBJC, __class_ext, regular, no_dead_strip", 1)
+DEF_SECTION (objc1_prop_list_section, 0,
+           ".section __OBJC, __property, regular, no_dead_strip", 1)
+DEF_SECTION (objc1_protocol_ext_section, 0,
+           ".section __OBJC, __protocol_ext, regular, no_dead_strip", 1)
+
+/* Sections for ObjC ABI=2 (m64).  */
+DEF_SECTION (objc2_message_refs_section, 0,
+            ".section __DATA, __objc_msgrefs, regular, no_dead_strip", 1)
+DEF_SECTION (objc2_classdefs_section, 0, ".section __DATA, __objc_data", 1)
+DEF_SECTION (objc2_metadata_section, 0, ".section __DATA, __objc_const", 1)
+
+DEF_SECTION (objc2_classrefs_section, 0, 
+             ".section __DATA, __objc_classrefs, regular, no_dead_strip", 1)
+DEF_SECTION (objc2_classlist_section, 0,
+            ".section __DATA, __objc_classlist, regular, no_dead_strip", 1)
+DEF_SECTION (objc2_categorylist_section, 0,
+            ".section __DATA, __objc_catlist, regular, no_dead_strip", 1)
+DEF_SECTION (objc2_selector_refs_section, 0,
+            ".section __DATA, __objc_selrefs, literal_pointers, no_dead_strip", 1)
+DEF_SECTION (objc2_nonlazy_class_section, 0,
+            ".section __DATA, __objc_nlclslist, regular, no_dead_strip", 1)
+DEF_SECTION (objc2_nonlazy_category_section, 0,
+            ".section __DATA, __objc_nlcatlist, regular, no_dead_strip", 1)
+DEF_SECTION (objc2_protocollist_section, 0,
+            ".section __DATA, __objc_protolist, regular, no_dead_strip", 1)
+DEF_SECTION (objc2_protocolrefs_section, 0,
+            ".section __DATA, __objc_protorefs, regular, no_dead_strip", 1)
+DEF_SECTION (objc2_super_classrefs_section, 0,
+            ".section __DATA, __objc_superrefs, regular, no_dead_strip", 1)
+DEF_SECTION (objc2_image_info_section, 0,
+            ".section __DATA, __objc_imageinfo, regular, no_dead_strip", 1)
+DEF_SECTION (objc2_constant_string_object_section, 0,
+            ".section __DATA, __objc_stringobj, regular, no_dead_strip", 1)
+
+/* Additions for compatibility with later runtime conventions especially for
+   sections containing strings.  */
+DEF_SECTION (objc2_data_section, 0, ".section __DATA, __data", 1)
+
+DEF_SECTION (objc2_ivar_section, 0, ".section __DATA, __objc_ivar", 1)
+
+DEF_SECTION (objc2_class_names_section, 0,
+            ".section __TEXT, __objc_classname, cstring_literals", 1)
+
+DEF_SECTION (objc2_method_names_section, 0,
+            ".section __TEXT, __objc_methname, cstring_literals", 1)
+
+DEF_SECTION (objc2_method_types_section, 0,
+            ".section __TEXT, __objc_methtype, cstring_literals", 1)