* 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.
This commit is contained in:
Ian Lance Taylor 1993-07-19 18:46:39 +00:00
parent 28403b8ee7
commit ffffc8fb5c
4 changed files with 24 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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))))
{

View File

@ -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