diff options
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 15 | ||||
-rw-r--r-- | gas/Makefile.am | 22 | ||||
-rw-r--r-- | gas/Makefile.in | 28 | ||||
-rw-r--r-- | gas/config/tc-alpha.c | 2 | ||||
-rw-r--r-- | gas/config/tc-msp430.c | 1552 | ||||
-rw-r--r-- | gas/config/tc-msp430.h | 114 | ||||
-rwxr-xr-x | gas/configure | 364 | ||||
-rw-r--r-- | gas/configure.in | 1 | ||||
-rw-r--r-- | gas/doc/Makefile.am | 1 | ||||
-rw-r--r-- | gas/doc/Makefile.in | 1 | ||||
-rw-r--r-- | gas/doc/all.texi | 1 | ||||
-rw-r--r-- | gas/doc/as.texinfo | 7 | ||||
-rw-r--r-- | gas/doc/c-msp430.texi | 164 | ||||
-rw-r--r-- | gas/testsuite/ChangeLog | 7 |
14 files changed, 2104 insertions, 175 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 927d2fe..b24dcfe 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,18 @@ +2002-12-30 Dmitry Diky <diwil@mail.ru> + + * configure.in: Add msp430 target. + * configure: Regenerate. + * Makefile.am: Add msp430 target. + * Makefile.in: Regenerate. + * config/tc-msp430.c: New file: msp430 assembler. + * config/tc-msp430.h: New file: target macros for msp430. + * doc/Makefile.am: Add msp430 target. + * doc/Makefile.in: Regenerate. + * doc/as.texinfo: Include msp430 documenation. + * doc/all.texi: Enable msp430 documentation. + * doc/c-msp430.texi: New file: document msp430 specific features + of the assembler. + 2002-12-25 Alexandre Oliva <aoliva@redhat.com> * dwarf2dbg.c (DWARF2_ADDR_SIZE): New macro. diff --git a/gas/Makefile.am b/gas/Makefile.am index 7ef0218..6156608 100644 --- a/gas/Makefile.am +++ b/gas/Makefile.am @@ -66,6 +66,7 @@ CPU_TYPES = \ mmix \ mn10200 \ mn10300 \ + msp430 \ ns32k \ openrisc \ or32 \ @@ -258,6 +259,7 @@ TARGET_CPU_CFILES = \ config/tc-mmix.c \ config/tc-mn10200.c \ config/tc-mn10300.c \ + config/tc-msp430.c \ config/tc-ns32k.c \ config/tc-openrisc.c \ config/tc-or32.c \ @@ -308,6 +310,7 @@ TARGET_CPU_HFILES = \ config/tc-mmix.h \ config/tc-mn10200.h \ config/tc-mn10300.h \ + config/tc-msp430.h \ config/tc-ns32k.h \ config/tc-openrisc.h \ config/tc-or32.h \ @@ -1298,6 +1301,13 @@ DEPTC_mn10300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/mn10300.h dwarf2dbg.h +DEPTC_msp430_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-msp430.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/msp430.h +DEPTC_msp430_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h subsegs.h \ + $(INCDIR)/obstack.h $(INCDIR)/opcode/msp430.h DEPTC_ns32k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-ns32k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/opcode/ns32k.h $(INCDIR)/obstack.h @@ -1802,6 +1812,13 @@ DEPOBJ_mn10300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ struc-symbol.h $(INCDIR)/aout/aout64.h +DEPOBJ_msp430_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-msp430.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/obstack.h subsegs.h +DEPOBJ_msp430_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h subsegs.h \ + $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h DEPOBJ_ns32k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-ns32k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h @@ -2190,6 +2207,11 @@ DEP_mn10300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mn10300.h \ DEP_mn10300_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h +DEP_msp430_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-msp430.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_msp430_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h DEP_ns32k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-ns32k.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h DEP_ns32k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ns32k.h \ diff --git a/gas/Makefile.in b/gas/Makefile.in index 99ca3c4..0e6853ec 100644 --- a/gas/Makefile.in +++ b/gas/Makefile.in @@ -177,6 +177,7 @@ CPU_TYPES = \ mmix \ mn10200 \ mn10300 \ + msp430 \ ns32k \ openrisc \ or32 \ @@ -375,6 +376,7 @@ TARGET_CPU_CFILES = \ config/tc-mmix.c \ config/tc-mn10200.c \ config/tc-mn10300.c \ + config/tc-msp430.c \ config/tc-ns32k.c \ config/tc-openrisc.c \ config/tc-or32.c \ @@ -426,6 +428,7 @@ TARGET_CPU_HFILES = \ config/tc-mmix.h \ config/tc-mn10200.h \ config/tc-mn10300.h \ + config/tc-msp430.h \ config/tc-ns32k.h \ config/tc-openrisc.h \ config/tc-or32.h \ @@ -1068,6 +1071,15 @@ DEPTC_mn10300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/mn10300.h dwarf2dbg.h +DEPTC_msp430_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-msp430.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/msp430.h + +DEPTC_msp430_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h subsegs.h \ + $(INCDIR)/obstack.h $(INCDIR)/opcode/msp430.h + DEPTC_ns32k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-ns32k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/opcode/ns32k.h $(INCDIR)/obstack.h @@ -1685,6 +1697,15 @@ DEPOBJ_mn10300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ struc-symbol.h $(INCDIR)/aout/aout64.h +DEPOBJ_msp430_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-msp430.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/obstack.h subsegs.h + +DEPOBJ_msp430_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h subsegs.h \ + $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h + DEPOBJ_ns32k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-ns32k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h @@ -2184,6 +2205,13 @@ DEP_mn10300_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h +DEP_msp430_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-msp430.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + +DEP_msp430_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h + DEP_ns32k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-ns32k.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c index e546dcf..abbc96b 100644 --- a/gas/config/tc-alpha.c +++ b/gas/config/tc-alpha.c @@ -1519,6 +1519,7 @@ alpha_fix_adjustable (f) we're preventing this in the other assemblers. Follow for now. */ return 0; +#ifdef OBJ_ELF case BFD_RELOC_ALPHA_BRSGP: /* If we have a BRSGP reloc to a local symbol, adjust it to BRADDR and let it get resolved at assembly time. */ @@ -1551,6 +1552,7 @@ alpha_fix_adjustable (f) f->fx_offset += offset; return 1; } +#endif default: return 1; diff --git a/gas/config/tc-msp430.c b/gas/config/tc-msp430.c new file mode 100644 index 0000000..a07f13f --- /dev/null +++ b/gas/config/tc-msp430.c @@ -0,0 +1,1552 @@ +/* tc-msp430.c -- Assembler code for the Texas Instruments MSP430 + + Copyright (C) 2002 Free Software Foundation, Inc. + Contributed by Dmitry Diky <diwil@mail.ru> + + This file is part of GAS, the GNU Assembler. + + GAS is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GAS is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + 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, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include <limits.h> + +#define PUSH_1X_WORKAROUND +#include "as.h" +#include "subsegs.h" +#include "opcode/msp430.h" +#include "safe-ctype.h" + +const char comment_chars[] = ";"; +const char line_comment_chars[] = "#"; +const char line_separator_chars[] = ""; +const char EXP_CHARS[] = "eE"; +const char FLT_CHARS[] = "dD"; + +/* Handle long expressions. */ +extern LITTLENUM_TYPE generic_bignum[]; + +static struct hash_control *msp430_hash; + +static unsigned int msp430_operands + PARAMS ((struct msp430_opcode_s *, char *)); +static int msp430_srcoperand + PARAMS ((struct msp430_operand_s *, char *, int, int *)); +static int msp430_dstoperand + PARAMS ((struct msp430_operand_s *, char *, int)); +static char *parse_exp + PARAMS ((char *, expressionS *)); +static inline char *skip_space + PARAMS ((char *)); +static int check_reg + PARAMS ((char *)); +static void msp430_set_arch + PARAMS ((int)); +static void show_mcu_list + PARAMS ((FILE *)); +static void del_spaces + PARAMS ((char *)); + +#define MAX_OP_LEN 64 + +struct mcu_type_s +{ + char *name; + int isa; + int mach; +}; + +#define MSP430_ISA_11 11 +#define MSP430_ISA_12 12 +#define MSP430_ISA_13 13 +#define MSP430_ISA_14 14 +#define MSP430_ISA_41 41 +#define MSP430_ISA_31 31 +#define MSP430_ISA_32 32 +#define MSP430_ISA_33 33 +#define MSP430_ISA_110 110 +#define MSP430_ISA_43 43 +#define MSP430_ISA_44 44 +#define MSP430_ISA_15 15 +#define MSP430_ISA_16 16 + +#define CHECK_RELOC_MSP430 ((imm_op || byte_op)?BFD_RELOC_MSP430_16_BYTE:BFD_RELOC_MSP430_16) +#define CHECK_RELOC_MSP430_PCREL ((imm_op || byte_op)?BFD_RELOC_MSP430_16_PCREL_BYTE:BFD_RELOC_MSP430_16_PCREL) + +static struct mcu_type_s mcu_types[] = +{ + {"msp1", MSP430_ISA_11, bfd_mach_msp11}, + {"msp2", MSP430_ISA_14, bfd_mach_msp14}, + {"msp430x110", MSP430_ISA_11, bfd_mach_msp11}, + {"msp430x112", MSP430_ISA_11, bfd_mach_msp11}, + {"msp430x122", MSP430_ISA_12, bfd_mach_msp12}, + {"msp430x122", MSP430_ISA_12, bfd_mach_msp12}, + {"msp430x1222",MSP430_ISA_12, bfd_mach_msp12}, + {"msp430x123", MSP430_ISA_12, bfd_mach_msp12}, + {"msp430x1232",MSP430_ISA_12, bfd_mach_msp12}, + {"msp430x133", MSP430_ISA_13, bfd_mach_msp13}, + {"msp430x135", MSP430_ISA_13, bfd_mach_msp13}, + {"msp430x147", MSP430_ISA_14, bfd_mach_msp14}, + {"msp430x148", MSP430_ISA_14, bfd_mach_msp14}, + {"msp430x149", MSP430_ISA_14, bfd_mach_msp14}, + {"msp430x412", MSP430_ISA_41, bfd_mach_msp41}, + {"msp430x413", MSP430_ISA_41, bfd_mach_msp41}, + {"msp430x311", MSP430_ISA_31, bfd_mach_msp31}, + {"msp430x312", MSP430_ISA_31, bfd_mach_msp31}, + {"msp430x313", MSP430_ISA_31, bfd_mach_msp31}, + {"msp430x314", MSP430_ISA_31, bfd_mach_msp31}, + {"msp430x315", MSP430_ISA_31, bfd_mach_msp31}, + {"msp430x323", MSP430_ISA_32, bfd_mach_msp32}, + {"msp430x325", MSP430_ISA_32, bfd_mach_msp32}, + {"msp430x336", MSP430_ISA_33, bfd_mach_msp33}, + {"msp430x337", MSP430_ISA_33, bfd_mach_msp33}, + {"msp430x1101",MSP430_ISA_110, bfd_mach_msp110}, + {"msp430x1111",MSP430_ISA_110, bfd_mach_msp110}, + {"msp430x1121",MSP430_ISA_110, bfd_mach_msp110}, + {"msp430x1331",MSP430_ISA_13, bfd_mach_msp13}, + {"msp430x1351",MSP430_ISA_13, bfd_mach_msp13}, + {"msp430x435", MSP430_ISA_43, bfd_mach_msp43}, + {"msp430x436", MSP430_ISA_43, bfd_mach_msp43}, + {"msp430x447", MSP430_ISA_44, bfd_mach_msp44}, + {"msp430x448", MSP430_ISA_44, bfd_mach_msp44}, + {"msp430x449", MSP430_ISA_44, bfd_mach_msp44}, + {"msp430x167", MSP430_ISA_16, bfd_mach_msp16}, + {"msp430x168", MSP430_ISA_16, bfd_mach_msp16}, + {"msp430x169", MSP430_ISA_16, bfd_mach_msp16}, + {"msp430x155", MSP430_ISA_15, bfd_mach_msp15}, + {"msp430x156", MSP430_ISA_15, bfd_mach_msp15}, + {"msp430x157", MSP430_ISA_15, bfd_mach_msp15}, + + {NULL, 0, 0} +}; + + +static struct mcu_type_s default_mcu = + { "msp430x11", MSP430_ISA_11, bfd_mach_msp11 }; + +static struct mcu_type_s *msp430_mcu = &default_mcu; + +const pseudo_typeS md_pseudo_table[] = +{ + {"arch", msp430_set_arch, 0}, + {NULL, NULL, 0} +}; + +#define OPTION_MMCU 'm' + +const char *md_shortopts = "m:"; + +struct option md_longopts[] = +{ + {"mmcu", required_argument, NULL, OPTION_MMCU}, + {NULL, no_argument, NULL, 0} +}; + +size_t md_longopts_size = sizeof (md_longopts); + +static void +show_mcu_list (stream) + FILE *stream; +{ + int i; + + fprintf (stream, _("Known MCU names:\n")); + + for (i = 0; mcu_types[i].name; i++) + fprintf (stream, _("\t %s\n"), mcu_types[i].name); + + fprintf (stream, "\n"); +} + +void +md_show_usage (stream) + FILE *stream; +{ + fprintf (stream, + _("MSP430 options:\n" + " -mmcu=[msp430-name] select microcontroller type\n" + " msp430x1101 msp430x1111 msp430x1121\n" + " msp430x1331 msp430x1351\n" + " msp430x1222 msp430x1232\n" + " msp430x311 msp430x312 msp430x313 msp430x314 msp430x315\n" + " msp430x323 msp430x325\n" + " msp430x336 msp430x337\n" + " msp430x412 msp430x413\n" + " msp430x110 msp430x112\n" + " msp430x122 msp430x123\n" + " msp430x133 msp430x135\n" + " msp430x147 msp430x148 msp430x149\n" + " msp430x167 msp430x168 msp430x169\n" + " msp430x155 msp430x156 msp430x157\n" + " msp430x447 msp430x448 msp430x449\n" + " msp430x435 msp430x436\n")); + + show_mcu_list (stream); +} + +static char * +extract_word (char *from, char *to, int limit) +{ + char *op_start; + char *op_end; + int size = 0; + + /* Drop leading whitespace. */ + from = skip_space (from); + *to = 0; + + /* Find the op code end. */ + for (op_start = op_end = from; *op_end != 0 && is_part_of_name (*op_end);) + { + to[size++] = *op_end++; + if (size + 1 >= limit) + break; + } + + to[size] = 0; + return op_end; +} + +static void +msp430_set_arch (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + char *str = (char *) alloca (32); /* 32 for good measure. */ + + input_line_pointer = extract_word (input_line_pointer, str, 32); + + md_parse_option (OPTION_MMCU, str); + bfd_set_arch_mach (stdoutput, TARGET_ARCH, msp430_mcu->mach); +} + +int +md_parse_option (c, arg) + int c; + char *arg; +{ + int i; + + switch (c) + { + case OPTION_MMCU: + for (i = 0; mcu_types[i].name; ++i) + if (strcmp (mcu_types[i].name, arg) == 0) + break; + + if (!mcu_types[i].name) + { + show_mcu_list (stderr); + as_fatal (_("unknown MCU: %s\n"), arg); + } + + if (msp430_mcu == &default_mcu || msp430_mcu->mach == mcu_types[i].mach) + msp430_mcu = &mcu_types[i]; + else + as_fatal (_("redefinition of mcu type %s' to %s'"), + msp430_mcu->name, mcu_types[i].name); + return 1; + } + + return 0; +} + +symbolS * +md_undefined_symbol (name) + char *name ATTRIBUTE_UNUSED; +{ + return 0; +} + +static inline char * +skip_space (s) + char *s; +{ + while (ISSPACE (*s)) + ++s; + return s; +} + +/* Delete spaces from s: X ( r 1 2) => X(r12). */ + +static void +del_spaces (s) + char *s; +{ + while (*s) + { + if (ISSPACE (*s)) + { + char *m = s + 1; + + while (ISSPACE (*m) && *m) + m++; + memmove (s, m, strlen (m) + 1); + } + else + s++; + } +} + +/* Extract one word from FROM and copy it to TO. Delimeters are ",;\n" */ + +static char * +extract_operand (char *from, char *to, int limit) +{ + int size = 0; + + /* Drop leading whitespace. */ + from = skip_space (from); + + while (size < limit && *from) + { + *(to + size) = *from; + if (*from == ',' || *from == ';' || *from == '\n') + break; + from++; + size++; + } + + *(to + size) = 0; + del_spaces (to); + + from++; + + return from; +} + +static char * +extract_cmd (char *from, char *to, int limit) +{ + int size = 0; + + while (*from && ! ISSPACE (*from) && *from != '.' && limit > size) + { + *(to + size) = *from; + from++; + size++; + } + + *(to + size) = 0; + + return from; +} + +/* Turn a string in input_line_pointer into a floating point constant + of type TYPE, and store the appropriate bytes in *LITP. The number + of LITTLENUMS emitted is stored in *SIZEP. An error message is + returned, or NULL on OK. */ + +char * +md_atof (type, litP, sizeP) + int type; + char *litP; + int *sizeP; +{ + int prec; + LITTLENUM_TYPE words[4]; + LITTLENUM_TYPE *wordP; + char *t; + + switch (type) + { + case 'f': + prec = 2; + break; + case 'd': + prec = 4; + break; + default: + *sizeP = 0; + return _("bad call to md_atof"); + } + + t = atof_ieee (input_line_pointer, type, words); + if (t) + input_line_pointer = t; + + *sizeP = prec * sizeof (LITTLENUM_TYPE); + + /* This loop outputs the LITTLENUMs in REVERSE order. */ + for (wordP = words + prec - 1; prec--;) + { + md_number_to_chars (litP, (valueT) (*wordP--), sizeof (LITTLENUM_TYPE)); + litP += sizeof (LITTLENUM_TYPE); + } + + return NULL; +} + +void +md_convert_frag (abfd, sec, fragP) + bfd *abfd ATTRIBUTE_UNUSED; + asection *sec ATTRIBUTE_UNUSED; + fragS *fragP ATTRIBUTE_UNUSED; +{ + abort (); +} + +void +md_begin () +{ + struct msp430_opcode_s *opcode; + msp430_hash = hash_new (); + + for (opcode = msp430_opcodes; opcode->name; opcode++) + hash_insert (msp430_hash, opcode->name, (char *) opcode); + + bfd_set_arch_mach (stdoutput, TARGET_ARCH, msp430_mcu->mach); +} + +void +md_assemble (str) + char *str; +{ + struct msp430_opcode_s *opcode; + char cmd[32]; + unsigned int i = 0; + + str = skip_space (str); /* Skip leading spaces. */ + str = extract_cmd (str, cmd, sizeof (cmd)); + + while (cmd[i] && i < sizeof (cmd)) + { + char a = tolower (cmd[i]); + cmd[i] = a; + i++; + } + + if (!cmd[0]) + { + as_bad (_("can't find opcode ")); + return; + } + + opcode = (struct msp430_opcode_s *) hash_find (msp430_hash, cmd); + + if (opcode == NULL) + { + as_bad (_("unknown opcode `%s'"), cmd); + return; + } + + { + char *__t = input_line_pointer; + msp430_operands (opcode, str); + input_line_pointer = __t; + } +} + +/* Parse instruction operands. + Return binary opcode. */ + +static unsigned int +msp430_operands (opcode, line) + struct msp430_opcode_s *opcode; + char *line; +{ + int bin = opcode->bin_opcode; /* opcode mask. */ + int __is; + char l1[MAX_OP_LEN], l2[MAX_OP_LEN]; + char *frag; + int where; + struct msp430_operand_s op1, op2; + int res = 0; + static short ZEROS = 0; + int byte_op, imm_op; + + /* opcode is the one from opcodes table + line contains something like + [.w] @r2+, 5(R1) + or + .b @r2+, 5(R1). */ + + /* Check if byte or word operation. */ + if (*line == '.' && tolower (*(line + 1)) == 'b') + { + bin |= BYTE_OPERATION; + byte_op = 1; + } + else + byte_op = 0; + + /* skip .[bwBW]. */ + while (! ISSPACE (*line) && *line) + line++; + + if (opcode->insn_opnumb && (!*line || *line == '\n')) + { + as_bad (_("instruction %s requires %d operand(s)"), + opcode->name, opcode->insn_opnumb); + return 0; + } + + memset (l1, 0, sizeof (l1)); + memset (l2, 0, sizeof (l2)); + memset (&op1, 0, sizeof (op1)); + memset (&op2, 0, sizeof (op2)); + + imm_op = 0; + + switch (opcode->fmt) + { + case 0: /* Emulated. */ + switch (opcode->insn_opnumb) + { + case 0: + /* Set/clear bits instructions. */ + __is = 2; + frag = frag_more (__is); + bfd_putl16 ((bfd_vma) bin, frag); + break; + case 1: + /* Something which works with destination operand. */ + line = extract_operand (line, l1, sizeof (l1)); + res = msp430_dstoperand (&op1, l1, opcode->bin_opcode); + if (res) + break; + + bin |= (op1.reg | (op1.am << 7)); + __is = 1 + op1.ol; + frag = frag_more (2 * __is); + where = frag - frag_now->fr_literal; + bfd_putl16 ((bfd_vma) bin, frag); + + if (op1.mode == OP_EXP) + { + where += 2; + bfd_putl16 ((bfd_vma) ZEROS, frag + 2); + + if (op1.reg) + fix_new_exp (frag_now, where, 2, + &(op1.exp), FALSE, CHECK_RELOC_MSP430); + else + fix_new_exp (frag_now, where, 2, + &(op1.exp), TRUE, CHECK_RELOC_MSP430_PCREL); + } + break; + + case 2: + { + char l2[16]; + + /* Shift instruction. */ + line = extract_operand (line, l1, sizeof (l1)); + strncpy (l2, l1, 16); + res = msp430_srcoperand (&op1, l1, opcode->bin_opcode, &imm_op); + res += msp430_dstoperand (&op2, l2, opcode->bin_opcode); + + if (res) + break; /* An error occured. All warnings were done before. */ + + bin |= (op2.reg | (op1.reg << 8) | (op1.am << 4) | (op2.am << 7)); + + __is = 1 + op1.ol + op2.ol; /* insn size in words. */ + frag = frag_more (2 * __is); + where = frag - frag_now->fr_literal; + bfd_putl16 ((bfd_vma) bin, frag); + + if (op1.mode == OP_EXP) + { + where += 2; /* Advance 'where' as we do not know _where_. */ + bfd_putl16 ((bfd_vma) ZEROS, frag + 2); + + if (op1.reg || (op1.reg == 0 && op1.am == 3)) /* Not PC relative. */ + fix_new_exp (frag_now, where, 2, + &(op1.exp), FALSE, CHECK_RELOC_MSP430); + else + fix_new_exp (frag_now, where, 2, + &(op1.exp), TRUE, CHECK_RELOC_MSP430_PCREL); + } + + if (op2.mode == OP_EXP) + { + imm_op = 0; + bfd_putl16 ((bfd_vma) ZEROS, frag + 2 + ((__is == 3) ? 2 : 0)); + + if (op2.reg) /* Not PC relative. */ + fix_new_exp (frag_now, where + 2, 2, + &(op2.exp), FALSE, CHECK_RELOC_MSP430); + else + fix_new_exp (frag_now, where + 2, 2, + &(op2.exp), TRUE, CHECK_RELOC_MSP430_PCREL); + } + break; + } + case 3: + /* Branch instruction => mov dst, r0. */ + line = extract_operand (line, l1, sizeof (l1)); + + res = msp430_srcoperand (&op1, l1, opcode->bin_opcode, &imm_op); + if (res) + break; + + byte_op = 0; + imm_op = 0; + + bin |= ((op1.reg << 8) | (op1.am << 4)); + __is = 1 + op1.ol; + frag = frag_more (2 * __is); + where = frag - frag_now->fr_literal; + bfd_putl16 ((bfd_vma) bin, frag); + + if (op1.mode == OP_EXP) + { + where += 2; + bfd_putl16 ((bfd_vma) ZEROS, frag + 2); + + if (op1.reg || (op1.reg == 0 && op1.am == 3)) + fix_new_exp (frag_now, where, 2, + &(op1.exp), FALSE, CHECK_RELOC_MSP430); + else + fix_new_exp (frag_now, where, 2, + &(op1.exp), TRUE, CHECK_RELOC_MSP430_PCREL); + } + break; + } + break; + + case 1: /* Format 1, double operand. */ + line = extract_operand (line, l1, sizeof (l1)); + line = extract_operand (line, l2, sizeof (l2)); + res = msp430_srcoperand (&op1, l1, opcode->bin_opcode, &imm_op); + res += msp430_dstoperand (&op2, l2, opcode->bin_opcode); + + if (res) + break; /* Error occured. All warnings were done before. */ + + bin |= (op2.reg | (op1.reg << 8) | (op1.am << 4) | (op2.am << 7)); + + __is = 1 + op1.ol + op2.ol; /* insn size in words. */ + frag = frag_more (2 * __is); + where = frag - frag_now->fr_literal; + bfd_putl16 ((bfd_vma) bin, frag); + + if (op1.mode == OP_EXP) + { + where += 2; /* Advance where as we do not know _where_. */ + bfd_putl16 ((bfd_vma) ZEROS, frag + 2); + + if (op1.reg || (op1.reg == 0 && op1.am == 3)) /* Not PC relative. */ + fix_new_exp (frag_now, where, 2, + &(op1.exp), FALSE, CHECK_RELOC_MSP430); + else + fix_new_exp (frag_now, where, 2, + &(op1.exp), TRUE, CHECK_RELOC_MSP430_PCREL); + } + + if (op2.mode == OP_EXP) + { + imm_op = 0; + bfd_putl16 ((bfd_vma) ZEROS, frag + 2 + ((__is == 3) ? 2 : 0)); + + if (op2.reg) /* Not PC relative. */ + fix_new_exp (frag_now, where + 2, 2, + &(op2.exp), FALSE, CHECK_RELOC_MSP430); + else + fix_new_exp (frag_now, where + 2, 2, + &(op2.exp), TRUE, CHECK_RELOC_MSP430_PCREL); + } + break; + + case 2: /* Single-operand mostly instr. */ + if (opcode->insn_opnumb == 0) + { + /* reti instruction. */ + frag = frag_more (2); + bfd_putl16 ((bfd_vma) bin, frag); + break; + } + + line = extract_operand (line, l1, sizeof (l1)); + res = msp430_srcoperand (&op1, l1, opcode->bin_opcode, &imm_op); + if (res) + break; /* Error in operand. */ + + bin |= op1.reg | (op1.am << 4); + __is = 1 + op1.ol; + frag = frag_more (2 * __is); + where = frag - frag_now->fr_literal; + bfd_putl16 ((bfd_vma) bin, frag); + + if (op1.mode == OP_EXP) + { + bfd_putl16 ((bfd_vma) ZEROS, frag + 2); + + if (op1.reg || (op1.reg == 0 && op1.am == 3)) /* Not PC relative. */ + fix_new_exp (frag_now, where + 2, 2, + &(op1.exp), FALSE, CHECK_RELOC_MSP430); + else + fix_new_exp (frag_now, where + 2, 2, + &(op1.exp), TRUE, CHECK_RELOC_MSP430_PCREL); + } + break; + + case 3: /* Conditional jumps instructions. */ + line = extract_operand (line, l1, sizeof (l1)); + /* l1 is a label. */ + if (l1[0]) + { + char *m = l1; + expressionS exp; + + if (*m == '$') + m++; + + parse_exp (m, &exp); + frag = frag_more (2); /* Instr size is 1 word. */ + + /* In order to handle something like: + + and #0x8000, r5 + tst r5 + jz 4 ; skip next 4 bytes + inv r5 + inc r5 + nop ; will jump here if r5 positive or zero + + jCOND -n ;assumes jump n bytes backward: + + mov r5,r6 + jmp -2 + + is equial to: + lab: + mov r5,r6 + jmp lab + + jCOND $n ; jump from PC in either direction. */ + + if (exp.X_op == O_constant) + { + int x = exp.X_add_number; + + if (x & 1) + { + as_warn (_("Even number required. Rounded to %d"), x + 1); + x++; + } + + if ((*l1 == '$' && x > 0) || x < 0) + x -= 2; + + x >>= 1; + + if (x > 512 || x < -511) + { + as_bad (_("Wrong displacement %d"), x << 1); + break; + } + + bin |= x & 0x3ff; + bfd_putl16 ((bfd_vma) bin, frag); + } + else if (exp.X_op == O_symbol && *l1 != '$') + { + where = frag - frag_now->fr_literal; + fix_new_exp (frag_now, where, 2, + &exp, TRUE, BFD_RELOC_MSP430_10_PCREL); + + bfd_putl16 ((bfd_vma) bin, frag); + } + else if (*l1 == '$') + { + as_bad (_("instruction requires label sans '$'")); + break; + } + else + { + as_bad (_ + ("instruction requires label or value in range -511:512")); + break; + } + } + else + { + as_bad (_("instruction requires label")); + break; + } + break; + + default: + as_bad (_("Ilegal instruction or not implmented opcode.")); + } + + input_line_pointer = line; + return 0; +} + +static int +msp430_dstoperand (op, l, bin) + struct msp430_operand_s *op; + char *l; + int bin; +{ + int dummy; + int ret = msp430_srcoperand (op, l, bin, &dummy); + if (ret) + return ret; + + if (op->am == 2) + { + char *__tl = "0"; + + op->mode = OP_EXP; + op->am = 1; + op->ol = 1; + parse_exp (__tl, &(op->exp)); + if (op->exp.X_op != O_constant || op->exp.X_add_number != 0) + { + as_bad (_("Internal bug. Try to use 0(r%d) instead of @r%d"), + op->reg, op->reg); + return 1; + } + return 0; + } + + if (op->am > 1) + { + as_bad (_ + ("this addressing mode is not applicable for destination operand")); + return 1; + } + return 0; +} + + +static int +check_reg (t) + char *t; +{ + /* If this is a reg numb, str 't' must be a number from 0 - 15. */ + + if (strlen (t) > 2 && *(t + 2) != '+') + return 1; + + while (*t) + { + if ((*t < '0' || *t > '9') && *t != '+') + break; + t++; + } + + if (*t) + return 1; + + return 0; +} + + +static int +msp430_srcoperand (op, l, bin, imm_op) + struct msp430_operand_s *op; + char *l; + int bin; + int *imm_op; +{ + char *__tl = l; + + /* Check if an immediate #VALUE. The hash sign should be only at the beginning! */ + if (*l == '#') + { + char *h = l; + int vshift = -1; + int rval = 0; + + /* Check if there is: + llo(x) - least significant 16 bits, x &= 0xffff + lhi(x) - x = (x >> 16) & 0xffff, + hlo(x) - x = (x >> 32) & 0xffff, + hhi(x) - x = (x >> 48) & 0xffff + The value _MUST_ be constant expression: #hlo(1231231231). */ + + *imm_op = 1; + + if (strncasecmp (h, "#llo(", 5) == 0) + { + vshift = 0; + rval = 3; + } + else if (strncasecmp (h, "#lhi(", 5) == 0) + { + vshift = 1; + rval = 3; + } + else if (strncasecmp (h, "#hlo(", 5) == 0) + { + vshift = 2; + rval = 3; + } + else if (strncasecmp (h, "#hhi(", 5) == 0) + { + vshift = 3; + rval = 3; + } + else if (strncasecmp (h, "#lo(", 4) == 0) + { + vshift = 0; + rval = 2; + } + else if (strncasecmp (h, "#hi(", 4) == 0) + { + vshift = 1; + rval = 2; + } + + op->reg = 0; /* Reg PC. */ + op->am = 3; + op->ol = 1; /* Immediate will follow an instruction. */ + __tl = h + 1 + rval; + op->mode = OP_EXP; + parse_exp (__tl, &(op->exp)); + if (op->exp.X_op == O_constant) + { + int x = op->exp.X_add_number; + + if (vshift == 0) + { + x = x & 0xffff; + op->exp.X_add_number = x; + } + else if (vshift == 1) + { + x = (x >> 16) & 0xffff; + op->exp.X_add_number = x; + } + else if (vshift > 1) + { + if (x < 0) + op->exp.X_add_number = -1; + else + op->exp.X_add_number = 0; /* Nothing left. */ + x = op->exp.X_add_number; + } + + if (op->exp.X_add_number > 65535 || op->exp.X_add_number < -32768) + { + as_bad (_("value %ld out of range. Use #lo() or #hi()"), x); + return 1; + } + + /* Now check constants. */ + /* Substitude register mode with a constant generator if applicable. */ + + x = (short) x; /* Extend sign. */ + + if (x == 0) + { + op->reg = 3; + op->am = 0; + op->ol = 0; + op->mode = OP_REG; + } + else if (x == 1) + { + op->reg = 3; + op->am = 1; + op->ol = 0; + op->mode = OP_REG; + } + else if (x == 2) + { + op->reg = 3; + op->am = 2; + op->ol = 0; + op->mode = OP_REG; + } + else if (x == -1) + { + op->reg = 3; + op->am = 3; + op->ol = 0; + op->mode = OP_REG; + } + else if (x == 4) + { +#ifdef PUSH_1X_WORKAROUND + if (bin == 0x1200 + && (msp430_mcu->isa == MSP430_ISA_11 + || msp430_mcu->isa == MSP430_ISA_12 + || msp430_mcu->isa == MSP430_ISA_13 + || msp430_mcu->isa == MSP430_ISA_14)) + { + /* Remove warning as confusing. + as_warn(_("Hardware push bug workaround")); */ + } + else +#endif + { + op->reg = 2; + op->am = 2; + op->ol = 0; + op->mode = OP_REG; + } + } + else if (x == 8) + { +#ifdef PUSH_1X_WORKAROUND + if (bin == 0x1200 + && (msp430_mcu->isa == MSP430_ISA_11 + || msp430_mcu->isa == MSP430_ISA_12 + || msp430_mcu->isa == MSP430_ISA_13 + || msp430_mcu->isa == MSP430_ISA_14)) + { + /* Remove warning as confusing. + as_warn(_("Hardware push bug workaround")); */ + } + else +#endif + { + op->reg = 2; + op->am = 3; + op->ol = 0; + op->mode = OP_REG; + } + } + } + else if (op->exp.X_op == O_symbol) + { + op->mode = OP_EXP; + } + else if (op->exp.X_op == O_big) + { + short x; + if (vshift != -1) + { + op->exp.X_op = O_constant; + op->exp.X_add_number = 0xffff & generic_bignum[vshift]; + x = op->exp.X_add_number; + } + else + { + as_bad (_ + ("unknown expression in operand %s. use #llo() #lhi() #hlo() #hhi() "), + l); + return 1; + } + + if (x == 0) + { + op->reg = 3; + op->am = 0; + op->ol = 0; + op->mode = OP_REG; + } + else if (x == 1) + { + op->reg = 3; + op->am = 1; + op->ol = 0; + op->mode = OP_REG; + } + else if (x == 2) + { + op->reg = 3; + op->am = 2; + op->ol = 0; + op->mode = OP_REG; + } + else if (x == -1) + { + op->reg = 3; + op->am = 3; + op->ol = 0; + op->mode = OP_REG; + } + else if (x == 4) + { + op->reg = 2; + op->am = 2; + op->ol = 0; + op->mode = OP_REG; + } + else if (x == 8) + { + op->reg = 2; + op->am = 3; + op->ol = 0; + op->mode = OP_REG; + } + } + else + { + as_bad (_("unknown operand %s"), l); + } + return 0; + } + + /* Check if absolute &VALUE (assume that we can construct something like ((a&b)<<7 + 25). */ + if (*l == '&') + { + char *h = l; + + op->reg = 2; /* reg 2 in absolute addr mode. */ + op->am = 1; /* mode As == 01 bin. */ + op->ol = 1; /* Immediate value followed by instruction. */ + __tl = h + 1; + parse_exp (__tl, &(op->exp)); + op->mode = OP_EXP; + if (op->exp.X_op == O_constant) + { + int x = op->exp.X_add_number; + if (x > 65535 || x < -32768) + { + as_bad (_("value out of range: %d"), x); + return 1; + } + } + else if (op->exp.X_op == O_symbol) + { + } + else + { + as_bad (_("unknown expression in operand %s"), l); + return 1; + } + return 0; + } + + /* Check if inderect register mode @Rn / postincrement @Rn+. */ + if (*l == '@') + { + char *t = l; + char *m = strchr (l, '+'); + + if (t != l) + { + as_bad (_("unknown addressing mode %s"), l); + return 1; + } + + t++; + if (*t != 'r' && *t != 'R') + { + as_bad (_("unknown addressing mode %s"), l); + return 1; + } + + t++; /* Points to the reg value. */ + + if (check_reg (t)) + { + as_bad (_("Bad register name r%s"), t); + return 1; + } + + op->mode = OP_REG; + op->am = m ? 3 : 2; + op->ol = 0; + if (m) + *m = 0; /* strip '+' */ + op->reg = atoi (t); + if (op->reg < 0 || op->reg > 15) + { + as_bad (_("MSP430 does not have %d registers"), op->reg); + return 1; + } + + return 0; + } + + /* Check if register indexed X(Rn). */ + do + { + char *h = strrchr (l, '('); + char *m = strrchr (l, ')'); + char *t; + + *imm_op = 1; + + if (!h) + break; + if (!m) + { + as_bad (_("')' required")); + return 1; + } + + t = h; + op->am = 1; + op->ol = 1; + /* Extract a register. */ + t++; /* Advance pointer. */ + + if (*t != 'r' && *t != 'R') + { + as_bad (_ + ("unknown operator %s. Did you mean X(Rn) or #[hl][hl][oi](CONST) ?"), + l); + return 1; + } + t++; + + op->reg = *t - '0'; + if (op->reg > 9 || op->reg < 0) + { + as_bad (_("unknown operator (r%s substituded as a register name"), + t); + return 1; + } + t++; + if (*t != ')') + { + op->reg = op->reg * 10; + op->reg += *t - '0'; + + if (op->reg > 15) + { + as_bad (_("unknown operator %s"), l); + return 1; + } + if (op->reg == 2) + { + as_bad (_("r2 should not be used in indexed addressing mode")); + return 1; + } + + if (*(t + 1) != ')') + { + as_bad (_("unknown operator %s"), l); + return 1; + } + } + + /* Extract constant. */ + __tl = l; + *h = 0; + op->mode = OP_EXP; + parse_exp (__tl, &(op->exp)); + if (op->exp.X_op == O_constant) + { + int x = op->exp.X_add_number; + + if (x > 65535 || x < -32768) + { + as_bad (_("value out of range: %d"), x); + return 1; + } + + if (x == 0) + { + op->mode = OP_REG; + op->am = 2; + op->ol = 0; + return 0; + } + } + else if (op->exp.X_op == O_symbol) + { + } + else + { + as_bad (_("unknown expression in operand %s"), l); + return 1; + } + + return 0; + } + while (0); + + /* Register mode 'mov r1,r2'. */ + do + { + char *t = l; + + /* Operand should be a register. */ + if (*t == 'r' || *t == 'R') + { + int x = atoi (t + 1); + + if (check_reg (t + 1)) + break; + + if (x < 0 || x > 15) + break; /* Symbolic mode. */ + + op->mode = OP_REG; + op->am = 0; + op->ol = 0; + op->reg = x; + return 0; + } + } + while (0); + + /* Symbolic mode 'mov a, b' == 'mov x(pc), y(pc)'. */ + do + { + char *t = l; + + __tl = l; + + while (*t) + { + /* alpha/number underline dot for labels. */ + if (! ISALNUM (*t) && *t != '_' && *t != '.') + { + as_bad (_("unknown operand %s"), l); + return 1; + } + t++; + } + + op->mode = OP_EXP; + op->reg = 0; /* PC relative... be careful. */ + op->am = 1; + op->ol = 1; + __tl = l; + parse_exp (__tl, &(op->exp)); + return 0; + } + while (0); + + /* Unreachable. */ + as_bad (_("unknown addressing mode for operand %s"), l); + return 1; +} + + +/* GAS will call this function for each section at the end of the assembly, + to permit the CPU backend to adjust the alignment of a section. */ + +valueT +md_section_align (seg, addr) + asection *seg; + valueT addr; +{ + int align = bfd_get_section_alignment (stdoutput, seg); + + return ((addr + (1 << align) - 1) & (-1 << align)); +} + +/* If you define this macro, it should return the offset between the + address of a PC relative fixup and the position from which the PC + relative adjustment should be made. On many processors, the base + of a PC relative instruction is the next instruction, so this + macro would return the length of an instruction. */ + +long +md_pcrel_from_section (fixp, sec) + fixS *fixp; + segT sec; +{ + if (fixp->fx_addsy != (symbolS *) NULL + && (!S_IS_DEFINED (fixp->fx_addsy) + || (S_GET_SEGMENT (fixp->fx_addsy) != sec))) + return 0; + + return fixp->fx_frag->fr_address + fixp->fx_where; +} + +/* GAS will call this for each fixup. It should store the correct + value in the object file. */ + +void +md_apply_fix3 (fixp, valuep, seg) + fixS *fixp; + valueT *valuep; + segT seg; +{ + unsigned char *where; + unsigned long insn; + long value; + + if (fixp->fx_addsy == (symbolS *) NULL) + { + value = *valuep; + fixp->fx_done = 1; + } + else if (fixp->fx_pcrel) + { + segT s = S_GET_SEGMENT (fixp->fx_addsy); + + if (fixp->fx_addsy && (s == seg || s == absolute_section)) + { + value = S_GET_VALUE (fixp->fx_addsy) + *valuep; + fixp->fx_done = 1; + } + else + value = *valuep; + } + else + { + value = fixp->fx_offset; + + if (fixp->fx_subsy != (symbolS *) NULL) + { + if (S_GET_SEGMENT (fixp->fx_subsy) == absolute_section) + { + value -= S_GET_VALUE (fixp->fx_subsy); + fixp->fx_done = 1; + } + else + { + /* We don't actually support subtracting a symbol. */ + as_bad_where (fixp->fx_file, fixp->fx_line, + _("expression too complex")); + } + } + } + + switch (fixp->fx_r_type) + { + default: + fixp->fx_no_overflow = 1; + break; + case BFD_RELOC_MSP430_10_PCREL: + break; + } + + if (fixp->fx_done) + { + /* Fetch the instruction, insert the fully resolved operand + value, and stuff the instruction back again. */ + + where = fixp->fx_frag->fr_literal + fixp->fx_where; + + insn = bfd_getl16 (where); + + switch (fixp->fx_r_type) + { + case BFD_RELOC_MSP430_10_PCREL: + if (value & 1) + as_bad_where (fixp->fx_file, fixp->fx_line, + _("odd address operand: %ld"), value); + + /* Jumps are in words. */ + value >>= 1; + --value; /* Correct PC. */ + + if (value < -512 || value > 511) + as_bad_where (fixp->fx_file, fixp->fx_line, + _("operand out of range: %ld"), value); + + value &= 0x3ff; /* get rid of extended sign */ + bfd_putl16 ((bfd_vma) (value | insn), where); + break; + + case BFD_RELOC_MSP430_16_PCREL: + if (value & 1) + as_bad_where (fixp->fx_file, fixp->fx_line, + _("odd address operand: %ld"), value); + + /* Nothing to be corrected here. */ + if (value < -32768 || value > 65536) + as_bad_where (fixp->fx_file, fixp->fx_line, + _("operand out of range: %ld"), value); + + value &= 0xffff; /* Get rid of extended sign. */ + bfd_putl16 ((bfd_vma) value, where); + break; + + case BFD_RELOC_MSP430_16_PCREL_BYTE: + /* Nothing to be corrected here. */ + if (value < -32768 || value > 65536) + as_bad_where (fixp->fx_file, fixp->fx_line, + _("operand out of range: %ld"), value); + + value &= 0xffff; /* Get rid of extended sign. */ + bfd_putl16 ((bfd_vma) value, where); + break; + + case BFD_RELOC_32: + bfd_putl16 ((bfd_vma) value, where); + break; + + case BFD_RELOC_MSP430_16: + case BFD_RELOC_16: + case BFD_RELOC_MSP430_16_BYTE: + value &= 0xffff; + bfd_putl16 ((bfd_vma) value, where); + break; + + default: + as_fatal (_("line %d: unknown relocation type: 0x%x"), + fixp->fx_line, fixp->fx_r_type); + break; + } + } + else + { + fixp->fx_addnumber = value; + } + return; +} + +/* A `BFD_ASSEMBLER' GAS will call this to generate a reloc. GAS + will pass the resulting reloc to `bfd_install_relocation'. This + currently works poorly, as `bfd_install_relocation' often does the + wrong thing, and instances of `tc_gen_reloc' have been written to + work around the problems, which in turns makes it difficult to fix + `bfd_install_relocation'. */ + +/* If while processing a fixup, a reloc really needs to be created + then it is done here. */ + +arelent * +tc_gen_reloc (seg, fixp) + asection *seg ATTRIBUTE_UNUSED; + fixS *fixp; +{ + arelent *reloc; + + reloc = (arelent *) xmalloc (sizeof (arelent)); + + reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); + *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); + + reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; + reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type); + if (reloc->howto == (reloc_howto_type *) NULL) + { + as_bad_where (fixp->fx_file, fixp->fx_line, + _("reloc %d not supported by object file format"), + (int) fixp->fx_r_type); + return NULL; + } + + if (fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT + || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY) + reloc->address = fixp->fx_offset; + + reloc->addend = fixp->fx_offset; + + return reloc; +} + +/* Parse ordinary expression. */ + +static char * +parse_exp (s, op) + char *s; + expressionS *op; +{ + input_line_pointer = s; + expression (op); + if (op->X_op == O_absent) + as_bad (_("missing operand")); + return input_line_pointer; +} + + +int +md_estimate_size_before_relax (fragp, seg) + fragS *fragp ATTRIBUTE_UNUSED; + asection *seg ATTRIBUTE_UNUSED; +{ + abort (); + return 0; +} diff --git a/gas/config/tc-msp430.h b/gas/config/tc-msp430.h new file mode 100644 index 0000000..e540124 --- /dev/null +++ b/gas/config/tc-msp430.h @@ -0,0 +1,114 @@ +/* This file is tc-msp430.h + Copyright (C) 2002 Free Software Foundation, Inc. + + Contributed by Dmitry Diky <diwil@mail.ru> + + This file is part of GAS, the GNU Assembler. + + GAS is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GAS is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + 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, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +#ifndef BFD_ASSEMBLER + #error MSP430 support requires BFD_ASSEMBLER +#endif + +#define TC_MSP430 +/* By convention, you should define this macro in the `.h' file. For + example, `tc-m68k.h' defines `TC_M68K'. You might have to use this + if it is necessary to add CPU specific code to the object format + file. */ + +#define TARGET_FORMAT "elf32-msp430" +/* This macro is the BFD target name to use when creating the output + file. This will normally depend upon the `OBJ_FMT' macro. */ + +#define TARGET_ARCH bfd_arch_msp430 +/* This macro is the BFD architecture to pass to `bfd_set_arch_mach'. */ + +#define TARGET_MACH 0 +/* This macro is the BFD machine number to pass to + `bfd_set_arch_mach'. If it is not defined, GAS will use 0. */ + +#define TARGET_BYTES_BIG_ENDIAN 0 +/* You should define this macro to be non-zero if the target is big + endian, and zero if the target is little endian. */ + +#define ONLY_STANDARD_ESCAPES +/* If you define this macro, GAS will warn about the use of + nonstandard escape sequences in a string. */ + +#define md_operand(x) +/* GAS will call this function for any expression that can not be + recognized. When the function is called, `input_line_pointer' + will point to the start of the expression. */ + +#define md_number_to_chars number_to_chars_littleendian +/* This should just call either `number_to_chars_bigendian' or + `number_to_chars_littleendian', whichever is appropriate. On + targets like the MIPS which support options to change the + endianness, which function to call is a runtime decision. On + other targets, `md_number_to_chars' can be a simple macro. */ + +#define WORKING_DOT_WORD +/* +`md_short_jump_size' +`md_long_jump_size' +`md_create_short_jump' +`md_create_long_jump' + If `WORKING_DOT_WORD' is defined, GAS will not do broken word + processing (*note Broken words::.). Otherwise, you should set + `md_short_jump_size' to the size of a short jump (a jump that is + just long enough to jump around a long jmp) and + `md_long_jump_size' to the size of a long jump (a jump that can go + anywhere in the function), You should define + `md_create_short_jump' to create a short jump around a long jump, + and define `md_create_long_jump' to create a long jump. */ + +#define MD_APPLY_FIX3 + +#define TC_HANDLES_FX_DONE + +#undef RELOC_EXPANSION_POSSIBLE +/* If you define this macro, it means that `tc_gen_reloc' may return + multiple relocation entries for a single fixup. In this case, the + return value of `tc_gen_reloc' is a pointer to a null terminated + array. */ + +#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section(FIXP, SEC) +/* If you define this macro, it should return the offset between the + address of a PC relative fixup and the position from which the PC + relative adjustment should be made. On many processors, the base + of a PC relative instruction is the next instruction, so this + macro would return the length of an instruction. */ + +extern long md_pcrel_from_section PARAMS ((struct fix *, segT)); + +#define LISTING_WORD_SIZE 2 +/* The number of bytes to put into a word in a listing. This affects + the way the bytes are clumped together in the listing. For + example, a value of 2 might print `1234 5678' where a value of 1 + would print `12 34 56 78'. The default value is 4. */ + +#define LEX_DOLLAR 0 +/* MSP430 port does not use `$' as a logical line separator */ + +#define TC_IMPLICIT_LCOMM_ALIGNMENT(SIZE, P2VAR) (P2VAR) = 0 +/* An `.lcomm' directive with no explicit alignment parameter will + use this macro to set P2VAR to the alignment that a request for + SIZE bytes will have. The alignment is expressed as a power of + two. If no alignment should take place, the macro definition + should do nothing. Some targets define a `.bss' directive that is + also affected by this macro. The default definition will set + P2VAR to the truncated power of two of sizes up to eight bytes. */ diff --git a/gas/configure b/gas/configure index a3cbf4c..85ce557 100755 --- a/gas/configure +++ b/gas/configure @@ -1647,7 +1647,7 @@ else if { (eval echo configure:1648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.$ac_ext | *.c | *.o | *.obj) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -2527,6 +2527,7 @@ EOF mmix-*-*) fmt=elf ;; mn10200-*-*) fmt=elf ;; mn10300-*-*) fmt=elf ;; + msp430-*-*) fmt=elf ;; openrisc-*-*) fmt=elf ;; or32-*-rtems*) fmt=coff ;; or32-*-coff) fmt=coff ;; @@ -3173,7 +3174,7 @@ EOF # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3177: checking for $ac_word" >&5 +echo "configure:3178: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3203,7 +3204,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3207: checking for $ac_word" >&5 +echo "configure:3208: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3254,7 +3255,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3258: checking for $ac_word" >&5 +echo "configure:3259: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3286,7 +3287,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:3290: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:3291: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -3297,12 +3298,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 3301 "configure" +#line 3302 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:3306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -3328,12 +3329,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:3332: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:3333: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:3337: checking whether we are using GNU C" >&5 +echo "configure:3338: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3342,7 +3343,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3346: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3347: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -3361,7 +3362,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:3365: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:3366: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3398,7 +3399,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3402: checking for $ac_word" >&5 +echo "configure:3403: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3429,7 +3430,7 @@ done test -n "$YACC" || YACC="yacc" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:3433: checking how to run the C preprocessor" >&5 +echo "configure:3434: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -3444,13 +3445,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 3448 "configure" +#line 3449 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3454: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3455: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -3461,13 +3462,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 3465 "configure" +#line 3466 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3471: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3472: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -3478,13 +3479,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext <<EOF -#line 3482 "configure" +#line 3483 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3488: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3489: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -3514,7 +3515,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3518: checking for $ac_word" >&5 +echo "configure:3519: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3547,7 +3548,7 @@ test -n "$LEX" || LEX="$missing_dir/missing flex" # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3551: checking for $ac_word" >&5 +echo "configure:3552: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3581,7 +3582,7 @@ then *) ac_lib=l ;; esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:3585: checking for yywrap in -l$ac_lib" >&5 +echo "configure:3586: checking for yywrap in -l$ac_lib" >&5 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3589,7 +3590,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$ac_lib $LIBS" cat > conftest.$ac_ext <<EOF -#line 3593 "configure" +#line 3594 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3600,7 +3601,7 @@ int main() { yywrap() ; return 0; } EOF -if { (eval echo configure:3604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3605: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3623,7 +3624,7 @@ fi fi echo $ac_n "checking lex output file root""... $ac_c" 1>&6 -echo "configure:3627: checking lex output file root" >&5 +echo "configure:3628: checking lex output file root" >&5 if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3644,7 +3645,7 @@ echo "$ac_t""$ac_cv_prog_lex_root" 1>&6 LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6 -echo "configure:3648: checking whether yytext is a pointer" >&5 +echo "configure:3649: checking whether yytext is a pointer" >&5 if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3656,14 +3657,14 @@ echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c ac_save_LIBS="$LIBS" LIBS="$LIBS $LEXLIB" cat > conftest.$ac_ext <<EOF -#line 3660 "configure" +#line 3661 "configure" #include "confdefs.h" `cat $LEX_OUTPUT_ROOT.c` int main() { ; return 0; } EOF -if { (eval echo configure:3667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_prog_lex_yytext_pointer=yes else @@ -3689,7 +3690,7 @@ ALL_LINGUAS="fr tr es" # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3693: checking for $ac_word" >&5 +echo "configure:3694: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3717,12 +3718,12 @@ else fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3721: checking for ANSI C header files" >&5 +echo "configure:3722: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3726 "configure" +#line 3727 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -3730,7 +3731,7 @@ else #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3734: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3735: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3747,7 +3748,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 3751 "configure" +#line 3752 "configure" #include "confdefs.h" #include <string.h> EOF @@ -3765,7 +3766,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 3769 "configure" +#line 3770 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -3786,7 +3787,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 3790 "configure" +#line 3791 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3797,7 +3798,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:3801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -3821,12 +3822,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3825: checking for working const" >&5 +echo "configure:3826: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3830 "configure" +#line 3831 "configure" #include "confdefs.h" int main() { @@ -3875,7 +3876,7 @@ ccp = (char const *const *) p; ; return 0; } EOF -if { (eval echo configure:3879: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3880: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3896,21 +3897,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:3900: checking for inline" >&5 +echo "configure:3901: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <<EOF -#line 3907 "configure" +#line 3908 "configure" #include "confdefs.h" int main() { } $ac_kw foo() { ; return 0; } EOF -if { (eval echo configure:3914: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -3936,12 +3937,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:3940: checking for off_t" >&5 +echo "configure:3941: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3945 "configure" +#line 3946 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -3969,12 +3970,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3973: checking for size_t" >&5 +echo "configure:3974: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3978 "configure" +#line 3979 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -4004,19 +4005,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:4008: checking for working alloca.h" >&5 +echo "configure:4009: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4013 "configure" +#line 4014 "configure" #include "confdefs.h" #include <alloca.h> int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:4020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -4037,12 +4038,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:4041: checking for alloca" >&5 +echo "configure:4042: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4046 "configure" +#line 4047 "configure" #include "confdefs.h" #ifdef __GNUC__ @@ -4070,7 +4071,7 @@ int main() { char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:4074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -4102,12 +4103,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:4106: checking whether alloca needs Cray hooks" >&5 +echo "configure:4107: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4111 "configure" +#line 4112 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -4132,12 +4133,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4136: checking for $ac_func" >&5 +echo "configure:4137: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4141 "configure" +#line 4142 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -4160,7 +4161,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:4164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4187,7 +4188,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:4191: checking stack direction for C alloca" >&5 +echo "configure:4192: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4195,7 +4196,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <<EOF -#line 4199 "configure" +#line 4200 "configure" #include "confdefs.h" find_stack_direction () { @@ -4214,7 +4215,7 @@ main () exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:4218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -4235,21 +4236,21 @@ EOF fi -for ac_hdr in unistd.h +for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4243: checking for $ac_hdr" >&5 +echo "configure:4244: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4248 "configure" +#line 4249 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4278,12 +4279,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4282: checking for $ac_func" >&5 +echo "configure:4283: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4287 "configure" +#line 4288 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -4306,7 +4307,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:4310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4331,7 +4332,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:4335: checking for working mmap" >&5 +echo "configure:4336: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4339,7 +4340,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <<EOF -#line 4343 "configure" +#line 4344 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. @@ -4367,11 +4368,24 @@ else #include <fcntl.h> #include <sys/mman.h> +#if HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif + +#if HAVE_STDLIB_H +# include <stdlib.h> +#endif + +#if HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif + +#if HAVE_UNISTD_H +# include <unistd.h> +#endif + /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE -# ifdef HAVE_UNISTD_H -# include <unistd.h> -# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -4479,7 +4493,7 @@ main() } EOF -if { (eval echo configure:4483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -4507,17 +4521,17 @@ unistd.h values.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4511: checking for $ac_hdr" >&5 +echo "configure:4525: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4516 "configure" +#line 4530 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4521: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4535: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4547,12 +4561,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4551: checking for $ac_func" >&5 +echo "configure:4565: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4556 "configure" +#line 4570 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -4575,7 +4589,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:4579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4604,12 +4618,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4608: checking for $ac_func" >&5 +echo "configure:4622: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4613 "configure" +#line 4627 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -4632,7 +4646,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:4636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4666,19 +4680,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:4670: checking for LC_MESSAGES" >&5 +echo "configure:4684: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4675 "configure" +#line 4689 "configure" #include "confdefs.h" #include <locale.h> int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:4682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -4699,7 +4713,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:4703: checking whether NLS is requested" >&5 +echo "configure:4717: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -4719,7 +4733,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:4723: checking whether included gettext is requested" >&5 +echo "configure:4737: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -4738,17 +4752,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:4742: checking for libintl.h" >&5 +echo "configure:4756: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4747 "configure" +#line 4761 "configure" #include "confdefs.h" #include <libintl.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4752: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4766: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4765,19 +4779,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:4769: checking for gettext in libc" >&5 +echo "configure:4783: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4774 "configure" +#line 4788 "configure" #include "confdefs.h" #include <libintl.h> int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:4781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -4793,7 +4807,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:4797: checking for bindtextdomain in -lintl" >&5 +echo "configure:4811: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4801,7 +4815,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <<EOF -#line 4805 "configure" +#line 4819 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4812,7 +4826,7 @@ int main() { bindtextdomain() ; return 0; } EOF -if { (eval echo configure:4816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4828,19 +4842,19 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:4832: checking for gettext in libintl" >&5 +echo "configure:4846: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4837 "configure" +#line 4851 "configure" #include "confdefs.h" int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:4844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libintl=yes else @@ -4868,7 +4882,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4872: checking for $ac_word" >&5 +echo "configure:4886: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4902,12 +4916,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4906: checking for $ac_func" >&5 +echo "configure:4920: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4911 "configure" +#line 4925 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -4930,7 +4944,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:4934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4957,7 +4971,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4961: checking for $ac_word" >&5 +echo "configure:4975: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4993,7 +5007,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4997: checking for $ac_word" >&5 +echo "configure:5011: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5025,7 +5039,7 @@ else fi cat > conftest.$ac_ext <<EOF -#line 5029 "configure" +#line 5043 "configure" #include "confdefs.h" int main() { @@ -5033,7 +5047,7 @@ extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr ; return 0; } EOF -if { (eval echo configure:5037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -5065,7 +5079,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5069: checking for $ac_word" >&5 +echo "configure:5083: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5099,7 +5113,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5103: checking for $ac_word" >&5 +echo "configure:5117: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5135,7 +5149,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5139: checking for $ac_word" >&5 +echo "configure:5153: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5225,7 +5239,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:5229: checking for catalogs to be installed" >&5 +echo "configure:5243: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -5253,17 +5267,17 @@ echo "configure:5229: checking for catalogs to be installed" >&5 if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:5257: checking for linux/version.h" >&5 +echo "configure:5271: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5262 "configure" +#line 5276 "configure" #include "confdefs.h" #include <linux/version.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5267: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5281: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5326,7 +5340,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:5330: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:5344: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -5351,7 +5365,7 @@ fi echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:5355: checking for executable suffix" >&5 +echo "configure:5369: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5361,10 +5375,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:5365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:5379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.$ac_ext | *.c | *.o | *.obj) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -5386,17 +5400,17 @@ for ac_hdr in string.h stdlib.h memory.h strings.h unistd.h stdarg.h varargs.h e do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5390: checking for $ac_hdr" >&5 +echo "configure:5404: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5395 "configure" +#line 5409 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5400: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5414: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5426,7 +5440,7 @@ done # Put this here so that autoconf's "cross-compiling" message doesn't confuse # people who are not cross-compiling but are compiling cross-assemblers. echo $ac_n "checking whether compiling a cross-assembler""... $ac_c" 1>&6 -echo "configure:5430: checking whether compiling a cross-assembler" >&5 +echo "configure:5444: checking whether compiling a cross-assembler" >&5 if test "${host}" = "${target}"; then cross_gas=no else @@ -5441,19 +5455,19 @@ echo "$ac_t""$cross_gas" 1>&6 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:5445: checking for working alloca.h" >&5 +echo "configure:5459: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5450 "configure" +#line 5464 "configure" #include "confdefs.h" #include <alloca.h> int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:5457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -5474,12 +5488,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:5478: checking for alloca" >&5 +echo "configure:5492: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5483 "configure" +#line 5497 "configure" #include "confdefs.h" #ifdef __GNUC__ @@ -5507,7 +5521,7 @@ int main() { char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:5511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -5539,12 +5553,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:5543: checking whether alloca needs Cray hooks" >&5 +echo "configure:5557: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5548 "configure" +#line 5562 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -5569,12 +5583,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5573: checking for $ac_func" >&5 +echo "configure:5587: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5578 "configure" +#line 5592 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -5597,7 +5611,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:5601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5624,7 +5638,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:5628: checking stack direction for C alloca" >&5 +echo "configure:5642: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5632,7 +5646,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <<EOF -#line 5636 "configure" +#line 5650 "configure" #include "confdefs.h" find_stack_direction () { @@ -5651,7 +5665,7 @@ main () exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:5655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -5673,21 +5687,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:5677: checking for inline" >&5 +echo "configure:5691: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <<EOF -#line 5684 "configure" +#line 5698 "configure" #include "confdefs.h" int main() { } $ac_kw foo() { ; return 0; } EOF -if { (eval echo configure:5691: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5705: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -5717,12 +5731,12 @@ esac for ac_func in unlink remove do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5721: checking for $ac_func" >&5 +echo "configure:5735: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5726 "configure" +#line 5740 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -5745,7 +5759,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:5749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5774,12 +5788,12 @@ done for ac_func in sbrk do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5778: checking for $ac_func" >&5 +echo "configure:5792: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5783 "configure" +#line 5797 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -5802,7 +5816,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:5806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5837,7 +5851,7 @@ case $host in ;; *-ncr-sysv4.3*) echo $ac_n "checking for _mwvalidcheckl in -lmw""... $ac_c" 1>&6 -echo "configure:5841: checking for _mwvalidcheckl in -lmw" >&5 +echo "configure:5855: checking for _mwvalidcheckl in -lmw" >&5 ac_lib_var=`echo mw'_'_mwvalidcheckl | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5845,7 +5859,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lmw $LIBS" cat > conftest.$ac_ext <<EOF -#line 5849 "configure" +#line 5863 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5856,7 +5870,7 @@ int main() { _mwvalidcheckl() ; return 0; } EOF -if { (eval echo configure:5860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5877,7 +5891,7 @@ else fi echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:5881: checking for main in -lm" >&5 +echo "configure:5895: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5885,14 +5899,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <<EOF -#line 5889 "configure" +#line 5903 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:5896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5915,7 +5929,7 @@ fi ;; *) echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:5919: checking for main in -lm" >&5 +echo "configure:5933: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5923,14 +5937,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <<EOF -#line 5927 "configure" +#line 5941 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:5934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5961,12 +5975,12 @@ esac # enough, but on some of those systems, the assert macro relies on requoting # working properly! echo $ac_n "checking for working assert macro""... $ac_c" 1>&6 -echo "configure:5965: checking for working assert macro" >&5 +echo "configure:5979: checking for working assert macro" >&5 if eval "test \"`echo '$''{'gas_cv_assert_ok'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5970 "configure" +#line 5984 "configure" #include "confdefs.h" #include <assert.h> #include <stdio.h> @@ -5982,7 +5996,7 @@ assert (a == b ; return 0; } EOF -if { (eval echo configure:5986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_assert_ok=yes else @@ -6023,12 +6037,12 @@ gas_test_headers=" " echo $ac_n "checking whether declaration is required for strstr""... $ac_c" 1>&6 -echo "configure:6027: checking whether declaration is required for strstr" >&5 +echo "configure:6041: checking whether declaration is required for strstr" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_strstr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6032 "configure" +#line 6046 "configure" #include "confdefs.h" $gas_test_headers int main() { @@ -6039,7 +6053,7 @@ x = (f) strstr; ; return 0; } EOF -if { (eval echo configure:6043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_strstr=no else @@ -6060,12 +6074,12 @@ fi echo $ac_n "checking whether declaration is required for malloc""... $ac_c" 1>&6 -echo "configure:6064: checking whether declaration is required for malloc" >&5 +echo "configure:6078: checking whether declaration is required for malloc" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_malloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6069 "configure" +#line 6083 "configure" #include "confdefs.h" $gas_test_headers int main() { @@ -6076,7 +6090,7 @@ x = (f) malloc; ; return 0; } EOF -if { (eval echo configure:6080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_malloc=no else @@ -6097,12 +6111,12 @@ fi echo $ac_n "checking whether declaration is required for free""... $ac_c" 1>&6 -echo "configure:6101: checking whether declaration is required for free" >&5 +echo "configure:6115: checking whether declaration is required for free" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_free'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6106 "configure" +#line 6120 "configure" #include "confdefs.h" $gas_test_headers int main() { @@ -6113,7 +6127,7 @@ x = (f) free; ; return 0; } EOF -if { (eval echo configure:6117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_free=no else @@ -6134,12 +6148,12 @@ fi echo $ac_n "checking whether declaration is required for sbrk""... $ac_c" 1>&6 -echo "configure:6138: checking whether declaration is required for sbrk" >&5 +echo "configure:6152: checking whether declaration is required for sbrk" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_sbrk'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6143 "configure" +#line 6157 "configure" #include "confdefs.h" $gas_test_headers int main() { @@ -6150,7 +6164,7 @@ x = (f) sbrk; ; return 0; } EOF -if { (eval echo configure:6154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_sbrk=no else @@ -6171,12 +6185,12 @@ fi echo $ac_n "checking whether declaration is required for environ""... $ac_c" 1>&6 -echo "configure:6175: checking whether declaration is required for environ" >&5 +echo "configure:6189: checking whether declaration is required for environ" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_environ'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6180 "configure" +#line 6194 "configure" #include "confdefs.h" $gas_test_headers int main() { @@ -6187,7 +6201,7 @@ x = (f) environ; ; return 0; } EOF -if { (eval echo configure:6191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_environ=no else @@ -6211,12 +6225,12 @@ fi # for it? echo $ac_n "checking whether declaration is required for errno""... $ac_c" 1>&6 -echo "configure:6215: checking whether declaration is required for errno" >&5 +echo "configure:6229: checking whether declaration is required for errno" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_errno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6220 "configure" +#line 6234 "configure" #include "confdefs.h" #ifdef HAVE_ERRNO_H @@ -6231,7 +6245,7 @@ x = (f) errno; ; return 0; } EOF -if { (eval echo configure:6235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_errno=no else diff --git a/gas/configure.in b/gas/configure.in index 232d1d0..ebffca6 100644 --- a/gas/configure.in +++ b/gas/configure.in @@ -373,6 +373,7 @@ changequote([,])dnl mmix-*-*) fmt=elf ;; mn10200-*-*) fmt=elf ;; mn10300-*-*) fmt=elf ;; + msp430-*-*) fmt=elf ;; openrisc-*-*) fmt=elf ;; or32-*-rtems*) fmt=coff ;; or32-*-coff) fmt=coff ;; diff --git a/gas/doc/Makefile.am b/gas/doc/Makefile.am index 63aa179..2ff312f 100644 --- a/gas/doc/Makefile.am +++ b/gas/doc/Makefile.am @@ -44,6 +44,7 @@ CPU_DOCS = \ c-m88k.texi \ c-mips.texi \ c-mmix.texi \ + c-msp430.texi \ c-ns32k.texi \ c-pdp11.texi \ c-pj.texi \ diff --git a/gas/doc/Makefile.in b/gas/doc/Makefile.in index 7a9fcab..55eb4b1 100644 --- a/gas/doc/Makefile.in +++ b/gas/doc/Makefile.in @@ -156,6 +156,7 @@ CPU_DOCS = \ c-m88k.texi \ c-mips.texi \ c-mmix.texi \ + c-msp430.texi \ c-ns32k.texi \ c-pdp11.texi \ c-pj.texi \ diff --git a/gas/doc/all.texi b/gas/doc/all.texi index 50117d6..b9754de 100644 --- a/gas/doc/all.texi +++ b/gas/doc/all.texi @@ -48,6 +48,7 @@ @set MCORE @set MIPS @set MMIX +@set MSP430 @set PDP11 @set PJ @set PPC diff --git a/gas/doc/as.texinfo b/gas/doc/as.texinfo index 6716199..e654c24 100644 --- a/gas/doc/as.texinfo +++ b/gas/doc/as.texinfo @@ -5758,6 +5758,9 @@ subject, see the hardware manufacturer's manual. @ifset MMIX * MMIX-Dependent:: MMIX Dependent Features @end ifset +@ifset MSP430 +* MSP430-Dependent:: MSP430 Dependent Features +@end ifset @ifset SH * SH-Dependent:: Hitachi SH Dependent Features * SH64-Dependent:: Hitachi SH64 Dependent Features @@ -5906,6 +5909,10 @@ family. @include c-mmix.texi @end ifset +@ifset MSP430 +@include c-msp430.texi +@end ifset + @ifset NS32K @include c-ns32k.texi @end ifset diff --git a/gas/doc/c-msp430.texi b/gas/doc/c-msp430.texi new file mode 100644 index 0000000..0050359 --- /dev/null +++ b/gas/doc/c-msp430.texi @@ -0,0 +1,164 @@ +@c Copyright 2002 Free Software Foundation, Inc. +@c This is part of the GAS manual. +@c For copying conditions, see the file as.texinfo. +@ifset GENERIC +@page +@node MSP430-Dependent +@chapter MSP 430 Dependent Features +@end ifset +@ifclear GENERIC +@node Machine Dependencies +@chapter MSP 430 Dependent Features +@end ifclear + +@cindex MSP 430 support +@cindex 430 support +@menu +* MSP430 Options:: Options +* MSP430 Syntax:: Syntax +* MSP430 Floating Point:: Floating Point +* MSP430 Directives:: MSP 430 Machine Directives +* MSP430 Opcodes:: Opcodes +@end menu + +@node MSP430 Options +@section Options +@cindex MSP 430 options (none) +@cindex options for MSP430 (none) +@code{@value{AS}} has only -m flag which selects the mpu arch. Currently has +no effect. + +@node MSP430 Syntax +@section Syntax +@menu +* MSP430-Macros:: Macros +* MSP430-Chars:: Special Characters +* MSP430-Regs:: Register Names +* MSP430-Ext:: Assembler Extensions +@end menu + +@node MSP430-Macros +@subsection Macros + +@cindex Macros, MSP 430 +@cindex MSP 430 macros +The macro syntax used on the MSP 430 is like that described in the MSP +430 Family Assembler Specification. Normal @code{@value{AS}} +macros should still work. + +Additional built-in macros are: + +@table @code + +@item llo(exp) +Extracts least significant word from 32-bit expression 'exp'. + +@item lhi(exp) +Extracts most significant word from 32-bit expression 'exp'. + +@item hlo(exp) +Extracts 3rd word from 64-bit expression 'exp'. + +@item hhi(exp) +Extracts 4rd word from 64-bit expression 'exp'. + +@end table + +They normally being used as an immediate source operand. +@smallexample + mov #llo(1), r10 ; == mov #1, r10 + mov #lhi(1), r10 ; == mov #0, r10 +@end smallexample + +@node MSP430-Chars +@subsection Special Characters + +@cindex line comment character, MSP 430 +@cindex MSP 430 line comment character +@samp{;} is the line comment character. + +@cindex identifiers, MSP 430 +@cindex MSP 430 identifiers +The character @samp{$} in jump instructions indicates current location and +implemented only for TI syntax compatibility. + +@node MSP430-Regs +@subsection Register Names + +@cindex MSP 430 register names +@cindex register names, MSP 430 +General-purpose registers are represented by predefined symbols of the +form @samp{r@var{N}} (for global registers), where @var{N} represents +a number between @code{0} and @code{15}. The leading +letters may be in either upper or lower case; for example, @samp{r13} +and @samp{R7} are both valid register names. + +@cindex special purpose registers, MSP 430 +Register names @samp{PC}, @samp{SP} and @samp{SR} cannot be used as register names +and will be treated as variables. Use @samp{r0}, @samp{r1}, and @samp{r2} instead. + + +@node MSP430-Ext +@subsection Assembler Extensions +@cindex MSP430 Assembler Extensions + +@table @code + +@item @@rN +As destination operand being treated as @samp{0(rn)} + +@item 0(rN) +As source operand being treated as @samp{@@rn} + +@item jCOND +N +Skips next N bytes followed by jump instruction and equivalent to +@samp{jCOND $+N+2} + +@end table + + +@node MSP430 Floating Point +@section Floating Point + +@cindex floating point, MSP 430 (@sc{ieee}) +@cindex MSP 430 floating point (@sc{ieee}) +The MSP 430 family uses @sc{ieee} 32-bit floating-point numbers. + +@node MSP430 Directives +@section MSP 430 Machine Directives + +@cindex machine directives, MSP 430 +@cindex MSP 430 machine directives +@table @code +@cindex @code{file} directive, MSP 430 +@item .file +This directive is ignored; it is accepted for compatibility with other +MSP 430 assemblers. + +@quotation +@emph{Warning:} in other versions of the @sc{gnu} assembler, @code{.file} is +used for the directive called @code{.app-file} in the MSP 430 support. +@end quotation + +@cindex @code{line} directive, MSP 430 +@item .line +This directive is ignored; it is accepted for compatibility with other +MSP 430 assemblers. + +@cindex @code{sect} directive, MSP 430 +@item .arch +Currently this directive is ignored; it is accepted for compatibility with other +MSP 430 assemblers. + +@end table + +@node MSP430 Opcodes +@section Opcodes + +@cindex MSP 430 opcodes +@cindex opcodes for MSP 430 +@code{@value{AS}} implements all the standard MSP 430 opcodes. No +additional pseudo-instructions are needed on this family. + +For information on the 430 machine instruction set, see @cite{MSP430 +User's Manual, document slau049b}, Texas Instrument, Inc. diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 77d94c5..b4c687c 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2002-12-24 Dmitry Diky <diwil@mail.ru> + + * gas/msp430: New directory. + * gas/msp430/msp430.exp: Test msp430 assembler. + * gas/msp430/opcode.s: Test source file. + * gas/msp430/opcode.s: Expected disassembly. + 2002-12-27 Chris Demetriou <cgd@broadcom.com> * gas/mips/mips.exp: Define the notion of an "architecture data |