diff options
author | Nick Clifton <nickc@redhat.com> | 2013-09-18 07:50:34 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2013-09-18 07:50:34 +0000 |
commit | ab90591541a18371d9676ce8d731ff50d4f74a90 (patch) | |
tree | 12da79250b827ea4133bba8143a0f6f9329d8696 /gas | |
parent | ee47b2f89d1b45727d1867e6b5b3c137bbcfe792 (diff) | |
download | fsf-binutils-gdb-ab90591541a18371d9676ce8d731ff50d4f74a90.zip fsf-binutils-gdb-ab90591541a18371d9676ce8d731ff50d4f74a90.tar.gz fsf-binutils-gdb-ab90591541a18371d9676ce8d731ff50d4f74a90.tar.bz2 |
* config/tc-msp430.c (OPTION_MOVE_DATA): Define.
(move_data): New variable.
(md_parse_option): Parse -md.
(msp430_section): New function. Catch references to the .bss or
.data sections and generate a special symbol for use by the libcrt
library.
(md_pseudo_table): Intercept .section directives.
(md_longopt): Add -md
(md_show_usage): Likewise.
(msp430_operands): Generate a warning message if a NOP is inserted
into the instruction stream.
* doc/c-msp430.texi (node MSP430 Options): Document -md option.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 17 | ||||
-rw-r--r-- | gas/config/tc-msp430.c | 39 | ||||
-rw-r--r-- | gas/doc/c-msp430.texi | 4 |
3 files changed, 59 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 2ec87a1..62e136e 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,7 +1,22 @@ +2013-09-18 Nick Clifton <nickc@redhat.com> + + * config/tc-msp430.c (OPTION_MOVE_DATA): Define. + (move_data): New variable. + (md_parse_option): Parse -md. + (msp430_section): New function. Catch references to the .bss or + .data sections and generate a special symbol for use by the libcrt + library. + (md_pseudo_table): Intercept .section directives. + (md_longopt): Add -md + (md_show_usage): Likewise. + (msp430_operands): Generate a warning message if a NOP is inserted + into the instruction stream. + * doc/c-msp430.texi (node MSP430 Options): Document -md option. + 2013-09-17 Doug Gilmore <Doug.Gilmore@imgtec.com> * config/tc-mips.c (mips_elf_final_processing): Set - EF_MIPS_FP64 for -mgp32 -mfp64, removing old FIXME. + EF_MIPS_FP64 for -mgp32 -mfp64, removing old FIXME. 2013-09-16 Will Newton <will.newton@linaro.org> diff --git a/gas/config/tc-msp430.c b/gas/config/tc-msp430.c index e16fcd9..4f34a37 100644 --- a/gas/config/tc-msp430.c +++ b/gas/config/tc-msp430.c @@ -1123,6 +1123,8 @@ static bfd_boolean large_model = FALSE; #define OPTION_NO_INTR_NOPS 'N' static bfd_boolean gen_interrupt_nops = TRUE; #define OPTION_MCPU 'c' +#define OPTION_MOVE_DATA 'd' +static bfd_boolean move_data = FALSE; static void msp430_set_arch (int option) @@ -1210,16 +1212,44 @@ md_parse_option (int c, char * arg) case OPTION_NO_INTR_NOPS: gen_interrupt_nops = FALSE; return 1; + + case OPTION_MOVE_DATA: + move_data = TRUE; + return 1; } return 0; } +static void +msp430_section (int arg) +{ + char * saved_ilp = input_line_pointer; + char * name = obj_elf_section_name (); + + if (strncmp (name, ".bss", 4) == 0 + || strncmp (name, ".gnu.linkonce.b.", 16) == 0) + (void) symbol_find_or_make ("__crt0_init_bss"); + + if (move_data + && (strncmp (name, ".data", 5) == 0 + || strncmp (name, ".gnu.linkonce.d.", 16) == 0)) + (void) symbol_find_or_make ("__crt0_movedata"); + + input_line_pointer = saved_ilp; + obj_elf_section (arg); +} + const pseudo_typeS md_pseudo_table[] = { {"arch", msp430_set_arch, OPTION_MMCU}, {"cpu", msp430_set_arch, OPTION_MCPU}, {"profiler", msp430_profiler, 0}, + {"section", msp430_section, 0}, + {"section.s", msp430_section, 0}, + {"sect", msp430_section, 0}, + {"sect.s", msp430_section, 0}, + {"pushsection", msp430_section, 1}, {NULL, NULL, 0} }; @@ -1233,6 +1263,7 @@ struct option md_longopts[] = {"mQ", no_argument, NULL, OPTION_RELAX}, {"ml", no_argument, NULL, OPTION_LARGE}, {"mN", no_argument, NULL, OPTION_NO_INTR_NOPS}, + {"md", no_argument, NULL, OPTION_MOVE_DATA}, {NULL, no_argument, NULL, 0} }; @@ -1252,6 +1283,8 @@ md_show_usage (FILE * stream) _(" -ml - enable large code model\n")); fprintf (stream, _(" -mN - disable generation of NOP after changing interrupts\n")); + fprintf (stream, + _(" -md - Force copying of data from ROM to RAM at startup\n")); show_mcu_list (stream); } @@ -2201,6 +2234,8 @@ msp430_operands (struct msp430_opcode_s * opcode, char * line) See 1.3.4.1 of the MSP430x5xx User Guide. */ insn_length += 2; frag = frag_more (2); + as_warn (_("a NOP instruction has been inserted after %s"), + opcode->name); bfd_putl16 ((bfd_vma) 0x4303 /* NOP */, frag); } dwarf2_emit_insn (insn_length); @@ -2285,6 +2320,8 @@ msp430_operands (struct msp430_opcode_s * opcode, char * line) insn_length += 2; frag = frag_more (2); bfd_putl16 ((bfd_vma) 0x4303 /* NOP */, frag); + as_warn (_("a NOP instruction has been inserted after %s"), + opcode->name); } dwarf2_emit_insn (insn_length); @@ -3041,6 +3078,8 @@ msp430_operands (struct msp430_opcode_s * opcode, char * line) insn_length += 2; frag = frag_more (2); bfd_putl16 ((bfd_vma) 0x4303 /* NOP */, frag); + as_warn (_("a NOP instruction has been inserted after %s"), + opcode->name); } dwarf2_emit_insn (insn_length); diff --git a/gas/doc/c-msp430.texi b/gas/doc/c-msp430.texi index 538133a..2927add 100644 --- a/gas/doc/c-msp430.texi +++ b/gas/doc/c-msp430.texi @@ -57,6 +57,10 @@ instruction happens automatically, but this command line option disables this behaviour. It is then up to the programmer to ensure that interrupts are enabled and disabled correctly. +@item -md +mark the object file as one that requires data to copied from ROM to +RAM at execution startup. Disabled by default. + @end table @node MSP430 Syntax |