aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Pinski <pinskia@physics.uc.edu>2006-03-01 19:12:22 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2006-03-01 11:12:22 -0800
commitab0ff8041e3f5457ff94126aa7a537a87267f98d (patch)
tree2dea0dfdc85e799468484651f4d9f1fb96a915dd
parent607f460c8b9e032b3fec25313b032bf07788b354 (diff)
downloadgcc-ab0ff8041e3f5457ff94126aa7a537a87267f98d.zip
gcc-ab0ff8041e3f5457ff94126aa7a537a87267f98d.tar.gz
gcc-ab0ff8041e3f5457ff94126aa7a537a87267f98d.tar.bz2
re PR target/26389 (Darwin does not support -fsection-anchors)
2006-03-01 Andrew Pinski <pinskia@physics.uc.edu> PR target/26389 * config/darwin-protos.h (darwin_asm_output_anchor): Declare. * config/darwin-sections.def (cstring_section): Add SECTION_MERGE to the flags. (literal4_section): Likewise. (literal8_section): Likewise. (objc_selector_refs_section): Likewise. (objc_cls_refs_section): Likewise. * config/darwin.c (darwin_asm_output_anchor): New function. * config/darwin.h (TARGET_ASM_OUTPUT_ANCHOR): Define. From-SVN: r111609
-rw-r--r--gcc/ChangeLog15
-rw-r--r--gcc/config/darwin-protos.h1
-rw-r--r--gcc/config/darwin-sections.def10
-rw-r--r--gcc/config/darwin.c13
-rw-r--r--gcc/config/darwin.h2
5 files changed, 36 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a30b5cd..74d6719 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,18 @@
+2006-03-01 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR target/26389
+ * config/darwin-protos.h (darwin_asm_output_anchor):
+ Declare.
+ * config/darwin-sections.def (cstring_section):
+ Add SECTION_MERGE to the flags.
+ (literal4_section): Likewise.
+ (literal8_section): Likewise.
+ (objc_selector_refs_section): Likewise.
+ (objc_cls_refs_section): Likewise.
+ * config/darwin.c (darwin_asm_output_anchor): New
+ function.
+ * config/darwin.h (TARGET_ASM_OUTPUT_ANCHOR): Define.
+
2006-03-01 Daniel Berlin <dberlin@dberlin.org>
Fix PR tree-optimization/26443
diff --git a/gcc/config/darwin-protos.h b/gcc/config/darwin-protos.h
index a22e76f..75308fb 100644
--- a/gcc/config/darwin-protos.h
+++ b/gcc/config/darwin-protos.h
@@ -80,3 +80,4 @@ extern void darwin_asm_output_dwarf_delta (FILE *, int, const char *,
const char *);
extern bool darwin_binds_local_p (tree);
extern void darwin_cpp_builtins (struct cpp_reader *);
+extern void darwin_asm_output_anchor (rtx symbol);
diff --git a/gcc/config/darwin-sections.def b/gcc/config/darwin-sections.def
index 327c175..89d6371 100644
--- a/gcc/config/darwin-sections.def
+++ b/gcc/config/darwin-sections.def
@@ -11,9 +11,9 @@ DEF_SECTION (const_data_coal_section, 0,
".section __DATA,__const_coal,coalesced", 0)
DEF_SECTION (data_coal_section, SECTION_WRITE,
".section __DATA,__datacoal_nt,coalesced", 0)
-DEF_SECTION (cstring_section, 0, ".cstring", 0)
-DEF_SECTION (literal4_section, 0, ".literal4", 0)
-DEF_SECTION (literal8_section, 0, ".literal8", 0)
+DEF_SECTION (cstring_section, SECTION_MERGE, ".cstring", 0)
+DEF_SECTION (literal4_section, SECTION_MERGE, ".literal4", 0)
+DEF_SECTION (literal8_section, SECTION_MERGE, ".literal8", 0)
DEF_SECTION (constructor_section, 0, ".constructor", 0)
DEF_SECTION (mod_init_section, 0, ".mod_init_func", 0)
DEF_SECTION (mod_term_section, 0, ".mod_term_func", 0)
@@ -27,7 +27,7 @@ DEF_SECTION (objc_cls_meth_section, 0, ".objc_cls_meth", 1)
DEF_SECTION (objc_inst_meth_section, 0, ".objc_inst_meth", 1)
DEF_SECTION (objc_cat_cls_meth_section, 0, ".objc_cat_cls_meth", 1)
DEF_SECTION (objc_cat_inst_meth_section, 0, ".objc_cat_inst_meth", 1)
-DEF_SECTION (objc_selector_refs_section, 0, ".objc_message_refs", 1)
+DEF_SECTION (objc_selector_refs_section, SECTION_MERGE, ".objc_message_refs", 1)
DEF_SECTION (objc_selector_fixup_section, 0,
".section __OBJC, __sel_fixup, regular, no_dead_strip", 1)
DEF_SECTION (objc_symbols_section, 0, ".objc_symbols", 1)
@@ -43,7 +43,7 @@ DEF_SECTION (objc_image_info_section, 0,
DEF_SECTION (objc_class_names_section, 0, ".objc_class_names", 1)
DEF_SECTION (objc_meth_var_names_section, 0, ".objc_meth_var_names", 1)
DEF_SECTION (objc_meth_var_types_section, 0, ".objc_meth_var_types", 1)
-DEF_SECTION (objc_cls_refs_section, 0, ".objc_cls_refs", 1)
+DEF_SECTION (objc_cls_refs_section, SECTION_MERGE, ".objc_cls_refs", 1)
DEF_SECTION (machopic_lazy_symbol_ptr_section, 0, ".lazy_symbol_pointer", 0)
DEF_SECTION (machopic_nl_symbol_ptr_section, 0, ".non_lazy_symbol_pointer", 0)
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index 25fecd8..2ae24a9 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -1479,4 +1479,17 @@ darwin_binds_local_p (tree decl)
return default_binds_local_p_1 (decl, 0);
}
+/* The Darwin's implementation of TARGET_ASM_OUTPUT_ANCHOR. Define the
+ anchor relative to ".", the current section position. We cannot use
+ the default one because ASM_OUTPUT_DEF is wrong for Darwin. */
+
+void
+darwin_asm_output_anchor (rtx symbol)
+{
+ fprintf (asm_out_file, "\t.set\t");
+ assemble_name (asm_out_file, XSTR (symbol, 0));
+ fprintf (asm_out_file, ", . + " HOST_WIDE_INT_PRINT_DEC "\n",
+ SYMBOL_REF_BLOCK_OFFSET (symbol));
+}
+
#include "gt-darwin.h"
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index ddd508e..495178c 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -793,6 +793,8 @@ enum machopic_addr_class {
goto DONE; \
}
+#define TARGET_ASM_OUTPUT_ANCHOR darwin_asm_output_anchor
+
/* Experimentally, putting jump tables in text is faster on SPEC.
Also this is needed for correctness for coalesced functions. */