+1999-06-23 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-mcore.c (md_pseudo_table): Add .comm for ELF and allow
+ .section for COFF.
+ (mcore_s_text): Call obj_elf_text for ELF target.
+ (mcore_s_data): Call obj_elf_data for ELF target.
+ (mcore_s_section): No longer ELF specific. Call obj_coff_section
+ for COFF target.
+ (mcore_s_bss): New function: Dump literal table before changing
+ sections.
+ (mcore_s_comm): New function: Dump literal table before changing
+ sections.
+
+ * config/obj-elf.c (obj_elf_common, obj_elf_data, obj_elf_text):
+ No longer static functions.
+ * config/obj-elf.h (obj_elf_common, obj_elf_data, obj_elf_text):
+ Provide prototypes for these functions.
+
1999-06-22 Ian Lance Taylor <ian@zembu.com>
* subsegs.c (subseg_text_p): Rewrite non BFD_ASSEMBLER case to use
static void obj_elf_ident PARAMS ((int));
static void obj_elf_weak PARAMS ((int));
static void obj_elf_local PARAMS ((int));
-static void obj_elf_common PARAMS ((int));
static void obj_elf_symver PARAMS ((int));
static void obj_elf_vtable_inherit PARAMS ((int));
static void obj_elf_vtable_entry PARAMS ((int));
-static void obj_elf_data PARAMS ((int));
-static void obj_elf_text PARAMS ((int));
static void obj_elf_subsection PARAMS ((int));
static void obj_elf_popsection PARAMS ((int));
#endif
}
-static void
+void
obj_elf_common (is_common)
int is_common;
{
/* Change to the .data section. */
-static void
+void
obj_elf_data (i)
int i;
{
/* Change to the .text section. */
-static void
+void
obj_elf_text (i)
int i;
{
static void check_literals PARAMS ((int, int));
static void mcore_s_text PARAMS ((int));
static void mcore_s_data PARAMS ((int));
-#ifdef OBJ_ELF
static void mcore_s_section PARAMS ((int));
+static void mcore_s_bss PARAMS ((int));
+#ifdef OBJ_ELF
+static void mcore_s_comm PARAMS ((int));
#endif
+
/* Several places in this file insert raw instructions into the
object. They should use MCORE_INST_XXX macros to get the opcodes
and then use these two macros to crack the MCORE_INST value into
{ "import", s_ignore, 0 },
{ "literals", mcore_s_literals, 0 },
{ "page", listing_eject, 0 },
- { "bss", s_lcomm_bytes, 1 },
/* The following are to intercept the placement of data into the text
section (eg addresses for a switch table), so that the space they
/* Allow for the effect of section changes. */
{ "text", mcore_s_text, 0 },
{ "data", mcore_s_data, 0 },
-
-#ifdef OBJ_ELF
+ { "bss", mcore_s_bss, 1 },
+#ifdef OBJ_EF
+ { "comm", mcore_s_comm, 0 },
+#endif
{ "section", mcore_s_section, 0 },
{ "section.s", mcore_s_section, 0 },
{ "sect", mcore_s_section, 0 },
{ "sect.s", mcore_s_section, 0 },
-#endif
+
{ 0, 0, 0 }
};
check_literals (2, 0);
}
+/* Handle the section changing pseudo-ops. These call through to the
+ normal implementations, but they dump the literal pool first. */
+
static void
mcore_s_text (ignore)
int ignore;
{
dump_literals (0);
+#ifdef OBJ_ELF
+ obj_elf_text (ignore);
+#else
s_text (ignore);
+#endif
}
static void
{
dump_literals (0);
+#ifdef OBJ_ELF
+ obj_elf_data (ignore);
+#else
s_data (ignore);
+#endif
+}
+
+static void
+mcore_s_section (ignore)
+ int ignore;
+{
+ dump_literals (0);
+
+#ifdef OBJ_ELF
+ obj_elf_section (ignore);
+#endif
+#ifdef OBJ_COFF
+ obj_coff_section (ignore);
+#endif
}
+static void
+mcore_s_bss (needs_align)
+ int needs_align;
+{
+ dump_literals (0);
+
+ s_lcomm_bytes (needs_align);
+}
+
+#ifdef OBJ_ELF
+static void
+mcore_s_comm (needs_align)
+ int needs_align;
+{
+ dump_literals (0);
+
+ obj_elf_common (needs_align);
+}
+#endif
+
/* This function is called once, at assembler startup time. This should
set up all the tables, etc that the MD part of the assembler needs. */
void
return 1;
}
-
-/* Handle the .section pseudo-op. This is like the usual one, but it
- dumps the literal pool before changing the section. */
-static void
-mcore_s_section (ignore)
- int ignore;
-{
- dump_literals (0);
-
- obj_elf_section (ignore);
-}
#endif /* OBJ_ELF */