const char *
machopic_function_base_name (void)
{
- const char *current_name;
/* if dynamic-no-pic is on, we should not get here */
if (MACHO_DYNAMIC_NO_PIC_P)
abort ();
- current_name =
- IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl));
if (function_base == NULL)
function_base =
ptr_ref = gen_rtx_SYMBOL_REF (Pmode,
machopic_non_lazy_ptr_name (name));
+ SYMBOL_REF_DECL (ptr_ref) = SYMBOL_REF_DECL (orig);
+
ptr_ref = gen_rtx_MEM (Pmode, ptr_ref);
RTX_UNCHANGING_P (ptr_ref) = 1;
if (!machopic_name_defined_p (name))
{
const char *stub_name = machopic_stub_name (name);
+ tree decl = SYMBOL_REF_DECL (XEXP (target, 0));
XEXP (target, 0) = gen_rtx_SYMBOL_REF (mode, stub_name);
+ SYMBOL_REF_DECL (XEXP (target, 0)) = decl;
RTX_UNCHANGING_P (target) = 1;
}
}
&& (!TREE_PUBLIC (decl) || (!DECL_ONE_ONLY (decl) && !DECL_WEAK (decl)))
&& ((TREE_STATIC (decl)
&& (!DECL_COMMON (decl) || !TREE_PUBLIC (decl)))
- || (DECL_INITIAL (decl)
+ || (!DECL_COMMON (decl) && DECL_INITIAL (decl)
&& DECL_INITIAL (decl) != error_mark_node)))
defined = 1;
void
darwin_asm_named_section (const char *name, unsigned int flags ATTRIBUTE_UNUSED)
{
- fprintf (asm_out_file, ".section %s\n", name);
+ if (flag_reorder_blocks_and_partition)
+ fprintf (asm_out_file, SECTION_FORMAT_STRING, name);
+ else
+ fprintf (asm_out_file, ".section %s\n", name);
}
unsigned int
}
/* Emit a label for an FDE, making it global and/or weak if appropriate.
- The third parameter is nonzero if this is just a placeholder for an
+ The third parameter is nonzero if this is for exception handling.
+ The fourth parameter is nonzero if this is just a placeholder for an
FDE that we are omitting. */
+
void
-darwin_emit_unwind_label(FILE *file, tree decl, int empty)
+darwin_emit_unwind_label (FILE *file, tree decl, int for_eh, int empty)
{
tree id = DECL_ASSEMBLER_NAME (decl)
? DECL_ASSEMBLER_NAME (decl)
unsigned int base_len = IDENTIFIER_LENGTH (id);
const char *suffix = ".eh";
- unsigned int suffix_len = 3;
int need_quotes = name_needs_quotes (base);
int quotes_len = need_quotes ? 2 : 0;
+ char *lab;
- char *lab = xmalloc (prefix_len + base_len + suffix_len + quotes_len + 1);
+ if (! for_eh)
+ suffix = ".eh1";
+
+ lab = xmalloc (prefix_len + base_len + strlen (suffix) + quotes_len + 1);
lab[0] = '\0';
if (need_quotes)
}
/* Generate a PC-relative reference to a Mach-O non-lazy-symbol. */
+
void
darwin_non_lazy_pcrel (FILE *file, rtx addr)
{