aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gas/.Sanitize1
-rw-r--r--gas/ChangeLog23
-rw-r--r--gas/Makefile.in30
-rw-r--r--gas/conf.in3
-rwxr-xr-xgas/configure136
-rw-r--r--gas/configure.in13
-rw-r--r--gas/write.c35
7 files changed, 172 insertions, 69 deletions
diff --git a/gas/.Sanitize b/gas/.Sanitize
index 88eb4ac..af40634 100644
--- a/gas/.Sanitize
+++ b/gas/.Sanitize
@@ -40,6 +40,7 @@ atof-generic.c
bignum-copy.c
bignum.h
bit_fix.h
+cgen.c
cond.c
conf.in
config
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 27c5e21..855a4cc 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,26 @@
+Fri Apr 4 16:10:02 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * config/tc-m32r.[ch]: New files.
+ * cgen.c: New file.
+ * Makefile.in (CPU_TYPES): Add m32r.
+ (CFILES): Add cgen.c.
+ (TARGET_CPU_CFILES): Add tc-m32r.c.
+ (TARGET_CPU_HFILES): Add tc-m32r.h.
+ (OBJS): Add cgen.o.
+ (DISTCLEAN_HERE): Add cgen-opc.h.
+ (.dep1,.tcdep): Create empty cgen-opc.h.
+ (cgen.o): Add dependencies.
+ (dependencies): Regenerate.
+ * as.h (struct frag): New member fr_targ.
+ (fr_pcrel_adjust,fr_bsr): Move into union fr_targ.ns32k.
+ * conf.in (USING_CGEN): New macro.
+ * configure.in (m32r-*-*): Add entry for.
+ * configure: Regenerate.
+ * write.c (relax_frag): fr_pcrel_adjust renamed to
+ fr_targ.ns32k.pcrel_adjust.
+ * config/tc-ns32k.c (*): Likewise.
+ fr_bsr renamed to fr_targ.ns32k.bsr.
+
Fri Apr 4 13:26:10 1997 Ian Lance Taylor <ian@cygnus.com>
* config/tc-hppa.h (TC_EOL_IN_INSN): Check explicitly for '!',
diff --git a/gas/Makefile.in b/gas/Makefile.in
index 1498de5..5d93753 100644
--- a/gas/Makefile.in
+++ b/gas/Makefile.in
@@ -140,6 +140,7 @@ CPU_TYPES = \
i386 \
i860 \
i960 \
+ m32r \
m68k \
m88k \
mips \
@@ -220,6 +221,7 @@ CFILES = \
as.c \
atof-generic.c \
bignum-copy.c \
+ cgen.c \
cond.c \
ecoff.c \
expr.c \
@@ -282,6 +284,7 @@ TARGET_CPU_CFILES = \
config/tc-i386.c \
config/tc-i860.c \
config/tc-i960.c \
+ config/tc-m32r.c \
config/tc-m68k.c \
config/tc-m88k.c \
config/tc-mips.c \
@@ -307,6 +310,7 @@ TARGET_CPU_HFILES = \
config/tc-i386.h \
config/tc-i860.h \
config/tc-i960.h \
+ config/tc-m32r.h \
config/tc-m68k.h \
config/tc-m88k.h \
config/tc-mips.h \
@@ -398,6 +402,7 @@ OBJS = \
as.o \
atof-generic.o \
bignum-copy.o \
+ cgen.o \
cond.o \
expr.o \
flonum-konst.o \
@@ -659,7 +664,7 @@ clean mostlyclean: clean-here
# Like clean but also delete the links made to configure gas.
DISTCLEAN_HERE = config.status Makefile targ-env.h targ-cpu.h obj-format.h \
- TAGS itbl-cpu.h site.exp site.bak \
+ TAGS itbl-cpu.h cgen-opc.h site.exp site.bak \
config-stamp config.h conf config.log config.cache .gdbinit \
testsuite/Makefile testsuite/config.status
@@ -815,6 +820,7 @@ DEP_FILE_DEPS = $(CFILES) $(HFILES) $(TARGET_CPU_CFILES) \
echo '' > obj-format.h; \
echo '' > targ-env.h; \
echo '' > itbl-cpu.h; \
+ echo '' > cgen-opc.h; \
echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep; \
$(DEP) -f .dep -DBFD_ASSEMBLER -I. -I.. -I$(srcdir) -I../../bfd $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $?
mv -f .depdir/.dep .dep1
@@ -832,6 +838,7 @@ DEP_FILE_DEPS = $(CFILES) $(HFILES) $(TARGET_CPU_CFILES) \
echo '#include "obj-'"$${o}"'.h"' > obj-format.h; \
echo '#include "te-generic.h"' > targ-env.h; \
echo '' > itbl-cpu.h; \
+ echo '' > cgen-opc.h; \
rm -f dummy.c; \
cp $(srcdir)/config/tc-$${c}.c dummy.c; \
echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep; \
@@ -977,6 +984,7 @@ as.o: as.c subsegs.h $(INCDIR)/obstack.h output-file.h \
sb.h macro.h
atof-generic.o: atof-generic.c
bignum-copy.o: bignum-copy.c
+cgen.o: cgen.c cgen-opc.h subsegs.h $(INCDIR)/obstack.h
cond.o: cond.c $(INCDIR)/obstack.h
ecoff.o: ecoff.c
expr.o: expr.c $(INCDIR)/obstack.h
@@ -988,7 +996,6 @@ gasp.o: gasp.c sb.h macro.h
hash.o: hash.c
input-file.o: input-file.c input-file.h
input-scrub.o: input-scrub.c input-file.h sb.h
-itbl-ops.o: itbl-ops.c itbl-ops.h
listing.o: listing.c input-file.h subsegs.h
literal.o: literal.c subsegs.h $(INCDIR)/obstack.h
macro.o: macro.c sb.h macro.h
@@ -1100,6 +1107,13 @@ TCDEP_i960_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-i960.h $(INCDIR)/obstack.h \
$(INCDIR)/opcode/i960.h
+TCDEP_m32r_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m32r.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ subsegs.h $(INCDIR)/obstack.h cgen-opc.h
+TCDEP_m32r_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-m32r.h subsegs.h \
+ $(INCDIR)/obstack.h cgen-opc.h
TCDEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
$(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
subsegs.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h
@@ -1320,6 +1334,13 @@ OBJDEP_i960_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-i960.h subsegs.h \
$(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_m32r_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m32r.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/obstack.h subsegs.h
+OBJDEP_m32r_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-m32r.h subsegs.h \
+ $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
OBJDEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
$(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
$(INCDIR)/obstack.h
@@ -1516,6 +1537,11 @@ DEP_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \
DEP_i960_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-i960.h
+DEP_m32r_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m32r.h \
+ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
+DEP_m32r_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-m32r.h
DEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
$(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
DEP_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \
diff --git a/gas/conf.in b/gas/conf.in
index 4cc4b71..d56807c 100644
--- a/gas/conf.in
+++ b/gas/conf.in
@@ -65,6 +65,9 @@
#undef SPARC_V9
#undef SPARC_ARCH64
+/* Defined if using CGEN. */
+#undef USING_CGEN
+
/* Needed only for some configurations that can produce multiple output
formats. */
#undef DEFAULT_EMULATION
diff --git a/gas/configure b/gas/configure
index 1a58bfb..5fd5400 100755
--- a/gas/configure
+++ b/gas/configure
@@ -846,6 +846,8 @@ for this_target in $target $canon_targets ; do
i960-*-vxworks5.*) fmt=coff em=ic960 targ=ic960coff ;;
i960-*-vxworks*) fmt=bout ;;
+ m32r-*-*) fmt=elf bfd_gas=yes ;;
+
m68k-*-vxworks* | m68k-ericsson-ose | m68k-*-sunos*)
fmt=aout em=sun3 ;;
m68k-motorola-sysv*) fmt=coff targ=m68kcoff em=delta ;;
@@ -1028,6 +1030,20 @@ EOF
esac
case ${cpu_type} in
+ m32r)
+ case ${extra_objects} in
+ *cgen.o*) ;;
+ *) extra_objects="$extra_objects cgen.o"
+ extra_files=../opcodes/${cpu_type}-opc.h
+ extra_links=cgen-opc.h
+ cat >> confdefs.h <<\EOF
+#define USING_CGEN 1
+EOF
+
+ ;;
+ esac
+ ;;
+
m68k)
case ${extra_objects} in
*m68k-parse.o*) ;;
@@ -1436,7 +1452,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:1440: checking for $ac_word" >&5
+echo "configure:1456: 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
@@ -1465,7 +1481,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:1469: checking for $ac_word" >&5
+echo "configure:1485: 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
@@ -1513,7 +1529,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1517: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1533: 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.
@@ -1523,11 +1539,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 1527 "configure"
+#line 1543 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:1531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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
@@ -1547,12 +1563,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:1551: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1567: 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:1556: checking whether we are using GNU C" >&5
+echo "configure:1572: 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
@@ -1561,7 +1577,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1565: \"$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:1581: \"$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
@@ -1576,7 +1592,7 @@ if test $ac_cv_prog_gcc = yes; then
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1580: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1596: 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
@@ -1614,7 +1630,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1618: checking for a BSD compatible install" >&5
+echo "configure:1634: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1665,7 +1681,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1669: checking how to run the C preprocessor" >&5
+echo "configure:1685: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -1680,13 +1696,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 1684 "configure"
+#line 1700 "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:1690: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1706: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -1697,13 +1713,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1701 "configure"
+#line 1717 "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:1707: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1723: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -1729,17 +1745,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:1733: checking for $ac_hdr" >&5
+echo "configure:1749: 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 1738 "configure"
+#line 1754 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1743: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1759: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1769,7 +1785,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:1773: checking whether compiling a cross-assembler" >&5
+echo "configure:1789: checking whether compiling a cross-assembler" >&5
if test "${host}" = "${target}"; then
cross_gas=no
else
@@ -1784,19 +1800,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:1788: checking for working alloca.h" >&5
+echo "configure:1804: 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 1793 "configure"
+#line 1809 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:1800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@@ -1817,12 +1833,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:1821: checking for alloca" >&5
+echo "configure:1837: 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 1826 "configure"
+#line 1842 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -1845,7 +1861,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:1849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -1877,12 +1893,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:1881: checking whether alloca needs Cray hooks" >&5
+echo "configure:1897: 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 1886 "configure"
+#line 1902 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -1907,12 +1923,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:1911: checking for $ac_func" >&5
+echo "configure:1927: 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 1916 "configure"
+#line 1932 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1935,7 +1951,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1962,7 +1978,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:1966: checking stack direction for C alloca" >&5
+echo "configure:1982: 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
@@ -1970,7 +1986,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 1974 "configure"
+#line 1990 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -1989,7 +2005,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:1993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -2011,21 +2027,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:2015: checking for inline" >&5
+echo "configure:2031: 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 2022 "configure"
+#line 2038 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:2029: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2045: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -2055,12 +2071,12 @@ esac
for ac_func in unlink remove
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2059: checking for $ac_func" >&5
+echo "configure:2075: 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 2064 "configure"
+#line 2080 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2083,7 +2099,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2112,12 +2128,12 @@ done
for ac_func in sbrk
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2116: checking for $ac_func" >&5
+echo "configure:2132: 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 2121 "configure"
+#line 2137 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2140,7 +2156,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2169,12 +2185,12 @@ done
# 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:2173: checking for working assert macro" >&5
+echo "configure:2189: 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 2178 "configure"
+#line 2194 "configure"
#include "confdefs.h"
#include <assert.h>
#include <stdio.h>
@@ -2190,7 +2206,7 @@ assert (a == b
; return 0; }
EOF
-if { (eval echo configure:2194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
gas_cv_assert_ok=yes
else
@@ -2231,12 +2247,12 @@ gas_test_headers="
"
echo $ac_n "checking whether declaration is required for strstr""... $ac_c" 1>&6
-echo "configure:2235: checking whether declaration is required for strstr" >&5
+echo "configure:2251: 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 2240 "configure"
+#line 2256 "configure"
#include "confdefs.h"
$gas_test_headers
int main() {
@@ -2247,7 +2263,7 @@ x = (f) strstr;
; return 0; }
EOF
-if { (eval echo configure:2251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
gas_cv_decl_needed_strstr=no
else
@@ -2268,12 +2284,12 @@ EOF
echo $ac_n "checking whether declaration is required for malloc""... $ac_c" 1>&6
-echo "configure:2272: checking whether declaration is required for malloc" >&5
+echo "configure:2288: 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 2277 "configure"
+#line 2293 "configure"
#include "confdefs.h"
$gas_test_headers
int main() {
@@ -2284,7 +2300,7 @@ x = (f) malloc;
; return 0; }
EOF
-if { (eval echo configure:2288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
gas_cv_decl_needed_malloc=no
else
@@ -2305,12 +2321,12 @@ EOF
echo $ac_n "checking whether declaration is required for free""... $ac_c" 1>&6
-echo "configure:2309: checking whether declaration is required for free" >&5
+echo "configure:2325: 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 2314 "configure"
+#line 2330 "configure"
#include "confdefs.h"
$gas_test_headers
int main() {
@@ -2321,7 +2337,7 @@ x = (f) free;
; return 0; }
EOF
-if { (eval echo configure:2325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
gas_cv_decl_needed_free=no
else
@@ -2342,12 +2358,12 @@ EOF
echo $ac_n "checking whether declaration is required for sbrk""... $ac_c" 1>&6
-echo "configure:2346: checking whether declaration is required for sbrk" >&5
+echo "configure:2362: 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 2351 "configure"
+#line 2367 "configure"
#include "confdefs.h"
$gas_test_headers
int main() {
@@ -2358,7 +2374,7 @@ x = (f) sbrk;
; return 0; }
EOF
-if { (eval echo configure:2362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
gas_cv_decl_needed_sbrk=no
else
@@ -2382,12 +2398,12 @@ EOF
# for it?
echo $ac_n "checking whether declaration is required for errno""... $ac_c" 1>&6
-echo "configure:2386: checking whether declaration is required for errno" >&5
+echo "configure:2402: 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 2391 "configure"
+#line 2407 "configure"
#include "confdefs.h"
#ifdef HAVE_ERRNO_H
@@ -2402,7 +2418,7 @@ x = (f) errno;
; return 0; }
EOF
-if { (eval echo configure:2406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
gas_cv_decl_needed_errno=no
else
diff --git a/gas/configure.in b/gas/configure.in
index a3ea10a..cf72d5c 100644
--- a/gas/configure.in
+++ b/gas/configure.in
@@ -189,6 +189,8 @@ changequote([,])dnl
i960-*-vxworks5.*) fmt=coff em=ic960 targ=ic960coff ;;
i960-*-vxworks*) fmt=bout ;;
+ m32r-*-*) fmt=elf bfd_gas=yes ;;
+
m68k-*-vxworks* | m68k-ericsson-ose | m68k-*-sunos*)
fmt=aout em=sun3 ;;
m68k-motorola-sysv*) fmt=coff targ=m68kcoff em=delta ;;
@@ -365,6 +367,17 @@ changequote([,])dnl
esac
case ${cpu_type} in
+ m32r)
+ case ${extra_objects} in
+ *cgen.o*) ;;
+ *) extra_objects="$extra_objects cgen.o"
+ extra_files=../opcodes/${cpu_type}-opc.h
+ extra_links=cgen-opc.h
+ AC_DEFINE(USING_CGEN)
+ ;;
+ esac
+ ;;
+
m68k)
case ${extra_objects} in
*m68k-parse.o*) ;;
diff --git a/gas/write.c b/gas/write.c
index 779c73d..77960f0 100644
--- a/gas/write.c
+++ b/gas/write.c
@@ -112,6 +112,26 @@ static fixS *fix_new_internal PARAMS ((fragS *, int where, int size,
static long fixup_segment PARAMS ((fixS * fixP, segT this_segment_type));
#endif
static relax_addressT relax_align PARAMS ((relax_addressT addr, int align));
+#if defined (BFD_ASSEMBLER) || ! defined (BFD)
+static fragS *chain_frchains_together_1 PARAMS ((segT, struct frchain *));
+#endif
+#ifdef BFD_ASSEMBLER
+static void chain_frchains_together PARAMS ((bfd *, segT, PTR));
+static void cvt_frag_to_fill PARAMS ((segT, fragS *));
+static void relax_and_size_seg PARAMS ((bfd *, asection *, PTR));
+static void adjust_reloc_syms PARAMS ((bfd *, asection *, PTR));
+static void write_relocs PARAMS ((bfd *, asection *, PTR));
+static void write_contents PARAMS ((bfd *, asection *, PTR));
+static void set_symtab PARAMS ((void));
+#endif
+#if defined (BFD_ASSEMBLER) || (! defined (BFD) && ! defined (OBJ_AOUT))
+static void merge_data_into_text PARAMS ((void));
+#endif
+#if ! defined (BFD_ASSEMBLER) && ! defined (BFD)
+static void cvt_frag_to_fill PARAMS ((object_headers *, segT, fragS *));
+static void remove_subsegs PARAMS ((frchainS *, int, fragS **, fragS **));
+static void relax_and_size_all_segments PARAMS ((void));
+#endif
/*
* fix_new()
@@ -260,7 +280,6 @@ fix_new_exp (frag, where, size, exp, pcrel, r_type)
/* This comes up when _GLOBAL_OFFSET_TABLE_+(.-L0) is read, if
the difference expression cannot immediately be reduced. */
{
- extern symbolS *make_expr_symbol ();
symbolS *stmp = make_expr_symbol (exp);
exp->X_op = O_symbol;
exp->X_op_symbol = 0;
@@ -431,7 +450,7 @@ chain_frchains_together (abfd, section, xxx)
#if !defined (BFD) && !defined (BFD_ASSEMBLER)
-void
+static void
remove_subsegs (head, seg, root, last)
frchainS *head;
int seg;
@@ -1866,11 +1885,14 @@ write_object_file ()
#ifdef TC_GENERIC_RELAX_TABLE
+static int is_dnrange PARAMS ((fragS *, fragS *));
+static long relax_frag PARAMS ((fragS *, long));
+
/* Subroutines of relax_segment. */
static int
is_dnrange (f1, f2)
- struct frag *f1;
- struct frag *f2;
+ fragS *f1;
+ fragS *f2;
{
for (; f1; f1 = f1->fr_next)
if (f1->fr_next == f2)
@@ -1880,7 +1902,7 @@ is_dnrange (f1, f2)
/* Relax a fragment by scanning TC_GENERIC_RELAX_TABLE. */
-long
+static long
relax_frag (fragP, stretch)
fragS *fragP;
long stretch;
@@ -1941,7 +1963,7 @@ relax_frag (fragP, stretch)
/*#else*/
/* This machine doesn't want to use pcrel_adjust.
In that case, pcrel_adjust should be zero. */
-/* assert (fragP->fr_pcrel_adjust == 0);*/
+/* assert (fragP->fr_targ.ns32k.pcrel_adjust == 0);*/
#endif
#ifdef md_prepare_relax_scan /* formerly called M68K_AIM_KLUDGE */
md_prepare_relax_scan (fragP, address, aim, this_state, this_type);
@@ -2712,7 +2734,6 @@ write_print_statistics (file)
/* for debugging */
extern int indent_level;
-extern void print_symbol_value_1 ();
void
print_fixup (fixp)