From: Nick Clifton Date: Wed, 23 Jun 1999 09:27:09 +0000 (+0000) Subject: Make the mcore even more paranoid about section switching X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=16b93d8878c0f7e435dfeb730a7f20283b3d1c08;p=binutils-gdb.git Make the mcore even more paranoid about section switching --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 46853d56339..1154e64e091 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,21 @@ +1999-06-23 Nick Clifton + + * 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 * subsegs.c (subseg_text_p): Rewrite non BFD_ASSEMBLER case to use diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c index f204376b7d9..d5b8168d7eb 100644 --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -65,12 +65,9 @@ static void obj_elf_type PARAMS ((int)); 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)); @@ -256,7 +253,7 @@ elf_file_symbol (s) #endif } -static void +void obj_elf_common (is_common) int is_common; { @@ -867,7 +864,7 @@ obj_elf_section (push) /* Change to the .data section. */ -static void +void obj_elf_data (i) int i; { @@ -886,7 +883,7 @@ obj_elf_data (i) /* Change to the .text section. */ -static void +void obj_elf_text (i) int i; { diff --git a/gas/config/tc-mcore.c b/gas/config/tc-mcore.c index 5e4e329d1a3..d33fc9f8bbf 100644 --- a/gas/config/tc-mcore.c +++ b/gas/config/tc-mcore.c @@ -52,10 +52,13 @@ static void dump_literals PARAMS ((int)); 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 @@ -163,7 +166,6 @@ const pseudo_typeS md_pseudo_table[] = { "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 @@ -195,13 +197,15 @@ const pseudo_typeS md_pseudo_table[] = /* 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 } }; @@ -302,13 +306,20 @@ mcore_stringer (append_zero) 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 @@ -317,9 +328,47 @@ mcore_s_data (ignore) { 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 @@ -2169,15 +2218,4 @@ mcore_fix_adjustable (fixP) 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 */