diff options
author | Nick Clifton <nickc@redhat.com> | 2020-09-14 16:14:24 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2020-09-14 16:14:24 +0100 |
commit | b1766e7ce88647c8002928aeb8a9f04048c494ae (patch) | |
tree | 33c8ecdce1a894dfba913c58e0b484991383be8c /gas/config | |
parent | 04f5bab24ba93562d5d14b6f26efbd407dbccaaf (diff) | |
download | binutils-b1766e7ce88647c8002928aeb8a9f04048c494ae.zip binutils-b1766e7ce88647c8002928aeb8a9f04048c494ae.tar.gz binutils-b1766e7ce88647c8002928aeb8a9f04048c494ae.tar.bz2 |
Add a new ".nop" directive to the assembler to allow the creation of no-op instructions in an architeture neutral manner.
* read.c (s_nop): New function. Handles the .nop directive.
(potable): Add entry for "nop".
(s_nops): Code tidy.
* read.h (s_nop): Add prototype.
* config/tc-bpf.h (md_single_noop_insn): Define.
* config/tc-mmix.h (md_single_noop_insn): Define.
* config/tc-or1k.h (md_single_noop_insn): Define.
* config/tc-s12z.c (md_assemble): Preserve the input line pointer,
rather than corrupting it.
* write.c (relax_segment): Update error message regarding
non-absolute values passed to .fill and .nops.
* NEWS: Mention the new directive.
* doc/as.texi: Document the new directive.
* doc/internals.texi: Document the new internal macros used to
implement the new directive.
* testsuite/gas/all/nop.s: New test.
* testsuite/gas/all/nop.d: New test control file.
* testsuite/gas/all/gas.exp: Run the new test.
* testsuite/gas/elf/dwarf-5-nop-for-line-table.s: New test.
* testsuite/gas/elf/dwarf-5-nop-for-line-table.d: New test
control file.
* testsuite/gas/elf/elf.exp: Run the new test.
* testsuite/gas/i386/space1.l: Adjust expected output.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-bpf.h | 1 | ||||
-rw-r--r-- | gas/config/tc-mmix.h | 2 | ||||
-rw-r--r-- | gas/config/tc-or1k.h | 2 | ||||
-rw-r--r-- | gas/config/tc-s12z.c | 9 |
4 files changed, 11 insertions, 3 deletions
diff --git a/gas/config/tc-bpf.h b/gas/config/tc-bpf.h index 5765833..cb02d6c 100644 --- a/gas/config/tc-bpf.h +++ b/gas/config/tc-bpf.h @@ -48,3 +48,4 @@ /* Values passed to md_apply_fix don't include the symbol value. */ #define MD_APPLY_SYM_VALUE(FIX) 0 +#define md_single_noop_insn "mov %r1,%r1" diff --git a/gas/config/tc-mmix.h b/gas/config/tc-mmix.h index f7a54c1..2d8e226 100644 --- a/gas/config/tc-mmix.h +++ b/gas/config/tc-mmix.h @@ -228,3 +228,5 @@ extern void mmix_md_do_align (int, char *, int, int); /* MMIX has global register symbols. */ #define TC_GLOBAL_REGISTER_SYMBOL_OK + +#define md_single_noop_insn "set $0, $0" diff --git a/gas/config/tc-or1k.h b/gas/config/tc-or1k.h index 0242dd4..b9aa00c 100644 --- a/gas/config/tc-or1k.h +++ b/gas/config/tc-or1k.h @@ -74,3 +74,5 @@ void or1k_elf_final_processing (void); #define tc_cfi_frame_initial_instructions \ or1k_cfi_frame_initial_instructions extern void or1k_cfi_frame_initial_instructions (void); + +#define md_single_noop_insn "l.nop" diff --git a/gas/config/tc-s12z.c b/gas/config/tc-s12z.c index d89fb0c..c79d2f4 100644 --- a/gas/config/tc-s12z.c +++ b/gas/config/tc-s12z.c @@ -3807,6 +3807,7 @@ md_assemble (char *str) return; } + char * saved_ilp = input_line_pointer; input_line_pointer = skip_whites (op_end); size_t i; @@ -3816,15 +3817,17 @@ md_assemble (char *str) if (0 == strcmp (name, opc->name)) { if (opc->parse_operands (opc)) - return; + { + input_line_pointer = saved_ilp; + return; + } continue; } } as_bad (_("Invalid instruction: \"%s\""), str); as_bad (_("First invalid token: \"%s\""), fail_line_pointer); - while (*input_line_pointer++) - ; + input_line_pointer = saved_ilp; } |