* read.c (read_a_source_file): If NO_PSEUDO_DOT is defined, look

up opcodes as pseudo-ops even if they don't start with '.'.
	* config/tc-m88k.h (NO_PSEUDO_DOT): Define.
	* config/tc-m88k.c (md_assemble): Removed special pseudo-op
	handling.
	(md_apply_fix): Set fx_offset to the upper 16 bits of the reloc.
	Output the low 16 bits for RELOC_HI16, not the high 16 bits.
	* config/obj-coffbfd.c (do_relocs_for): If TC_M88K, set the
	r_offset field of the reloc to the fixup offset.
	(fixup_segments): If TC_M88K, don't warn about fixup overflows.
	* doc/as.texinfo: Minor updates.
This commit is contained in:
Ian Lance Taylor 1993-07-21 17:19:33 +00:00
parent 94eebcc572
commit 8ff6f40e74
5 changed files with 46 additions and 39 deletions

View File

@ -1,3 +1,17 @@
Wed Jul 21 12:47:51 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* read.c (read_a_source_file): If NO_PSEUDO_DOT is defined, look
up opcodes as pseudo-ops even if they don't start with '.'.
* config/tc-m88k.h (NO_PSEUDO_DOT): Define.
* config/tc-m88k.c (md_assemble): Removed special pseudo-op
handling.
(md_apply_fix): Set fx_offset to the upper 16 bits of the reloc.
Output the low 16 bits for RELOC_HI16, not the high 16 bits.
* config/obj-coffbfd.c (do_relocs_for): If TC_M88K, set the
r_offset field of the reloc to the fixup offset.
(fixup_segments): If TC_M88K, don't warn about fixup overflows.
* doc/as.texinfo: Minor updates.
Tue Jul 20 19:28:56 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* Extensive changes to permit symbols to contain any expression

View File

@ -396,9 +396,11 @@ DEFUN (do_relocs_for, (abfd, h, file_cursor),
intr.r_vaddr =
base + fix_ptr->fx_frag->fr_address + fix_ptr->fx_where;
#ifdef TC_M88K
intr.r_offset = fix_ptr->fx_offset;
#else
intr.r_offset = 0;
#endif
/* Turn the segment of the symbol into an offset. */
if (symbol_ptr)
@ -2548,6 +2550,9 @@ DEFUN (fixup_segment, (segP, this_segment_type),
if (!fixP->fx_bit_fixP)
{
#ifndef TC_M88K
/* The m88k uses the offset field of the reloc to get around
this problem. */
if ((size == 1 &&
(add_number & ~0xFF) && ((add_number & ~0xFF) != (-1 & ~0xFF))) ||
(size == 2 &&
@ -2556,6 +2561,7 @@ DEFUN (fixup_segment, (segP, this_segment_type),
as_bad ("Value of %d too large for field of %d bytes at 0x%x",
add_number, size, fragP->fr_address + where);
} /* generic error checking */
#endif
#ifdef WARN_SIGNED_OVERFLOW_WORD
/* Warn if a .word value is too large when treated as
a signed number. We already know it is not too

View File

@ -235,39 +235,7 @@ md_assemble (op)
if ((format = (struct m88k_opcode *) hash_find (op_hash, op)) == NULL)
{
extern struct hash_control *po_hash;
pseudo_typeS *pop;
char *hold;
/* The m88k assembler does not use `.' before pseudo-ops, for
some reason. So if don't find an opcode, try for a
pseudo-op. */
pop = (pseudo_typeS *) hash_find (po_hash, op);
if (pop == NULL)
{
as_bad ("Invalid mnemonic '%s'", op);
return;
}
/* Restore the character after the opcode. */
*--param = c;
/* Now we have to hack. The pseudo-op code expects
input_line_pointer to point to the first non-whitespace
character after the pseudo-op itself. The calling code has
already advanced input_line_pointer to the end of the line
and inserted a null byte. We set things up for the pseudo-op
code, and then prepare to return from this function. */
hold = input_line_pointer;
*hold = ';';
input_line_pointer = param;
SKIP_WHITESPACE ();
(*pop->poc_handler) (pop->poc_val);
input_line_pointer = hold;
as_bad ("Invalid mnemonic '%s'", op);
return;
}
@ -1378,22 +1346,26 @@ md_apply_fix (fixp, val)
char *buf;
buf = fixp->fx_frag->fr_literal + fixp->fx_where;
fixp->fx_offset = 0;
switch (fixp->fx_r_type)
{
case RELOC_IW16:
fixp->fx_offset = val >> 16;
buf[2] = val >> 8;
buf[3] = val;
break;
case RELOC_LO16:
fixp->fx_offset = val >> 16;
buf[0] = val >> 8;
buf[1] = val;
break;
case RELOC_HI16:
buf[0] = val >> 24;
buf[1] = val >> 16;
fixp->fx_offset = val >> 16;
buf[0] = val >> 8;
buf[1] = val;
break;
case RELOC_PC16:

View File

@ -61,6 +61,12 @@ struct reloc_info_m88k
((name[0] =='@' && (name [1] == 'L' || name [1] == '.')) \
|| (name[0] == 'L' && name[1] == '0' && name[2] == '\001'))
/* The m88k uses pseudo-ops with no leading period. */
#define NO_PSEUDO_DOT
/* Don't warn on word overflow; it happens on %hi relocs. */
#undef WARN_SIGNED_OVERFLOW_WORD
#ifndef BFD_ASSEMBLER
#define md_convert_frag(h,f) {as_fatal ("m88k convert_frag\n");}
#else

View File

@ -445,7 +445,15 @@ read_a_source_file (name)
if (!done_pseudo (s))
#else
if (*s == '.')
pop = NULL;
#ifdef NO_PSEUDO_DOT
/* The m88k uses pseudo-ops without a period. */
pop = (pseudo_typeS *) hash_find (po_hash, s);
#endif
if (pop != NULL || *s == '.')
{
/*
* PSEUDO - OP.
@ -455,10 +463,11 @@ read_a_source_file (name)
* already know that the pseudo-op begins with a '.'.
*/
pop = (pseudo_typeS *) hash_find (po_hash, s + 1);
if (pop == NULL)
pop = (pseudo_typeS *) hash_find (po_hash, s + 1);
/* Print the error msg now, while we still can */
if (!pop)
if (pop == NULL)
{
as_bad ("Unknown pseudo-op: `%s'", s);
*input_line_pointer = c;