+2014-08-18 Ajit Agarwal <ajitkum@xilinx.com>
+
+ * config/microblaze/microblaze.c (microblaze_elf_asm_cdtor): New.
+ (microblaze_elf_asm_constructor,microblaze_elf_asm_destructor): New.
+ * config/microblaze/microblaze.h
+ (TARGET_ASM_CONSTRUCTOR,TARGET_ASM_DESTRUCTOR): New Macros.
+
2014-08-18 H.J. Lu <hongjiu.lu@intel.com>
PR other/62168
static int microblaze_interrupt_function_p (tree);
+static void microblaze_elf_asm_constructor (rtx, int) ATTRIBUTE_UNUSED;
+static void microblaze_elf_asm_destructor (rtx, int) ATTRIBUTE_UNUSED;
+
section *sdata2_section;
#ifdef HAVE_AS_TLS
}
}
+static void
+microblaze_elf_asm_cdtor (rtx symbol, int priority, bool is_ctor)
+{
+ section *s;
+
+ if (priority != DEFAULT_INIT_PRIORITY)
+ {
+ char buf[18];
+ sprintf (buf, "%s.%.5u",
+ is_ctor ? ".ctors" : ".dtors",
+ MAX_INIT_PRIORITY - priority);
+ s = get_section (buf, SECTION_WRITE, NULL_TREE);
+ }
+ else if (is_ctor)
+ s = ctors_section;
+ else
+ s = dtors_section;
+
+ switch_to_section (s);
+ assemble_align (POINTER_SIZE);
+ fputs ("\t.word\t", asm_out_file);
+ output_addr_const (asm_out_file, symbol);
+ fputs ("\n", asm_out_file);
+}
+
+/* Add a function to the list of static constructors. */
+
+static void
+microblaze_elf_asm_constructor (rtx symbol, int priority)
+{
+ microblaze_elf_asm_cdtor (symbol, priority, /*is_ctor=*/true);
+}
+
+/* Add a function to the list of static destructors. */
+
+static void
+microblaze_elf_asm_destructor (rtx symbol, int priority)
+{
+ microblaze_elf_asm_cdtor (symbol, priority, /*is_ctor=*/false);
+}
+
/* Expand the prologue into a bunch of separate insns. */
void
{ \
}
+#undef TARGET_ASM_CONSTRUCTOR
+#define TARGET_ASM_CONSTRUCTOR microblaze_elf_asm_constructor
+
+#undef TARGET_ASM_DESTRUCTOR
+#define TARGET_ASM_DESTRUCTOR microblaze_elf_asm_destructor
+
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
sprintf ((LABEL), "*%s%s%ld", (LOCAL_LABEL_PREFIX), (PREFIX), (long)(NUM))