aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1993-07-21 17:19:33 +0000
committerIan Lance Taylor <ian@airs.com>1993-07-21 17:19:33 +0000
commit8ff6f40e74bd92388e27618c402a73d350e727c2 (patch)
tree6f63a1f423e251770b454e9f0fd52404dc020927 /gas
parent94eebcc5721347bcfdc8319a89663f741d2f9895 (diff)
downloadgdb-8ff6f40e74bd92388e27618c402a73d350e727c2.zip
gdb-8ff6f40e74bd92388e27618c402a73d350e727c2.tar.gz
gdb-8ff6f40e74bd92388e27618c402a73d350e727c2.tar.bz2
* 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.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog14
-rw-r--r--gas/config/obj-coffbfd.c8
-rw-r--r--gas/config/tc-m88k.c42
-rw-r--r--gas/config/tc-m88k.h6
-rw-r--r--gas/read.c15
5 files changed, 46 insertions, 39 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 6ca7c10..5d911f7 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 adbf2ab7d..9a0a460 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 801748f..76f7fa5 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 eaec784..6253c1b 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 e9acac5..20b0527 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;