Commit: Gas: Add .nop directive.

Michael Morrell morrell@alumni.ucsd.edu
Mon Sep 14 16:04:14 GMT 2020


 Once this is in, I hope this code from gcc/configure can be removed:

# ??? Not all targets support dwarf2 debug_line, even within a version
# of gas. Moreover, we need to emit a valid instruction to trigger any
# info to the output file. So, as supported targets are added to gas 2.11,
# add some instruction here to (also) show we expect this might work.
# ??? Once 2.11 is released, probably need to add first known working
# version to the per-target configury.
case "$cpu_type" in
 aarch64 | alpha | arc | arm | avr | bfin | cris | csky | i386 | m32c | m68k \
 | microblaze | mips | nds32 | nios2 | pa | riscv | rs6000 | score | sparc | spu \
 | tilegx | tilepro | visium | xstormy16 | xtensa)
 insn="nop"
 ;;
 ia64 | s390)
 insn="nop 0"
 ;;
 mmix)
 insn="swym 0"
 ;;
esac

You currently have to update this for every new port to be able to check for dwarf2_debug_line support (even if the port has a "nop" instruction).

 Michael

On Monday, September 14, 2020, 08:27:15 AM PDT, Nick Clifton wrote:
 
Hi Guys,

 I am checking in the attached patch to add a ".nop" directive to the
 assembler. This directive creates a single no-op instruction. It is
 similar to the already existing ".nops" directive, apart from two
 important differences:

 1. It is implemented for all architectures, not just x86.
 2. The instruction it generates counts as a real instruction for the
 purposes of DWARF line number table generation.

 Fact 1 is important as it allows the directive to be used to generate
 architecture neutral test cases containing real instructions.

 Tested with a large variety of different targets.

Cheers
 Nick  


More information about the Binutils mailing list