From mboxrd@z Thu Jan 1 00:00:00 1970 From: Harshad R Joglekar To: Alan Modra Cc: binutils@sources.redhat.com Subject: Re: [asm] Difference of symbols in another section Date: Sat, 08 Sep 2001 08:02:00 -0000 Message-id: <3B9A33F4.C7644BD7@wipro.com> References: <200109081344.f88Diif16713@harshad.wipro.com> X-SW-Source: 2001-09/msg00122.html "Alan Modra" wrote: > > With the current assembler, you get a branch to start+2. Seems OK to me. > The assembler gives an error only when listings are enabled: Error:operation combines symbols in different segments After some debugging though, I can see why you reverted that patch. I am looking for an alternate solution. The problem is expr () converts the expression (foo - bar) to a O_constant when they are in the same frag. When listings are enabled, a dummy frag is created for each input line, so the expression will be in the data section. How about removing the check itself from expr.c (patch below)? This check is probably being done later when resolving symbols ?? regards -- Harshad Index: expr.c =================================================================== RCS file: src/binutils/gas/expr.c,v retrieving revision 1.1.1.1 diff -u -B -p -r1.1.1.1 expr.c --- expr.c 24 Jul 2001 15:59:46 -0000 1.1.1.1 +++ expr.c 8 Sep 2001 20:03:33 -0000 @@ -1701,13 +1701,6 @@ expr (rankarg, resultP) } else if (! SEG_NORMAL (retval)) retval = rightseg; - else if (SEG_NORMAL (rightseg) - && retval != rightseg -#ifdef DIFF_EXPR_OK - && op_left != O_subtract -#endif - ) - as_bad (_("operation combines symbols in different segments")); op_right = operator (&op_chars);