summaryrefslogtreecommitdiff
path: root/gas/expr.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2010-09-29 06:48:30 +0000
committerAlan Modra <amodra@bigpond.net.au>2010-09-29 06:48:30 +0000
commitdd9b01975df569bf02a6bed75e63dc0e14868a10 (patch)
treeb7a79ea27d417a98340e0c0b6dfda94435dd0e5d /gas/expr.c
parente5c7318d6b2574b56f4490f74bfc34d683c187c7 (diff)
downloadbinutils-redhat-dd9b01975df569bf02a6bed75e63dc0e14868a10.tar.gz
* expr.c (expr): Correct returned segment value.
Diffstat (limited to 'gas/expr.c')
-rw-r--r--gas/expr.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/gas/expr.c b/gas/expr.c
index 53952b56fa..f050b17ccb 100644
--- a/gas/expr.c
+++ b/gas/expr.c
@@ -1969,16 +1969,27 @@ expr (int rankarg, /* Larger # is higher rank. */
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"));
}