+Tue Oct 19 18:13:26 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * config/tc-m68k.h (AOUT_MACHTYPE): Define to be external variable
+ m68k_aout_machtype.
+ * config/tc-m68k.c (omagic): Remove obsolete and unused variable.
+ (m68k_aout_machtype): New variable, if OBJ_AOUT.
+ (md_assemble): Initialize m68k_aout_machtype based on
+ current_architecture, if OBJ_AOUT.
+ (md_parse_option): Remove obsolete reference to omagic.
+
Thu Oct 14 16:51:00 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* config/tc-mips.c (md_pseudo_table): Ignore .livereg pseudo-op.
(s_option): Ignore .option O* and .option pic*.
(s_ent): Skip whitespace between symbol and optional digit.
+ (my_getSmallExpression): Handle ($xx) correctly: assume 0($xx).
* app.c (do_scrub_next_char): Always accept 'x' and 'X' as escape
characters in state 6.
included by one source file per executable. */
#include "opcode/m68k.h"
-#ifndef BFD_ASSEMBLER
-#ifdef TE_SUN
-/* This variable contains the value to write out at the beginning of
- the a.out file. The 2<<16 means that this is a 68020 file instead
- of an old-style 68000 file */
-
-long omagic = 2 << 16 | OMAGIC; /* Magic byte for header file */
-#else
-long omagic = OMAGIC;
-#endif
-#endif
-
/* This array holds the chars that always start a comment. If the
pre-processor is disabled, these aren't very useful */
CONST char comment_chars[] = "|";
const int md_reloc_size = 8; /* Size of relocation record */
/* Are we trying to generate PIC code? If so, absolute references
- ought to be made PC-relative. They aren't yet, but we can parse
- the option now so the user doesn't get an error... */
+ ought to be made into linkage table references or pc-relative
+ references. */
int flag_want_pic;
/* Its an arbitrary name: This means I don't approve of it */
TAB (PCLEA, SZ_UNDEF));
#else
addword (0x0170);
- add_fix ('l', opP->con1, 0);
+ add_fix ('l', opP->con1, 1);
addword (0), addword (0);
#endif
break;
static int no_68851, no_68881;
+#ifdef OBJ_AOUT
+/* a.out machine type. Default to 68020. */
+int m68k_aout_machtype = 2;
+#endif
+
void
md_assemble (str)
char *str;
as_bad ("options for 68881 and no-68881 both given");
if (no_68851 && (current_architecture & m68851))
as_bad ("options for 68851 and no-68851 both given");
- done_first_time = 1;
+
+#ifdef OBJ_AOUT
+ /* Work out the magic number. This isn't very general. */
+ if (current_architecture & m68000)
+ m68k_aout_machtype = 0;
+ else if (current_architecture & m68010)
+ m68k_aout_machtype = 1;
+ else if (current_architecture & m68020)
+ m68k_aout_machtype = 2;
+ else
+ m68k_aout_machtype = 2;
+#endif
}
memset ((char *) (&the_ins), '\0', sizeof (the_ins));
retval = hash_insert (op_hash, ins->name, (char *) hack);
/* Didn't his mommy tell him about null pointers? */
- if (retval && *retval)
+ if (retval)
as_bad ("Internal Error: Can't hash %s: %s", ins->name, retval);
}
* so don't use or document it, but that's the way the parsing
* works).
*
- * -k Ignored for now. (Sun 3 only. Indicates PIC.)
+ * -pic Indicates PIC.
+ * -k Indicates PIC. (Sun 3 only.)
*
* MAYBE_FLOAT_TOO is defined below so that specifying a processor type
* (e.g. m68020) also requests that float instructions be included. This
jsr's. */
break;
-#ifdef TE_SUN3
- case 'k':
- flag_want_pic = 1;
- break;
-#endif
-
case 'A':
(*argP)++;
/* intentional fall-through */
}
else if (!strcmp (*argP, "68010"))
{
-#ifdef TE_SUN
- omagic = 1 << 16 | OMAGIC;
-#endif
current_architecture |= m68010;
}
else if (!strcmp (*argP, "68020"))
case 'p':
if (!strcmp (*argP, "pic"))
{
- (*argP) += 3;
+ *argP += 3;
+ flag_want_pic = 1;
break; /* -pic, Position Independent Code */
}
else
- {
- return 0;
- } /* pic or not */
+ goto bad_arg;
+
+#ifdef TE_SUN3
+ case 'k':
+ flag_want_pic = 1;
+ break;
+#endif
default:
+ bad_arg:
return 0;
}
return 1;