aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1993-07-19 18:46:39 +0000
committerIan Lance Taylor <ian@airs.com>1993-07-19 18:46:39 +0000
commitffffc8fb5c4c02cc43fb2e040e5f410d470c183c (patch)
tree4170e91d5bb54f1e3b8aad434ca27bed72255260 /gas
parent28403b8ee766e730a13ad2a7f2b817d1671905fd (diff)
downloadgdb-ffffc8fb5c4c02cc43fb2e040e5f410d470c183c.zip
gdb-ffffc8fb5c4c02cc43fb2e040e5f410d470c183c.tar.gz
gdb-ffffc8fb5c4c02cc43fb2e040e5f410d470c183c.tar.bz2
* expr.c (clean_up_expression): Don't cancel the subtraction of
undefined symbols. Fixes PR 2997. * read.c (s_data), config/obj-coffbfd.c (obj_coff_data): If -R, switch to text section rather than data section. Fixes PR 2971.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog8
-rw-r--r--gas/config/obj-coffbfd.c5
-rw-r--r--gas/expr.c1
-rw-r--r--gas/read.c13
4 files changed, 24 insertions, 3 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index fb772ad..0ec3e13 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,11 @@
+Mon Jul 19 14:30:00 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * expr.c (clean_up_expression): Don't cancel the subtraction of
+ undefined symbols.
+
+ * read.c (s_data), config/obj-coffbfd.c (obj_coff_data): If -R,
+ switch to text section rather than data section.
+
Mon Jul 19 12:35:39 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
* config/tc-m68k.c (m68k_ip, case AINDX): Add 6 to operand
diff --git a/gas/config/obj-coffbfd.c b/gas/config/obj-coffbfd.c
index a54ed98..88f815d 100644
--- a/gas/config/obj-coffbfd.c
+++ b/gas/config/obj-coffbfd.c
@@ -2047,7 +2047,10 @@ obj_coff_text ()
static void
obj_coff_data ()
{
- change_to_section (".data", 5, get_absolute_expression ());
+ if (flagseen['R'])
+ change_to_section (".text", 5, get_absolute_expression () + 1000);
+ else
+ change_to_section (".data", 5, get_absolute_expression ());
}
static void
diff --git a/gas/expr.c b/gas/expr.c
index a7e32df..aa1b66d 100644
--- a/gas/expr.c
+++ b/gas/expr.c
@@ -681,6 +681,7 @@ clean_up_expression (expressionP)
&& expressionP->X_add_symbol
&& (expressionP->X_subtract_symbol->sy_frag
== expressionP->X_add_symbol->sy_frag)
+ && SEG_NORMAL (S_GET_SEGMENT (expressionP->X_add_symbol))
&& (S_GET_VALUE (expressionP->X_subtract_symbol)
== S_GET_VALUE (expressionP->X_add_symbol))))
{
diff --git a/gas/read.c b/gas/read.c
index be3ea77..3785a77 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -832,13 +832,22 @@ s_comm ()
void
s_data ()
{
+ segT section;
register int temp;
temp = get_absolute_expression ();
+ if (flagseen['R'])
+ {
+ section = text_section;
+ temp += 1000;
+ }
+ else
+ section = data_section;
+
#ifdef BFD_ASSEMBLER
- subseg_set (data_section, (subsegT) temp);
+ subseg_set (section, (subsegT) temp);
#else
- subseg_new (data_section, (subsegT) temp);
+ subseg_new (section, (subsegT) temp);
#endif
#ifdef OBJ_VMS