From: Ian Lance Taylor Date: Mon, 19 Jul 1993 18:46:39 +0000 (+0000) Subject: * expr.c (clean_up_expression): Don't cancel the subtraction of X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ffffc8fb5c4c02cc43fb2e040e5f410d470c183c;p=binutils-gdb.git * 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. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index fb772ad7426..0ec3e13e0c5 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 a54ed989314..88f815d1a3c 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 a7e32df20e5..aa1b66da14e 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 be3ea77f1aa..3785a7795c8 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