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.
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: binutils at sourceware dot org
- Cc: Alan Modra <amodra at gmail dot com>
- Date: Wed, 16 Mar 2011 14:31:44 -0700
- Subject: Re: [PATCH][GAS/ARM] Better handling of difference between a symbol and an undefined symbol.
- References: <AANLkTimk7gM-4et8UwjUPn28f0qn6L05RrS=GkEw2GE_@mail.gmail.com> <4CA132F7.8020803@gmail.com> <AANLkTi=LnBj7U9V3PCrtUCoHj0QPV6d2VAKOwWJMw9T9@mail.gmail.com> <4CA1465D.30105@gmail.com> <AANLkTimewc4r=wh=ACmMJYkNgHcaiYWjM_Qe8xL+LKo2@mail.gmail.com> <AANLkTimpYE-k0c+LC2_AjgrGJ4XNRLypfSEYENU=jr4X@mail.gmail.com> <4CA1682D.8080500@gmail.com> <20100928041456.GU16376@bubble.grove.modra.org> <AANLkTinddt6Or0wcCN3Gh4U22C4QzwYoBDXA0S_CH3n6@mail.gmail.com> <20100929064955.GY16376@bubble.grove.modra.org>
On Tue, Sep 28, 2010 at 11:49 PM, Alan Modra <amodra@gmail.com> wrote:
> Fails on alpha-dec-vms, arm-coff, arm-pe, rs6000-aix*, xscale-coff.
> The dec-vma fail is due to objdump disliking -j .text, the others are,
> I think, real failures.
>
> gas/
> ? ? ? ?* expr.c (expr): Correct returned segment value.
> gas/testsuite/
> ? ? ? ?* gas/all/fwdexp.d, * gas/all/fwdexp.s: New test.
> ? ? ? ?* gas/all/gas.exp: Run it.
>
> 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 23:11:49 -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"));
> ? ? ? ?}
>
This caused:
http://www.sourceware.org/bugzilla/show_bug.cgi?id=12589
--
H.J.