aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2011-03-17 11:00:47 +0000
committerAlan Modra <amodra@gmail.com>2011-03-17 11:00:47 +0000
commit520d946d176225645e970747000ced1e1ffb88d2 (patch)
tree6014948886b0f8ae4cc986905de58bbf7f47eb0d /gas
parent180ca17ad561371cacc368b18d6b1d47c2bd7a93 (diff)
downloadgdb-520d946d176225645e970747000ced1e1ffb88d2.zip
gdb-520d946d176225645e970747000ced1e1ffb88d2.tar.gz
gdb-520d946d176225645e970747000ced1e1ffb88d2.tar.bz2
PR 12569
* expr.c (operand): Correct passing of "mode" to expr. * read.c (do_org): Allow expr_section. (get_known_segmented_expression): Don't assert anything about the segment.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog8
-rw-r--r--gas/expr.c7
-rw-r--r--gas/read.c13
3 files changed, 17 insertions, 11 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index b618ea0..2c2ebf7 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,11 @@
+2011-03-17 Alan Modra <amodra@gmail.com>
+
+ PR 12569
+ * expr.c (operand): Correct passing of "mode" to expr.
+ * read.c (do_org): Allow expr_section.
+ (get_known_segmented_expression): Don't assert anything about the
+ segment.
+
2011-03-14 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Backport from mainline:
diff --git a/gas/expr.c b/gas/expr.c
index 52eb472..0563b5b 100644
--- a/gas/expr.c
+++ b/gas/expr.c
@@ -1,6 +1,6 @@
/* expr.c -operands, expressions-
Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -959,10 +959,7 @@ operand (expressionS *expressionP, enum expr_mode mode)
#endif
case '(':
/* Didn't begin with digit & not a name. */
- if (mode != expr_defer)
- segment = expression (expressionP);
- else
- segment = deferred_expression (expressionP);
+ segment = expr (0, expressionP, mode);
/* expression () will pass trailing whitespace. */
if ((c == '(' && *input_line_pointer != ')')
|| (c == '[' && *input_line_pointer != ']'))
diff --git a/gas/read.c b/gas/read.c
index ad9363a..7a5e512 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -1,7 +1,7 @@
/* read.c - read a source file -
Copyright 1986, 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2010 Free Software Foundation, Inc.
+ 2010, 2011 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -2654,7 +2654,9 @@ s_mri (int ignore ATTRIBUTE_UNUSED)
static void
do_org (segT segment, expressionS *exp, int fill)
{
- if (segment != now_seg && segment != absolute_section)
+ if (segment != now_seg
+ && segment != absolute_section
+ && segment != expr_section)
as_bad (_("invalid segment \"%s\""), segment_name (segment));
if (now_seg == absolute_section)
@@ -5417,9 +5419,9 @@ get_segmented_expression (expressionS *expP)
static segT
get_known_segmented_expression (expressionS *expP)
{
- segT retval;
+ segT retval = get_segmented_expression (expP);
- if ((retval = get_segmented_expression (expP)) == undefined_section)
+ if (retval == undefined_section)
{
/* There is no easy way to extract the undefined symbol from the
expression. */
@@ -5433,8 +5435,7 @@ get_known_segmented_expression (expressionS *expP)
expP->X_op = O_constant;
expP->X_add_number = 0;
}
- know (retval == absolute_section || SEG_NORMAL (retval));
- return (retval);
+ return retval;
}
char /* Return terminator. */