[RFC] .fill does not accept forward labels

Alan Modra amodra@gmail.com
Sun Oct 8 23:17:00 GMT 2017


On Fri, Oct 06, 2017 at 01:25:28PM +0200, Andreas Krebbel wrote:
> 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?

The line in question dates to 1998
48401fcf (Tom Tromey        1998-04-22 06:10:03 +0000 1669)   get_known_segmented_expression (&rep_exp);

well before gas made any attempt at multiple relaxation passes to
resolve forward references (git commit e46d99eb).  So it was a quite
reasonable restriction at the time.

> 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++;
> 

I think your patch is OK.  Please commit.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list