This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH][GAS/ARM] Better handling of difference between a symbol and an undefined symbol.
Thanks.
-Doug
在 2010年9月27日下午9:14,Alan Modra <amodra@gmail.com> 寫道:
> I'll handle it. I think the real error is in the segment we return.
> Testing the following, along with this testcase
>
> .data
> i:
> .dc.a
>
> .text
> .dc.a i + (. - .L1)
> .L1:
>
> Index: gas/expr.c
> ===================================================================
> RCS file: /cvs/src/src/gas/expr.c,v
> retrieving revision 1.84
> diff -u -p -r1.84 expr.c
> --- gas/expr.c 2 Aug 2010 13:19:44 -0000 1.84
> +++ gas/expr.c 28 Sep 2010 04:11:29 -0000
> @@ -1969,16 +1969,27 @@ expr (int rankarg, /* Larger # is highe
>
> if (retval != rightseg)
> {
> - if (! SEG_NORMAL (retval))
> - {
> - if (retval != undefined_section || SEG_NORMAL (rightseg))
> - retval = rightseg;
> - }
> - else if (SEG_NORMAL (rightseg)
> + if (retval == undefined_section)
> + ;
> + else if (rightseg == undefined_section)
> + retval = rightseg;
> + else if (retval == expr_section)
> + ;
> + else if (rightseg == expr_section)
> + retval = rightseg;
> + else if (retval == reg_section)
> + ;
> + else if (rightseg == reg_section)
> + retval = rightseg;
> + else if (rightseg == absolute_section)
> + ;
> + else if (retval == absolute_section)
> + retval = rightseg;
> #ifdef DIFF_EXPR_OK
> - && op_left != O_subtract
> + else if (op_left == O_subtract)
> + ;
> #endif
> - )
> + else
> as_bad (_("operation combines symbols in different segments"));
> }
>
>
> --
> Alan Modra
> Australia Development Lab, IBM
>