This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [asm] Difference of symbols in another section


"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);
----------------------------------------------------------------------------------------------------------------------
Information transmitted by this E-MAIL is proprietary to Wipro and/or its Customers and
is intended for use only by the individual or entity to which it is
addressed, and may contain information that is privileged, confidential or
exempt from disclosure under applicable law. If you are not the intended
recipient or it appears that this mail has been forwarded to you without
proper authority, you are notified that any use or dissemination of this
information in any manner is strictly prohibited. In such cases, please
notify us immediately at mailto:mailadmin@wipro.com and delete this mail
from your records.
----------------------------------------------------------------------------------------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]