OSDN Git Service

* config/rs6000/darwin.h (SUBTARGET_OPTIONS): Move from here, to...
[pf3gnuchains/gcc-fork.git] / gcc / config / darwin.h
index 7f6e8dc..0099e0b 100644 (file)
@@ -109,6 +109,8 @@ Boston, MA 02111-1307, USA.  */
   { "-bundle", "-Zbundle" },  \
   { "-bundle_loader", "-Zbundle_loader" },  \
   { "-weak_reference_mismatches", "-Zweak_reference_mismatches" },  \
+  { "-dead_strip", "-Zdead_strip" }, \
+  { "-no_dead_strip_inits_and_terms", "-Zno_dead_strip_inits_and_terms" }, \
   { "-dependency-file", "-MF" }, \
   { "-dylib_file", "-Zdylib_file" }, \
   { "-dynamic", "-Zdynamic" },  \
@@ -130,7 +132,25 @@ Boston, MA 02111-1307, USA.  */
   { "-single_module", "-Zsingle_module" },  \
   { "-unexported_symbols_list", "-Zunexported_symbols_list" }, \
   SUBTARGET_OPTION_TRANSLATE_TABLE
+
+/* Nonzero if the user has chosen to force sizeof(bool) to be 1
+   by providing the -mone-byte-bool switch.  It would be better
+   to use SUBTARGET_SWITCHES for this instead of SUBTARGET_OPTIONS,
+   but there are no more bits in rs6000 TARGET_SWITCHES.  Note
+   that this switch has no "no-" variant. */
+extern const char *darwin_one_byte_bool;
   
+extern int darwin_fix_and_continue;
+extern const char *darwin_fix_and_continue_switch;
+
+#undef SUBTARGET_OPTIONS
+#define SUBTARGET_OPTIONS \
+  {"one-byte-bool", &darwin_one_byte_bool, N_("Set sizeof(bool) to 1"), 0 }, \
+  {"fix-and-continue", &darwin_fix_and_continue_switch,                        \
+   N_("Generate code suitable for fast turn around debugging"), 0},    \
+  {"no-fix-and-continue", &darwin_fix_and_continue_switch,             \
+   N_("Don't generate code suitable for fast turn around debugging"), 0}
+
 /* These compiler options take n arguments.  */
 
 #undef  WORD_SWITCH_TAKES_ARG
@@ -200,8 +220,7 @@ Boston, MA 02111-1307, USA.  */
     %{!Zdynamiclib:%{!A:%{!nostdlib:%{!nostartfiles:%S}}}} \
     %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate:-lgcov} \
     %{!nostdlib:%{!nodefaultlibs:%G %L}} \
-    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} \
-    %{!--help:%{!no-c++filt|c++filt:| c++filt }} }}}}}}}}"
+    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}}"
 
 /* Please keep the random linker options in alphabetical order (modulo
    'Z' and 'no' prefixes).  Options that can only go to one of libtool
@@ -241,6 +260,8 @@ Boston, MA 02111-1307, USA.  */
    %{Zallowable_client*:-allowable_client %*} \
    %{Zbind_at_load:-bind_at_load} \
    %{Zarch_errors_fatal:-arch_errors_fatal} \
+   %{Zdead_strip:-dead_strip} \
+   %{Zno_dead_strip_inits_and_terms:-no_dead_strip_inits_and_terms} \
    %{Zdylib_file*:-dylib_file %*} \
    %{Zdynamic:-dynamic}\
    %{Zexported_symbols_list*:-exported_symbols_list %*} \
@@ -414,7 +435,7 @@ do { text_section ();                                                       \
 
 /* The RTTI data (e.g., __ti4name) is common and public (and static),
    but it does need to be referenced via indirect PIC data pointers.
-   The machopic_define_name calls are telling the machopic subsystem
+   The machopic_define_symbol calls are telling the machopic subsystem
    that the name *is* defined in this module, so it doesn't need to
    make them indirect.  */
 
@@ -428,7 +449,7 @@ do { text_section ();                                                       \
       if ((TREE_STATIC (DECL)                                          \
           && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL)))             \
           || DECL_INITIAL (DECL))                                      \
-        machopic_define_name (xname);                                  \
+        machopic_define_symbol (DECL_RTL (DECL));                      \
     if ((TREE_STATIC (DECL)                                            \
         && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL)))               \
         || DECL_INITIAL (DECL))                                                \
@@ -449,7 +470,7 @@ do { text_section ();                                                       \
       if ((TREE_STATIC (DECL)                                           \
           && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL)))             \
           || DECL_INITIAL (DECL))                                       \
-        machopic_define_name (xname);                                   \
+        machopic_define_symbol (DECL_RTL (DECL));                       \
     if ((TREE_STATIC (DECL)                                             \
         && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL)))               \
         || DECL_INITIAL (DECL))                                         \
@@ -472,18 +493,18 @@ do { text_section ();                                                     \
 #undef ASM_OUTPUT_LABELREF
 #define ASM_OUTPUT_LABELREF(FILE,NAME)                                      \
   do {                                                                      \
-       const char *xname = darwin_strip_name_encoding (NAME);               \
+       const char *xname = (NAME);                                          \
        if (! strcmp (xname, "<pic base>"))                                  \
          machopic_output_function_base_name(FILE);                           \
        else if (xname[0] == '&' || xname[0] == '*')                         \
          {                                                                  \
            int len = strlen (xname);                                        \
           if (len > 6 && !strcmp ("$stub", xname + len - 5))                \
-            machopic_validate_stub_or_non_lazy_ptr (xname, 1);              \
+            machopic_validate_stub_or_non_lazy_ptr (xname);                 \
           else if (len > 7 && !strcmp ("$stub\"", xname + len - 6))         \
-            machopic_validate_stub_or_non_lazy_ptr (xname, 1);              \
+            machopic_validate_stub_or_non_lazy_ptr (xname);                 \
           else if (len > 14 && !strcmp ("$non_lazy_ptr", xname + len - 13)) \
-            machopic_validate_stub_or_non_lazy_ptr (xname, 0);              \
+            machopic_validate_stub_or_non_lazy_ptr (xname);                 \
           fputs (&xname[1], FILE);                                          \
         }                                                                   \
        else if (xname[0] == '+' || xname[0] == '-')                         \
@@ -515,7 +536,7 @@ do { text_section ();                                                       \
 
 /* Ensure correct alignment of bss data.  */
 
-#undef ASM_OUTPUT_ALIGNED_DECL_LOCAL
+#undef ASM_OUTPUT_ALIGNED_DECL_LOCAL                                   
 #define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN)   \
   do {                                                                 \
     fputs (".lcomm ", (FILE));                                         \
@@ -525,11 +546,10 @@ do { text_section ();                                                     \
     if ((DECL) && ((TREE_STATIC (DECL)                                 \
         && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL)))               \
         || DECL_INITIAL (DECL)))                                       \
-      (* targetm.encode_section_info) (DECL, DECL_RTL (DECL), false);  \
-    if ((DECL) && ((TREE_STATIC (DECL)                                 \
-        && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL)))               \
-        || DECL_INITIAL (DECL)))                                       \
-      machopic_define_name (NAME);                                     \
+      {                                                                        \
+       (* targetm.encode_section_info) (DECL, DECL_RTL (DECL), false); \
+       machopic_define_symbol (DECL_RTL (DECL));                       \
+      }                                                                        \
   } while (0)
 
 /* The maximum alignment which the object file format can support.
@@ -646,7 +666,7 @@ SECTION_FUNCTION (objc_selector_refs_section,       \
                  ".objc_message_refs", 1)      \
 SECTION_FUNCTION (objc_selector_fixup_section, \
                  in_objc_selector_fixup,       \
-                 ".section __OBJC, __sel_fixup", 1)    \
+                 ".section __OBJC, __sel_fixup, regular, no_dead_strip", 1)    \
 SECTION_FUNCTION (objc_symbols_section,                \
                  in_objc_symbols,              \
                  ".objc_symbols", 1)   \
@@ -661,11 +681,11 @@ SECTION_FUNCTION (objc_string_object_section,     \
                  ".objc_string_object", 1)     \
 SECTION_FUNCTION (objc_constant_string_object_section, \
                  in_objc_constant_string_object,       \
-                 ".section __OBJC, __cstring_object", 1)       \
+                 ".section __OBJC, __cstring_object, regular, no_dead_strip", 1)       \
 /* Fix-and-Continue image marker.  */          \
 SECTION_FUNCTION (objc_image_info_section,     \
                   in_objc_image_info,          \
-                  ".section __OBJC, __image_info", 1)  \
+                  ".section __OBJC, __image_info, regular, no_dead_strip", 1)  \
 SECTION_FUNCTION (objc_class_names_section,    \
                in_objc_class_names,            \
                ".objc_class_names", 1) \
@@ -745,7 +765,8 @@ objc_section_init (void)                    \
 #define TARGET_ASM_SELECT_RTX_SECTION machopic_select_rtx_section
 #undef  TARGET_ASM_UNIQUE_SECTION
 #define TARGET_ASM_UNIQUE_SECTION darwin_unique_section
-
+#undef  TARGET_ASM_FUNCTION_RODATA_SECTION
+#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section
 
 
 #define ASM_DECLARE_UNRESOLVED_REFERENCE(FILE,NAME)                    \
@@ -785,6 +806,9 @@ objc_section_init (void)                    \
 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)  \
   sprintf (LABEL, "*%s%ld", PREFIX, (long)(NUM))
 
+#undef TARGET_ASM_MARK_DECL_PRESERVED
+#define TARGET_ASM_MARK_DECL_PRESERVED darwin_mark_decl_preserved
+
 /* Since we have a separate readonly data section, define this so that
    jump tables end up in text rather than data.  */
 
@@ -792,6 +816,20 @@ objc_section_init (void)                   \
 #define JUMP_TABLES_IN_TEXT_SECTION 1
 #endif
 
+/* Set on a symbol with SYMBOL_FLAG_FUNCTION or
+   MACHO_SYMBOL_FLAG_VARIABLE to indicate that the function or
+   variable has been defined in this translation unit.  */
+
+#define MACHO_SYMBOL_FLAG_VARIABLE (SYMBOL_FLAG_MACH_DEP)
+#define MACHO_SYMBOL_FLAG_DEFINED ((SYMBOL_FLAG_MACH_DEP) << 1)
+
+/* Set on a symbol to indicate when fix-and-continue style code
+   generation is being used and the symbol refers to a static symbol
+   that should be rebound from new instances of a translation unit to
+   the original instance of the data.  */
+
+#define MACHO_SYMBOL_STATIC ((SYMBOL_FLAG_MACH_DEP) << 2)
+
 /* Symbolic names for various things we might know about a symbol.  */
 
 enum machopic_addr_class {
@@ -812,7 +850,7 @@ enum machopic_addr_class {
 #undef TARGET_ENCODE_SECTION_INFO
 #define TARGET_ENCODE_SECTION_INFO  darwin_encode_section_info
 #undef TARGET_STRIP_NAME_ENCODING
-#define TARGET_STRIP_NAME_ENCODING  darwin_strip_name_encoding
+#define TARGET_STRIP_NAME_ENCODING  default_strip_name_encoding
 
 #define GEN_BINDER_NAME_FOR_STUB(BUF,STUB,STUB_LENGTH)         \
   do {                                                         \
@@ -848,7 +886,7 @@ enum machopic_addr_class {
 
 #define GEN_LAZY_PTR_NAME_FOR_SYMBOL(BUF,SYMBOL,SYMBOL_LENGTH) \
   do {                                                         \
-    const char *symbol_ = darwin_strip_name_encoding (SYMBOL); \
+    const char *symbol_ = (SYMBOL);                             \
     char *buffer_ = (BUF);                                     \
     if (symbol_[0] == '"')                                     \
       {                                                                \
@@ -875,7 +913,7 @@ enum machopic_addr_class {
 #define TARGET_ASM_EH_FRAME_SECTION darwin_eh_frame_section
 
 #define EH_FRAME_SECTION_NAME   "__TEXT"
-#define EH_FRAME_SECTION_ATTR ",coalesced,no_toc+strip_static_syms"
+#define EH_FRAME_SECTION_ATTR ",coalesced,no_toc+strip_static_syms+live_support"
 
 #undef ASM_PREFERRED_EH_DATA_FORMAT
 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL)  \
@@ -926,4 +964,6 @@ void add_framework_path (char *);
 #define TARGET_C99_FUNCTIONS 0
 #endif
 
+#define WINT_TYPE "int"
+
 #endif /* CONFIG_DARWIN_H */