You should have received a copy of the GNU General Public License
along with GAS; see the file COPYING. If not, write to
- the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef GAS
#define GAS 1
/* Added #undef for DJ Delorie. The right fix is to ensure that as.h
is included first, before even any system header files, in all files
that use it. KR 1994.11.03 */
+/* Added void* version for STDC case. This is to be compatible with
+ the declaration in bison.simple, used for m68k operand parsing.
+ --KR 1995.08.08 */
+/* Force void* decl for hpux. This is what Bison uses. --KR 1995.08.16 */
/* AIX requires this to be the first thing in the file. */
#ifdef __GNUC__
#pragma alloca
# else
# ifndef alloca /* predefined by HP cc +Olibcalls */
+# if !defined (__STDC__) && !defined (__hpux)
char *alloca ();
-# endif
-# endif
-# endif
+# else
+void *alloca ();
+# endif /* __STDC__, __hpux */
+# endif /* alloca */
+# endif /* _AIX */
+# endif /* HAVE_ALLOCA_H */
#endif
/* Now, tend to the rest of the configuration. */
#ifdef DEBUG
#undef NDEBUG
#endif
+#if !defined (__GNUC__) || __GNUC_MINOR__ <= 5
+#define __PRETTY_FUNCTION__ ((char*)0)
+#endif
+#if 0
+
/* Handle lossage with assert.h. */
#ifndef BROKEN_ASSERT
#include <assert.h>
#else /* BROKEN_ASSERT */
#ifndef NDEBUG
-#define assert(p) ((p) ? 0 : (abort(), 0))
+#define assert(p) ((p) ? 0 : (as_assert (__FILE__, __LINE__, __PRETTY_FUNCTION__), 0))
#else
#define assert(p) ((p), 0)
#endif
#endif /* BROKEN_ASSERT */
+#else
+
+#define assert(P) ((P) ? 0 : (as_assert (__FILE__, __LINE__, __PRETTY_FUNCTION__), 0))
+#undef abort
+#define abort() as_abort (__FILE__, __LINE__, __PRETTY_FUNCTION__)
+
+#endif
+
/* Now GNU header files... */
#include <ansidecl.h>
#define unlink remove
#endif
+/* Hack to make "gcc -Wall" not complain about obstack macros. */
+#if !defined (memcpy) && !defined (bcopy)
+#define bcopy(src,dest,size) memcpy(dest,src,size)
+#endif
+
#ifdef BFD_ASSEMBLER
/* This one doesn't get declared, but we're using it anyways. This
should be fixed -- either it's part of the external interface or
#ifdef BFD_ASSEMBLER
#define segment_name(SEG) bfd_get_section_name (stdoutput, SEG)
#else
-extern char *const seg_name[];
+extern char const *const seg_name[];
#define segment_name(SEG) seg_name[(int) (SEG)]
#endif
/* relax() */
-typedef enum _relax_state
+enum _relax_state
{
/* Variable chars to be repeated fr_offset times.
Fr_symbol unused. Used with fr_offset == 0 for a
/* Align: Fr_offset: power of 2. Variable chars: fill pattern. */
rs_align,
+ /* Align code: fr_offset: power of 2. Fill pattern is machine
+ specific, defaulting to all zeros. */
+ rs_align_code,
+
/* Org: Fr_offset, fr_symbol: address. 1 variable char: fill
character. */
rs_org,
- rs_machine_dependent
-
#ifndef WORKING_DOT_WORD
/* JF: gunpoint */
- , rs_broken_word
+ rs_broken_word,
#endif
- } relax_stateT;
-/* typedef unsigned char relax_substateT; */
-/* JF this is more likely to leave the end of a struct frag on an align
- boundry. Be very careful with this. */
-typedef unsigned long relax_substateT;
+ /* machine-specific relaxable (or similarly alterable) instruction */
+ rs_machine_dependent,
+
+ /* .space directive with expression operand that needs to be computed
+ later. Similar to rs_org, but different.
+ fr_symbol: operand
+ 1 variable char: fill character */
+ rs_space
+ };
+
+typedef enum _relax_state relax_stateT;
+
+/* This type is used in prototypes, so it can't be a type that will be
+ widened for argument passing. */
+typedef unsigned int relax_substateT;
/* Enough bits for address, but still an integer type.
Could be a problem, cross-assembling for 64-bit machines. */
COMMON unsigned char flag_no_comments; /* -f */
COMMON unsigned char flag_debug; /* -D */
COMMON unsigned char flag_signed_overflow_ok; /* -J */
+#ifndef WORKING_DOT_WORD
COMMON unsigned char flag_warn_displacement; /* -K */
+#endif
/* True if local symbols should be retained. */
-COMMON unsigned char flag_keep_locals; /* -L */
+COMMON int flag_keep_locals; /* -L */
+
+/* True if we are assembling using MRI syntax. */
+COMMON int flag_mri;
/* Should the data section be made read-only and appended to the text
section? */
COMMON unsigned char flag_readonly_data_in_text; /* -R */
/* True if warnings should be inhibited. */
-COMMON unsigned char flag_no_warnings; /* -W */
+COMMON int flag_no_warnings; /* -W */
/* True if we should attempt to generate output even if non-fatal errors
are detected. */
/* TRUE if we should produce a listing. */
extern int listing;
+/* Maximum level of macro nesting. */
+extern int max_macro_nest;
+
struct _pseudo_type
{
/* assembler mnemonic, lower case, no '.' */
- char *poc_name;
+ const char *poc_name;
/* Do the work */
void (*poc_handler) PARAMS ((int));
/* Value to pass to handler */
typedef struct _pseudo_type pseudo_typeS;
-#ifdef BFD_ASSEMBLER_xxx
-struct lineno_struct
- {
- alent line;
- fragS *frag;
- struct lineno_struct *next;
- };
-typedef struct lineno_struct lineno;
-#endif
-
/* Prefer varargs for non-ANSI compiler, since some will barf if the
ellipsis definition is used with a no-arguments declaration. */
#if defined (HAVE_VARARGS_H) && !defined (__STDC__)
PRINTF_LIKE (as_warn);
PRINTF_WHERE_LIKE (as_bad_where);
PRINTF_WHERE_LIKE (as_warn_where);
+void as_assert PARAMS ((const char *, int, const char *));
+void as_abort PARAMS ((const char *, int, const char *));
void fprint_value PARAMS ((FILE *file, addressT value));
void sprint_value PARAMS ((char *buf, addressT value));
struct expressionS;
struct fix;
struct symbol;
+struct relax_type;
#ifdef BFD_ASSEMBLER
/* literal.c */
#include "tc.h"
#include "obj.h"
+#ifdef USE_EMULATIONS
+#include "emul.h"
+#endif
#include "listing.h"
-#ifdef BFD_ASSEMBLER
-/* Someday perhaps this will be selectable at run-time. */
-#if defined (OBJ_AOUT) || defined (OBJ_BOUT)
-#define OUTPUT_FLAVOR bfd_target_aout_flavour
+#ifndef LOCAL_LABELS_DOLLAR
+#define LOCAL_LABELS_DOLLAR 0
#endif
-#ifdef OBJ_COFF
-#define OUTPUT_FLAVOR bfd_target_coff_flavour
-#endif
-#ifdef OBJ_ECOFF
-#define OUTPUT_FLAVOR bfd_target_ecoff_flavour
-#endif
-#ifdef OBJ_ELF
-#define OUTPUT_FLAVOR bfd_target_elf_flavour
+
+#ifndef LOCAL_LABELS_FB
+#define LOCAL_LABELS_FB 0
#endif
-#endif /* BFD_ASSEMBLER */
#endif /* GAS */