mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-11-16 12:34:43 +00:00
gas: fix rs_fill_nop listing
In commit a0094f1a70 ("gas: make .nops output visible in listing") I
was wrongly assuming fr_fix would be zero for rs_fill_nop, when that's
only a side effect of listing_newline() inserting dummy frags, but only
when file/line did actually change from the previous invocation. This is
in particular not going to be true when the .nops directive isn't the
first statement on a line.
This commit is contained in:
@@ -820,9 +820,8 @@ calc_hex (list_info_type *list)
|
|||||||
}
|
}
|
||||||
else if (frag_ptr->fr_type == rs_fill_nop && frag_ptr->fr_opcode)
|
else if (frag_ptr->fr_type == rs_fill_nop && frag_ptr->fr_opcode)
|
||||||
{
|
{
|
||||||
gas_assert (!octet_in_frag);
|
|
||||||
|
|
||||||
/* Print as many bytes from fr_opcode as is sensible. */
|
/* Print as many bytes from fr_opcode as is sensible. */
|
||||||
|
octet_in_frag = 0;
|
||||||
while (octet_in_frag < (unsigned int) frag_ptr->fr_offset
|
while (octet_in_frag < (unsigned int) frag_ptr->fr_offset
|
||||||
&& data_buffer_size < MAX_BYTES - 3)
|
&& data_buffer_size < MAX_BYTES - 3)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -638,6 +638,7 @@ if [gas_32_check] then {
|
|||||||
run_dump_test "nop-1-suffix"
|
run_dump_test "nop-1-suffix"
|
||||||
run_list_test "nop-1" "-aln"
|
run_list_test "nop-1" "-aln"
|
||||||
run_dump_test "nop-2"
|
run_dump_test "nop-2"
|
||||||
|
run_list_test "nop-7" "-aln"
|
||||||
run_dump_test "optimize-1"
|
run_dump_test "optimize-1"
|
||||||
run_dump_test "optimize-1a"
|
run_dump_test "optimize-1a"
|
||||||
run_dump_test "optimize-2"
|
run_dump_test "optimize-2"
|
||||||
|
|||||||
6
gas/testsuite/gas/i386/nop-7.l
Normal file
6
gas/testsuite/gas/i386/nop-7.l
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[ ]*[0-9]+[ ]+\.text
|
||||||
|
[ ]*[0-9]+[ ]+nops:
|
||||||
|
[ ]*[0-9]+[ ]+.... F88D7426[ ]+clc; \.nops 4; stc
|
||||||
|
[ ]*[0-9]+[ ]+00F9
|
||||||
|
[ ]*[0-9]+[ ]+.... C3[ ]+ret
|
||||||
|
#pass
|
||||||
6
gas/testsuite/gas/i386/nop-7.s
Normal file
6
gas/testsuite/gas/i386/nop-7.s
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
.text
|
||||||
|
nops:
|
||||||
|
clc; .nops 4; stc
|
||||||
|
ret
|
||||||
|
|
||||||
|
.end
|
||||||
Reference in New Issue
Block a user