[RFC] .fill does not accept forward labels

Andreas Krebbel krebbel@linux.vnet.ibm.com
Fri Oct 6 11:25:00 GMT 2017
Hi,

running gas on: (x86-64)

.global _start
.text
.fill (2f-1f), 1, 0x90
1:
        nop
2:

produces:

t.s: Assembler messages:
t.s:3: Warning: symbol ".L21" undefined; zero assumed

... while it works fine with backward references. Other pseudo commands like .skip work for both.

A quick hack fixes this for me without causing testsuite regressions on x86-64. However, the current
code looks intentional to me. Does anybody know what the reason is for erroring out if the symbol
isn't known yet?

diff --git a/gas/read.c b/gas/read.c
index 0b0b058..1643c5c 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -2202,7 +2202,7 @@ s_fill (int ignore ATTRIBUTE_UNUSED)
   md_cons_align (1);
 #endif

-  get_known_segmented_expression (&rep_exp);
+  expression (&rep_exp);
   if (*input_line_pointer == ',')
     {
       input_line_pointer++;

-Andreas-



More information about the Binutils mailing list