From 8ff6f40e74bd92388e27618c402a73d350e727c2 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 21 Jul 1993 17:19:33 +0000 Subject: [PATCH] * 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. --- gas/ChangeLog | 14 ++++++++++++++ gas/config/obj-coffbfd.c | 8 +++++++- gas/config/tc-m88k.c | 42 +++++++--------------------------------- gas/config/tc-m88k.h | 6 ++++++ gas/read.c | 15 +++++++++++--- 5 files changed, 46 insertions(+), 39 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 6ca7c104b0a..5d911f70fb5 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -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 diff --git a/gas/config/obj-coffbfd.c b/gas/config/obj-coffbfd.c index adbf2ab7df2..9a0a460a513 100644 --- a/gas/config/obj-coffbfd.c +++ b/gas/config/obj-coffbfd.c @@ -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 diff --git a/gas/config/tc-m88k.c b/gas/config/tc-m88k.c index 801748f5a38..76f7fa543a6 100644 --- a/gas/config/tc-m88k.c +++ b/gas/config/tc-m88k.c @@ -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: diff --git a/gas/config/tc-m88k.h b/gas/config/tc-m88k.h index eaec784ac54..6253c1b17aa 100644 --- a/gas/config/tc-m88k.h +++ b/gas/config/tc-m88k.h @@ -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 diff --git a/gas/read.c b/gas/read.c index e9acac588a9..20b0527064d 100644 --- a/gas/read.c +++ b/gas/read.c @@ -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; -- 2.30.2