aboutsummaryrefslogtreecommitdiff
path: root/gas/read.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2011-03-17 10:59:29 +0000
committerAlan Modra <amodra@gmail.com>2011-03-17 10:59:29 +0000
commit259af69e77acf64d0bce79d1be332d1cb8412cc4 (patch)
tree79af3c95ccb9b9bac803214fa49b56513ccd9e2d /gas/read.c
parent29703da4b1a5b80034c3f33b0c8f34ce6e1f08d5 (diff)
downloadgdb-259af69e77acf64d0bce79d1be332d1cb8412cc4.zip
gdb-259af69e77acf64d0bce79d1be332d1cb8412cc4.tar.gz
gdb-259af69e77acf64d0bce79d1be332d1cb8412cc4.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/read.c')
-rw-r--r--gas/read.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gas/read.c b/gas/read.c
index c38de12..68b66bc 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.
@@ -2653,7 +2653,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)
@@ -5416,9 +5418,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. */
@@ -5432,8 +5434,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. */