Add MMIX support

This commit is contained in:
Nick Clifton 2001-10-30 15:20:14 +00:00
parent f5ffc9190a
commit 3c3bdf30e4
585 changed files with 25733 additions and 1466 deletions

View File

@ -29,4 +29,4 @@ dir.info
Makefile
lost+found
update.out
update.sourceware

View File

@ -1,3 +1,27 @@
2001-10-30 Hans-Peter Nilsson <hp@bitrange.com>
* Makefile.am (ALL_MACHINES): Add cpu-mmix.lo.
(BFD64_BACKENDS): Add elf64-mmix.lo and mmo.lo.
(BFD64_BACKENDS_CFILES): Add elf64-mmix.c and mmo.c.
Regenerate dependencies.
* configure.in (bfd_elf64_mmix_vec, bfd_mmo_vec): New vectors.
* config.bfd: [BFD64] (mmix-*-*): New case.
* cpu-mmix.c, mmo.c, elf64-mmix.c: New files.
* archures.c (enum bfd_architecture): Add bfd_arch_mmix.
(bfd_mmix_arch): Declare.
(bfd_archures_list): Add bfd_mmix_arch.
* targets.c (enum bfd_flavour): Add bfd_target_mmo_flavour.
(bfd_elf64_mmix_vec, bfd_mmo_vec): Declare.
(bfd_target_vect) [BFD64]: Add bfd_elf64_mmix_vec and
bfd_mmo_mmix_vec.
* reloc.c: Add MMIX relocations.
* bfd.c (struct _bfd, tdata): Add mmo_data.
* Makefile.in: Regenerate.
* configure: Regenerate.
* libbfd.h: Regenerate.
* bfd-in2.h: Regenerate.
* configure: Rebuild.
2001-10-30 Richard Earnshaw (rearnsha@arm.com)
* elf.c (_bfd_elf_make_section_from_shdr): Set the LMA based on the

View File

@ -68,6 +68,7 @@ ALL_MACHINES = \
cpu-m10300.lo \
cpu-mcore.lo \
cpu-mips.lo \
cpu-mmix.lo \
cpu-ns32k.lo \
cpu-openrisc.lo \
cpu-pdp11.lo \
@ -113,6 +114,7 @@ ALL_MACHINES_CFILES = \
cpu-m10300.c \
cpu-mcore.c \
cpu-mips.c \
cpu-mmix.c \
cpu-ns32k.c \
cpu-openrisc.c \
cpu-pdp11.c \
@ -428,10 +430,12 @@ BFD64_BACKENDS = \
elf64-ia64.lo \
elf64-gen.lo \
elf64-mips.lo \
elf64-mmix.lo \
elf64-ppc.lo \
elf64-s390.lo \
elf64-sparc.lo \
elf64.lo \
mmo.lo \
nlm32-alpha.lo \
nlm64.lo \
pepigen.lo
@ -447,10 +451,12 @@ BFD64_BACKENDS_CFILES = \
elf64-hppa.c \
elf64-gen.c \
elf64-mips.c \
elf64-mmix.c \
elf64-ppc.c \
elf64-s390.c \
elf64-sparc.c \
elf64.c \
mmo.c \
nlm32-alpha.c \
nlm64.c
@ -824,6 +830,7 @@ cpu-m10200.lo: cpu-m10200.c $(INCDIR)/filenames.h
cpu-m10300.lo: cpu-m10300.c $(INCDIR)/filenames.h
cpu-mcore.lo: cpu-mcore.c $(INCDIR)/filenames.h
cpu-mips.lo: cpu-mips.c $(INCDIR)/filenames.h
cpu-mmix.lo: cpu-mmix.c $(INCDIR)/filenames.h
cpu-ns32k.lo: cpu-ns32k.c $(INCDIR)/filenames.h ns32k.h
cpu-openrisc.lo: cpu-openrisc.c $(INCDIR)/filenames.h
cpu-pdp11.lo: cpu-pdp11.c $(INCDIR)/filenames.h
@ -1346,6 +1353,10 @@ elf64-mips.lo: elf64-mips.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h \
ecoffswap.h elf64-target.h
elf64-mmix.lo: elf64-mmix.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(INCDIR)/elf/mmix.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/opcode/mmix.h elf64-target.h
elf64-ppc.lo: elf64-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \
@ -1363,6 +1374,8 @@ elf64.lo: elf64.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
$(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h \
elflink.h
mmo.lo: mmo.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
$(INCDIR)/elf/mmix.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/mmix.h
nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/filenames.h \
$(INCDIR)/nlm/alpha-ext.h libnlm.h $(INCDIR)/nlm/common.h \
$(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h nlmswap.h \

View File

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -193,6 +193,7 @@ ALL_MACHINES = \
cpu-m10300.lo \
cpu-mcore.lo \
cpu-mips.lo \
cpu-mmix.lo \
cpu-ns32k.lo \
cpu-openrisc.lo \
cpu-pdp11.lo \
@ -239,6 +240,7 @@ ALL_MACHINES_CFILES = \
cpu-m10300.c \
cpu-mcore.c \
cpu-mips.c \
cpu-mmix.c \
cpu-ns32k.c \
cpu-openrisc.c \
cpu-pdp11.c \
@ -557,10 +559,12 @@ BFD64_BACKENDS = \
elf64-ia64.lo \
elf64-gen.lo \
elf64-mips.lo \
elf64-mmix.lo \
elf64-ppc.lo \
elf64-s390.lo \
elf64-sparc.lo \
elf64.lo \
mmo.lo \
nlm32-alpha.lo \
nlm64.lo \
pepigen.lo
@ -577,10 +581,12 @@ BFD64_BACKENDS_CFILES = \
elf64-hppa.c \
elf64-gen.c \
elf64-mips.c \
elf64-mmix.c \
elf64-ppc.c \
elf64-s390.c \
elf64-sparc.c \
elf64.c \
mmo.c \
nlm32-alpha.c \
nlm64.c
@ -716,7 +722,7 @@ configure.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
SOURCES = $(libbfd_a_SOURCES) $(libbfd_la_SOURCES)
OBJECTS = $(libbfd_a_OBJECTS) $(libbfd_la_OBJECTS)
@ -883,7 +889,7 @@ maintainer-clean-recursive:
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
test "$$subdir" = "." && dot_seen=yes; \
test "$$subdir" != "." || dot_seen=yes; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \
@ -1367,6 +1373,7 @@ cpu-m10200.lo: cpu-m10200.c $(INCDIR)/filenames.h
cpu-m10300.lo: cpu-m10300.c $(INCDIR)/filenames.h
cpu-mcore.lo: cpu-mcore.c $(INCDIR)/filenames.h
cpu-mips.lo: cpu-mips.c $(INCDIR)/filenames.h
cpu-mmix.lo: cpu-mmix.c $(INCDIR)/filenames.h
cpu-ns32k.lo: cpu-ns32k.c $(INCDIR)/filenames.h ns32k.h
cpu-openrisc.lo: cpu-openrisc.c $(INCDIR)/filenames.h
cpu-pdp11.lo: cpu-pdp11.c $(INCDIR)/filenames.h
@ -1889,6 +1896,10 @@ elf64-mips.lo: elf64-mips.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h \
ecoffswap.h elf64-target.h
elf64-mmix.lo: elf64-mmix.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(INCDIR)/elf/mmix.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/opcode/mmix.h elf64-target.h
elf64-ppc.lo: elf64-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \
@ -1906,6 +1917,8 @@ elf64.lo: elf64.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
$(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h \
elflink.h
mmo.lo: mmo.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
$(INCDIR)/elf/mmix.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/mmix.h
nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/filenames.h \
$(INCDIR)/nlm/alpha-ext.h libnlm.h $(INCDIR)/nlm/common.h \
$(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h nlmswap.h \

View File

@ -258,6 +258,7 @@ DESCRIPTION
.#define bfd_mach_s390_esa 0
.#define bfd_mach_s390_esame 1
. bfd_arch_openrisc, {* OpenRISC *}
. bfd_arch_mmix, {* Donald Knuth's educational processor *}
. bfd_arch_last
. };
*/
@ -336,6 +337,7 @@ extern const bfd_arch_info_type bfd_avr_arch;
extern const bfd_arch_info_type bfd_ia64_arch;
extern const bfd_arch_info_type bfd_s390_arch;
extern const bfd_arch_info_type bfd_openrisc_arch;
extern const bfd_arch_info_type bfd_mmix_arch;
static const bfd_arch_info_type * const bfd_archures_list[] = {
#ifdef SELECT_ARCHITECTURES
@ -383,6 +385,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] = {
&bfd_ia64_arch,
&bfd_s390_arch,
&bfd_openrisc_arch,
&bfd_mmix_arch,
#endif
0
};

View File

@ -1601,6 +1601,7 @@ enum bfd_architecture
#define bfd_mach_s390_esa 0
#define bfd_mach_s390_esame 1
bfd_arch_openrisc, /* OpenRISC */
bfd_arch_mmix, /* Donald Knuth's educational processor */
bfd_arch_last
};
@ -2566,6 +2567,54 @@ short offset into 11 bits. */
BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
BFD_RELOC_MCORE_RVA,
/* These are relocations for the GETA instruction. */
BFD_RELOC_MMIX_GETA,
BFD_RELOC_MMIX_GETA_1,
BFD_RELOC_MMIX_GETA_2,
BFD_RELOC_MMIX_GETA_3,
/* These are relocations for a conditional branch instruction. */
BFD_RELOC_MMIX_CBRANCH,
BFD_RELOC_MMIX_CBRANCH_J,
BFD_RELOC_MMIX_CBRANCH_1,
BFD_RELOC_MMIX_CBRANCH_2,
BFD_RELOC_MMIX_CBRANCH_3,
/* These are relocations for the PUSHJ instruction. */
BFD_RELOC_MMIX_PUSHJ,
BFD_RELOC_MMIX_PUSHJ_1,
BFD_RELOC_MMIX_PUSHJ_2,
BFD_RELOC_MMIX_PUSHJ_3,
/* These are relocations for the JMP instruction. */
BFD_RELOC_MMIX_JMP,
BFD_RELOC_MMIX_JMP_1,
BFD_RELOC_MMIX_JMP_2,
BFD_RELOC_MMIX_JMP_3,
/* This is a relocation for a relative address as in a GETA instruction or
a branch. */
BFD_RELOC_MMIX_ADDR19,
/* This is a relocation for a relative address as in a JMP instruction. */
BFD_RELOC_MMIX_ADDR27,
/* This is a relocation for an instruction field that may be a general
register or a value 0..255. */
BFD_RELOC_MMIX_REG_OR_BYTE,
/* This is a relocation for an instruction field that may be a general
register. */
BFD_RELOC_MMIX_REG,
/* This is a relocation for two instruction fields holding a register and
an offset, the equivalent of the relocation. */
BFD_RELOC_MMIX_BASE_PLUS_OFFSET,
/* This relocation is an assertion that the expression is not allocated as
a global register. It does not modify contents. */
BFD_RELOC_MMIX_LOCAL,
/* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
short offset into 7 bits. */
BFD_RELOC_AVR_7_PCREL,
@ -3166,6 +3215,7 @@ struct _bfd
struct elf_obj_tdata *elf_obj_data;
struct nlm_obj_tdata *nlm_obj_data;
struct bout_data_struct *bout_data;
struct mmo_data_struct *mmo_data;
struct sun_core_struct *sun_core_data;
struct sco5_core_struct *sco5_core_data;
struct trad_core_struct *trad_core_data;
@ -3425,7 +3475,8 @@ enum bfd_flavour {
bfd_target_versados_flavour,
bfd_target_msdos_flavour,
bfd_target_ovax_flavour,
bfd_target_evax_flavour
bfd_target_evax_flavour,
bfd_target_mmo_flavour
};
enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };

View File

@ -167,6 +167,7 @@ CODE_FRAGMENT
. struct elf_obj_tdata *elf_obj_data;
. struct nlm_obj_tdata *nlm_obj_data;
. struct bout_data_struct *bout_data;
. struct mmo_data_struct *mmo_data;
. struct sun_core_struct *sun_core_data;
. struct sco5_core_struct *sco5_core_data;
. struct trad_core_struct *trad_core_data;

View File

@ -710,6 +710,12 @@ case "${targ}" in
targ_defvec=bfd_elf32_tradbigmips_vec
targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_big_vec ecoff_little_vec"
;;
#ifdef BFD64
mmix-*-*)
targ_defvec=bfd_elf64_mmix_vec
targ_selvecs=bfd_mmo_vec
;;
#endif
mn10200-*-*)
targ_defvec=bfd_elf32_mn10200_vec
;;

332
bfd/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -594,6 +594,7 @@ do
bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf64_mmix_vec) tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;;
bfd_elf64_powerpc_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_powerpcle_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
bfd_elf64_s390_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;;
@ -601,6 +602,7 @@ do
bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;;
bfd_mmo_vec) tb="$tb mmo.lo" target_size=64 ;;
bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
bfd_powerpcle_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;

41
bfd/cpu-mmix.c Normal file
View File

@ -0,0 +1,41 @@
/* BFD library support routines for MMIX.
Copyright (C) 2001 Free Software Foundation, Inc.
Contributed by Hans-Peter Nilsson (hp@bitrange.com)
This file is part of BFD, the Binary File Descriptor library.
This program 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 of the License, or
(at your option) any later version.
This program 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 this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
const bfd_arch_info_type
bfd_mmix_arch =
{
64, /* 64 bits in a word. */
64, /* 64 bits in an address. */
8, /* 8 bits in a byte. */
bfd_arch_mmix, /* Architecture. */
0, /* Machine number - 0 for now. */
/* Sorry, these are by custom and creeping assumption lower-case. */
"mmix", /* Architecture name. */
"mmix", /* Printable name. */
3, /* Section align power. */
true, /* This is the default architecture. */
bfd_default_compatible, /* Architecture comparison function. */
bfd_default_scan, /* String to architecture conversion. */
NULL /* Next in list. */
};

View File

@ -1,3 +1,12 @@
2001-10-30 Hans-Peter Nilsson <hp@bitrange.com>
* doc/bfdint.texi (BFD target vector miscellaneous): Add
bfd_target_mmo_flavour.
* doc/bfd.texinfo (BFD back ends): Add entry for mmo.
* doc/Makefile.am (DOCFILES): Add mmo.texi.
(SRCDOC): Add mmo.c.
(s-mmo, mmo.texi): New rules.
2001-10-29 Kazu Hirata <kazu@hxi.com>
* bfdsumm.texi: Fix a typo.

View File

@ -6,7 +6,8 @@ DOCFILES = aoutx.texi archive.texi archures.texi \
bfdt.texi cache.texi coffcode.texi \
core.texi elf.texi elfcode.texi format.texi libbfd.texi \
opncls.texi reloc.texi section.texi \
syms.texi targets.texi init.texi hash.texi linker.texi
syms.texi targets.texi init.texi hash.texi linker.texi \
mmo.texi
PROTOS = archive.p archures.p bfd.p \
core.p format.p \
@ -27,7 +28,8 @@ SRCDOC = $(srcdir)/../aoutx.h $(srcdir)/../archive.c \
$(srcdir)/../libbfd.c $(srcdir)/../opncls.c \
$(srcdir)/../reloc.c $(srcdir)/../section.c \
$(srcdir)/../syms.c $(srcdir)/../targets.c \
$(srcdir)/../hash.c $(srcdir)/../linker.c
$(srcdir)/../hash.c $(srcdir)/../linker.c \
$(srcdir)/../mmo.c
SRCPROT = $(srcdir)/../archive.c $(srcdir)/../archures.c \
$(srcdir)/../bfd.c $(srcdir)/../coffcode.h $(srcdir)/../corefile.c \
@ -123,6 +125,12 @@ s-elfcode: $(MKDOC) $(srcdir)/../elfcode.h $(srcdir)/doc.str
touch s-elfcode
elfcode.texi: s-elfcode
s-mmo: $(MKDOC) $(srcdir)/../mmo.c $(srcdir)/doc.str
./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../mmo.c >mmo.tmp
$(srcdir)/../../move-if-change mmo.tmp mmo.texi
touch s-mmo
mmo.texi: s-mmo
s-format: $(MKDOC) $(srcdir)/../format.c $(srcdir)/doc.str
./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../format.c >format.tmp
$(srcdir)/../../move-if-change format.tmp format.texi

View File

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -130,7 +130,8 @@ DOCFILES = aoutx.texi archive.texi archures.texi \
bfdt.texi cache.texi coffcode.texi \
core.texi elf.texi elfcode.texi format.texi libbfd.texi \
opncls.texi reloc.texi section.texi \
syms.texi targets.texi init.texi hash.texi linker.texi
syms.texi targets.texi init.texi hash.texi linker.texi \
mmo.texi
PROTOS = archive.p archures.p bfd.p \
@ -153,7 +154,8 @@ SRCDOC = $(srcdir)/../aoutx.h $(srcdir)/../archive.c \
$(srcdir)/../libbfd.c $(srcdir)/../opncls.c \
$(srcdir)/../reloc.c $(srcdir)/../section.c \
$(srcdir)/../syms.c $(srcdir)/../targets.c \
$(srcdir)/../hash.c $(srcdir)/../linker.c
$(srcdir)/../hash.c $(srcdir)/../linker.c \
$(srcdir)/../mmo.c
SRCPROT = $(srcdir)/../archive.c $(srcdir)/../archures.c \
@ -239,7 +241,7 @@ DIST_COMMON = ChangeLog Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
@ -325,7 +327,7 @@ uninstall-info:
else ii=; fi; \
list='$(INFO_DEPS)'; \
for file in $$list; do \
test -z "$ii" \
test -z "$$ii" \
|| install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
done
@$(NORMAL_UNINSTALL)
@ -529,6 +531,12 @@ s-elfcode: $(MKDOC) $(srcdir)/../elfcode.h $(srcdir)/doc.str
touch s-elfcode
elfcode.texi: s-elfcode
s-mmo: $(MKDOC) $(srcdir)/../mmo.c $(srcdir)/doc.str
./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../mmo.c >mmo.tmp
$(srcdir)/../../move-if-change mmo.tmp mmo.texi
touch s-mmo
mmo.texi: s-mmo
s-format: $(MKDOC) $(srcdir)/../format.c $(srcdir)/doc.str
./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../format.c >format.tmp
$(srcdir)/../../move-if-change format.tmp format.texi

View File

@ -298,6 +298,7 @@ structures.
* aout :: a.out backends
* coff :: coff backends
* elf :: elf backends
* mmo :: mmo backend
@ignore
* oasys :: oasys backends
* ieee :: ieee backend
@ -313,11 +314,14 @@ All of BFD lives in one directory.
@node coff, elf, aout, BFD back ends
@include coffcode.texi
@node elf, , coff, BFD back ends
@node elf, mmo, coff, BFD back ends
@include elf.texi
@c Leave this out until the file has some actual contents...
@c @include elfcode.texi
@node mmo, , elf, BFD back ends
@include mmo.texi
@node GNU Free Documentation License, Index, BFD back ends, Top
@chapter GNU Free Documentation License
@cindex GNU Free Documentation License

View File

@ -335,6 +335,8 @@ VERSAdos.
MS-DOS.
@item bfd_target_evax_flavour
openVMS.
@item bfd_target_mmo_flavour
Donald Knuth's MMIXware object format.
@end table
@item byteorder

1739
bfd/elf64-mmix.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -66,6 +66,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef elf_backend_got_symbol_offset
#define elf_backend_got_symbol_offset (bfd_vma) 0
#endif
#ifndef elf_backend_can_refcount
#define elf_backend_can_refcount 0
#endif
#ifndef elf_backend_want_got_plt
#define elf_backend_want_got_plt 0
#endif

View File

@ -954,6 +954,29 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_MCORE_PCREL_32",
"BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2",
"BFD_RELOC_MCORE_RVA",
"BFD_RELOC_MMIX_GETA",
"BFD_RELOC_MMIX_GETA_1",
"BFD_RELOC_MMIX_GETA_2",
"BFD_RELOC_MMIX_GETA_3",
"BFD_RELOC_MMIX_CBRANCH",
"BFD_RELOC_MMIX_CBRANCH_J",
"BFD_RELOC_MMIX_CBRANCH_1",
"BFD_RELOC_MMIX_CBRANCH_2",
"BFD_RELOC_MMIX_CBRANCH_3",
"BFD_RELOC_MMIX_PUSHJ",
"BFD_RELOC_MMIX_PUSHJ_1",
"BFD_RELOC_MMIX_PUSHJ_2",
"BFD_RELOC_MMIX_PUSHJ_3",
"BFD_RELOC_MMIX_JMP",
"BFD_RELOC_MMIX_JMP_1",
"BFD_RELOC_MMIX_JMP_2",
"BFD_RELOC_MMIX_JMP_3",
"BFD_RELOC_MMIX_ADDR19",
"BFD_RELOC_MMIX_ADDR27",
"BFD_RELOC_MMIX_REG_OR_BYTE",
"BFD_RELOC_MMIX_REG",
"BFD_RELOC_MMIX_BASE_PLUS_OFFSET",
"BFD_RELOC_MMIX_LOCAL",
"BFD_RELOC_AVR_7_PCREL",
"BFD_RELOC_AVR_13_PCREL",
"BFD_RELOC_AVR_16_PM",

3274
bfd/mmo.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,15 +1,15 @@
aix386-core.c
aout0.c
aout32.c
aout64.c
aout-adobe.c
aout-arm.c
aout-cris.c
aoutf1.h
aout-ns32k.c
aout-sparcle.c
aout-target.h
aout-tic30.c
aout0.c
aout32.c
aout64.c
aoutf1.h
aoutx.h
archive.c
archures.c
@ -22,17 +22,21 @@ cf-i386lynx.c
cf-m68klynx.c
cf-sparclynx.c
cisco-core.c
coff64-rs6000.c
coff-a29k.c
coff-alpha.c
coff-apollo.c
coff-arm.c
coff-aux.c
coffcode.h
coffgen.c
coff-go32.c
coff-h8300.c
coff-h8500.c
coff-i386.c
coff-i860.c
coff-i960.c
cofflink.c
coff-m68k.c
coff-m88k.c
coff-mips.c
@ -41,6 +45,7 @@ coff-sh.c
coff-sparc.c
coff-stgo32.c
coff-svm68k.c
coffswap.h
coff-tic30.c
coff-tic54x.c
coff-tic80.c
@ -48,11 +53,6 @@ coff-u68k.c
coff-w65.c
coff-we32k.c
coff-z8k.c
coff64-rs6000.c
coffcode.h
coffgen.c
cofflink.c
coffswap.h
corefile.c
cpu-a29k.c
cpu-alpha.c
@ -105,14 +105,10 @@ ecofflink.c
ecoffswap.h
efi-app-ia32.c
efi-app-ia64.c
elf-bfd.h
elf-hppa.h
elf-m10200.c
elf-m10300.c
elf.c
elf32-arc.c
elf32-arm.h
elf32-avr.c
elf32.c
elf32-cris.c
elf32-d10v.c
elf32-d30v.c
@ -136,12 +132,12 @@ elf32-openrisc.c
elf32-pj.c
elf32-ppc.c
elf32-s390.c
elf32-sh-lin.c
elf32-sh.c
elf32-sh-lin.c
elf32-sparc.c
elf32-v850.c
elf32.c
elf64-alpha.c
elf64.c
elf64-gen.c
elf64-hppa.c
elf64-hppa.h
@ -150,13 +146,17 @@ elf64-ppc.c
elf64-s390.c
elf64-sparc.c
elf64-x86-64.c
elf64.c
elfarm-nabi.c
elfarm-oabi.c
elf-bfd.h
elf.c
elfcode.h
elfcore.h
elf-hppa.h
elflink.c
elflink.h
elf-m10200.c
elf-m10300.c
epoc-pe-arm.c
epoc-pei-arm.c
format.c
@ -203,16 +203,16 @@ merge.c
mipsbsd.c
netbsd.h
newsos3.c
nlm-target.h
nlm.c
nlm32-alpha.c
nlm32.c
nlm32-i386.c
nlm32-ppc.c
nlm32-sparc.c
nlm32.c
nlm64.c
nlm.c
nlmcode.h
nlmswap.h
nlm-target.h
ns32k.h
ns32knetbsd.c
oasys.c
@ -222,20 +222,20 @@ pc532-mach.c
pdp11.c
pe-arm.c
pe-i386.c
pe-mcore.c
pe-mips.c
pe-ppc.c
pe-sh.c
pei-arm.c
peicode.h
pei-i386.c
pei-mcore.c
pei-mips.c
pei-ppc.c
pei-sh.c
peicode.h
pe-mcore.c
pe-mips.c
pe-ppc.c
pe-sh.c
ppcboot.c
reloc.c
reloc16.c
reloc.c
riscix.c
sco5-core.c
section.c
@ -245,8 +245,8 @@ sparclinux.c
sparclynx.c
sparcnetbsd.c
srec.c
stab-syms.c
stabs.c
stab-syms.c
sunos.c
syms.c
targets.c
@ -255,11 +255,11 @@ trad-core.c
vaxnetbsd.c
versados.c
version.h
vms.c
vms-gsd.c
vms.h
vms-hdr.c
vms-misc.c
vms-tir.c
vms.c
vms.h
xcoff-target.h
xcofflink.c
xcoff-target.h

File diff suppressed because it is too large Load Diff

View File

@ -2722,6 +2722,78 @@ ENUMX
ENUMDOC
Motorola Mcore relocations.
ENUM
BFD_RELOC_MMIX_GETA
ENUMX
BFD_RELOC_MMIX_GETA_1
ENUMX
BFD_RELOC_MMIX_GETA_2
ENUMX
BFD_RELOC_MMIX_GETA_3
ENUMDOC
These are relocations for the GETA instruction.
ENUM
BFD_RELOC_MMIX_CBRANCH
ENUMX
BFD_RELOC_MMIX_CBRANCH_J
ENUMX
BFD_RELOC_MMIX_CBRANCH_1
ENUMX
BFD_RELOC_MMIX_CBRANCH_2
ENUMX
BFD_RELOC_MMIX_CBRANCH_3
ENUMDOC
These are relocations for a conditional branch instruction.
ENUM
BFD_RELOC_MMIX_PUSHJ
ENUMX
BFD_RELOC_MMIX_PUSHJ_1
ENUMX
BFD_RELOC_MMIX_PUSHJ_2
ENUMX
BFD_RELOC_MMIX_PUSHJ_3
ENUMDOC
These are relocations for the PUSHJ instruction.
ENUM
BFD_RELOC_MMIX_JMP
ENUMX
BFD_RELOC_MMIX_JMP_1
ENUMX
BFD_RELOC_MMIX_JMP_2
ENUMX
BFD_RELOC_MMIX_JMP_3
ENUMDOC
These are relocations for the JMP instruction.
ENUM
BFD_RELOC_MMIX_ADDR19
ENUMDOC
This is a relocation for a relative address as in a GETA instruction or
a branch.
ENUM
BFD_RELOC_MMIX_ADDR27
ENUMDOC
This is a relocation for a relative address as in a JMP instruction.
ENUM
BFD_RELOC_MMIX_REG_OR_BYTE
ENUMDOC
This is a relocation for an instruction field that may be a general
register or a value 0..255.
ENUM
BFD_RELOC_MMIX_REG
ENUMDOC
This is a relocation for an instruction field that may be a general
register.
ENUM
BFD_RELOC_MMIX_BASE_PLUS_OFFSET
ENUMDOC
This is a relocation for two instruction fields holding a register and
an offset, the equivalent of the relocation.
ENUM
BFD_RELOC_MMIX_LOCAL
ENUMDOC
This relocation is an assertion that the expression is not allocated as
a global register. It does not modify contents.
ENUM
BFD_RELOC_AVR_7_PCREL
ENUMDOC

View File

@ -153,7 +153,8 @@ DESCRIPTION
. bfd_target_versados_flavour,
. bfd_target_msdos_flavour,
. bfd_target_ovax_flavour,
. bfd_target_evax_flavour
. bfd_target_evax_flavour,
. bfd_target_mmo_flavour
.};
.
.enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
@ -564,6 +565,7 @@ extern const bfd_target bfd_elf64_ia64_big_vec;
extern const bfd_target bfd_elf64_ia64_little_vec;
extern const bfd_target bfd_elf64_little_generic_vec;
extern const bfd_target bfd_elf64_littlemips_vec;
extern const bfd_target bfd_elf64_mmix_vec;
extern const bfd_target bfd_elf64_powerpc_vec;
extern const bfd_target bfd_elf64_powerpcle_vec;
extern const bfd_target bfd_elf64_s390_vec;
@ -571,6 +573,7 @@ extern const bfd_target bfd_elf64_sparc_vec;
extern const bfd_target bfd_elf64_tradbigmips_vec;
extern const bfd_target bfd_elf64_tradlittlemips_vec;
extern const bfd_target bfd_elf64_x86_64_vec;
extern const bfd_target bfd_mmo_vec;
extern const bfd_target bfd_powerpc_pe_vec;
extern const bfd_target bfd_powerpc_pei_vec;
extern const bfd_target bfd_powerpcle_pe_vec;
@ -802,6 +805,7 @@ static const bfd_target * const _bfd_target_vector[] = {
&bfd_elf64_ia64_little_vec,
&bfd_elf64_little_generic_vec,
&bfd_elf64_littlemips_vec,
&bfd_elf64_mmix_vec,
&bfd_elf64_powerpc_vec,
&bfd_elf64_powerpcle_vec,
&bfd_elf64_s390_vec,
@ -811,6 +815,9 @@ static const bfd_target * const _bfd_target_vector[] = {
&bfd_elf64_tradbigmips_vec,
&bfd_elf64_tradlittlemips_vec,
&bfd_elf64_x86_64_vec,
#if 0
&bfd_mmo_mmix_vec,
#endif
#endif
&bfd_powerpc_pe_vec,
&bfd_powerpc_pei_vec,

View File

@ -1,3 +1,11 @@
2001-10-30 Hans-Peter Nilsson <hp@bitrange.com>
* readelf.c: Include elf/mmix.h.
(guess_is_rela): MMIX is RELA.
(dump_relocations): Handle MMIX relocations.
* Makefile.am: Regenerate dependencies.
* Makefile.in: Regenerate.
2001-10-13 Nick Clifton <nickc@cambridge.redhat.com>
* readelf.c (parse_args): Handle multiple options to the -w

View File

@ -68,6 +68,7 @@
#include "elf/arc.h"
#include "elf/fr30.h"
#include "elf/mcore.h"
#include "elf/mmix.h"
#include "elf/i960.h"
#include "elf/pj.h"
#include "elf/avr.h"
@ -587,6 +588,7 @@ guess_is_rela (e_machine)
case EM_X86_64:
case EM_S390:
case EM_S390_OLD:
case EM_MMIX:
return TRUE;
case EM_MMA:
@ -941,6 +943,10 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela)
rtype = elf_mcore_reloc_type (type);
break;
case EM_MMIX:
rtype = elf_mmix_reloc_type (type);
break;
case EM_PPC:
case EM_PPC64:
rtype = elf_ppc_reloc_type (type);

View File

@ -1,3 +1,17 @@
2001-10-30 Hans-Peter Nilsson <hp@bitrange.com>
* configure.in: Update for MMIX port.
* Makefile.am: Ditto. Regenerate dependencies.
* Makefile.in: Regenerate.
* configure: Regenerate.
* config/tc-mmix.h, config/tc-mmix.c: New files.
* doc/Makefile.am (CPU_DOCS): Add c-mmix.texi
* doc/Makefile.in: Regenerate.
* doc/all.texi: @set MMIX.
* doc/as.texinfo: Ditto. Add MMIX gas manpage option overview.
Include c-mmix.texi.
* doc/c-mmix.texi: New file.
2001-10-24 Chris Demetriou <cgd@broadcom.com>
* config/tc-mips.c (hilo_interlocks, cop_interlocks): Make

View File

@ -60,6 +60,7 @@ CPU_TYPES = \
m88k \
mcore \
mips \
mmix \
mn10200 \
mn10300 \
ns32k \
@ -112,7 +113,7 @@ CPU_OBJ_VALID = \
esac ;; \
coff) valid=yes; \
case $$c in \
cris | i860) \
cris | i860 | mmix) \
valid= ;; \
esac ;; \
ecoff) \
@ -244,6 +245,7 @@ TARGET_CPU_CFILES = \
config/tc-m88k.c \
config/tc-mcore.c \
config/tc-mips.c \
config/tc-mmix.c \
config/tc-mn10200.c \
config/tc-mn10300.c \
config/tc-ns32k.c \
@ -287,6 +289,7 @@ TARGET_CPU_HFILES = \
config/tc-m88k.h \
config/tc-mcore.h \
config/tc-mips.h \
config/tc-mmix.h \
config/tc-mn10200.h \
config/tc-mn10300.h \
config/tc-ns32k.h \
@ -1209,6 +1212,11 @@ DEPTC_mips_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
$(INCDIR)/opcode/mips.h itbl-ops.h $(INCDIR)/elf/mips.h \
$(INCDIR)/elf/reloc-macros.h ecoff.h $(INCDIR)/coff/sym.h \
$(INCDIR)/coff/ecoff.h
DEPTC_mmix_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-mmix.h subsegs.h \
$(INCDIR)/obstack.h $(INCDIR)/elf/mmix.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/opcode/mmix.h $(INCDIR)/safe-ctype.h dwarf2dbg.h
DEPTC_mn10200_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
$(srcdir)/config/tc-mn10200.h $(INCDIR)/coff/internal.h \
$(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
@ -1647,6 +1655,10 @@ DEPOBJ_mips_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
$(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \
$(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h
DEPOBJ_mmix_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-mmix.h $(INCDIR)/safe-ctype.h \
subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
DEPOBJ_mn10200_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
$(srcdir)/config/tc-mn10200.h $(INCDIR)/coff/internal.h \
$(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
@ -1992,6 +2004,9 @@ DEP_mips_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-mips.h \
DEP_mips_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-mips.h
DEP_mmix_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-mmix.h
DEP_mn10200_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mn10200.h \
$(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \
$(INCDIR)/bfdlink.h

View File

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -171,6 +171,7 @@ CPU_TYPES = \
m88k \
mcore \
mips \
mmix \
mn10200 \
mn10300 \
ns32k \
@ -225,7 +226,7 @@ CPU_OBJ_VALID = \
esac ;; \
coff) valid=yes; \
case $$c in \
cris | i860) \
cris | i860 | mmix) \
valid= ;; \
esac ;; \
ecoff) \
@ -361,6 +362,7 @@ TARGET_CPU_CFILES = \
config/tc-m88k.c \
config/tc-mcore.c \
config/tc-mips.c \
config/tc-mmix.c \
config/tc-mn10200.c \
config/tc-mn10300.c \
config/tc-ns32k.c \
@ -405,6 +407,7 @@ TARGET_CPU_HFILES = \
config/tc-m88k.h \
config/tc-mcore.h \
config/tc-mips.h \
config/tc-mmix.h \
config/tc-mn10200.h \
config/tc-mn10300.h \
config/tc-ns32k.h \
@ -970,6 +973,12 @@ DEPTC_mips_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
$(INCDIR)/elf/reloc-macros.h ecoff.h $(INCDIR)/coff/sym.h \
$(INCDIR)/coff/ecoff.h
DEPTC_mmix_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-mmix.h subsegs.h \
$(INCDIR)/obstack.h $(INCDIR)/elf/mmix.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/opcode/mmix.h $(INCDIR)/safe-ctype.h dwarf2dbg.h
DEPTC_mn10200_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
$(srcdir)/config/tc-mn10200.h $(INCDIR)/coff/internal.h \
$(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
@ -1509,6 +1518,11 @@ DEPOBJ_mips_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \
$(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h
DEPOBJ_mmix_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-mmix.h $(INCDIR)/safe-ctype.h \
subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
DEPOBJ_mn10200_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
$(srcdir)/config/tc-mn10200.h $(INCDIR)/coff/internal.h \
$(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
@ -1953,6 +1967,10 @@ DEP_mips_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-mips.h
DEP_mmix_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-mmix.h
DEP_mn10200_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mn10200.h \
$(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \
$(INCDIR)/bfdlink.h
@ -2173,7 +2191,7 @@ configure configure.in gdbinit.in itbl-lex.c itbl-parse.c
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
SOURCES = $(itbl_test_SOURCES) $(as_new_SOURCES) $(EXTRA_as_new_SOURCES) $(gasp_new_SOURCES)
OBJECTS = $(itbl_test_OBJECTS) $(as_new_OBJECTS) $(gasp_new_OBJECTS)
@ -2334,7 +2352,7 @@ maintainer-clean-recursive:
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
test "$$subdir" = "." && dot_seen=yes; \
test "$$subdir" != "." || dot_seen=yes; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \

4180
gas/config/tc-mmix.c Normal file

File diff suppressed because it is too large Load Diff

214
gas/config/tc-mmix.h Normal file
View File

@ -0,0 +1,214 @@
/* tc-mmix.h -- Header file for tc-mmix.c.
Copyright (C) 2001 Free Software Foundation, Inc.
Written by Hans-Peter Nilsson (hp@bitrange.com).
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. */
#define TC_MMIX
/* See gas/doc/internals.texi for explanation of these macros. */
#define TARGET_FORMAT "elf64-mmix"
#define TARGET_ARCH bfd_arch_mmix
#define TARGET_BYTES_BIG_ENDIAN 1
extern const char mmix_comment_chars[];
#define tc_comment_chars mmix_comment_chars
extern const char mmix_symbol_chars[];
#define tc_symbol_chars mmix_symbol_chars
extern const char mmix_exp_chars[];
#define EXP_CHARS mmix_exp_chars
extern const char mmix_flt_chars[];
#define FLT_CHARS mmix_flt_chars
/* "@" is a synonym for ".". */
#define LEX_AT (LEX_BEGIN_NAME)
extern int mmix_label_without_colon_this_line PARAMS ((void));
#define LABELS_WITHOUT_COLONS mmix_label_without_colon_this_line ()
extern int mmix_next_semicolon_is_eoln;
#define TC_EOL_IN_INSN(p) (*(p) == ';' && ! mmix_next_semicolon_is_eoln)
/* This is one direction we can get mmixal compatibility. */
extern void mmix_handle_mmixal PARAMS ((void));
#define md_start_line_hook mmix_handle_mmixal
extern void mmix_md_begin PARAMS ((void));
#define md_begin mmix_md_begin
extern void mmix_md_end PARAMS ((void));
#define md_end mmix_md_end
extern int mmix_current_location \
PARAMS ((void (*fn) (expressionS *), expressionS *));
extern int mmix_parse_predefined_name PARAMS ((char *, expressionS *));
extern char *mmix_current_prefix;
/* A bit ugly, since we "know" that there's a static function
current_location that does what we want. We also strip off a leading
':' in another ugly way.
The [DVWIOUZX]_Handler symbols are provided when-used. */
extern int mmix_gnu_syntax;
#define md_parse_name(name, exp, cpos) \
(! mmix_gnu_syntax \
&& (name[0] == '@' \
? (! is_part_of_name (name[1]) \
&& mmix_current_location (current_location, exp)) \
: ((name[0] == ':' || isupper (name[0])) \
&& mmix_parse_predefined_name (name, exp))))
extern char *mmix_prefix_name PARAMS ((char *));
/* We implement when *creating* a symbol, we also need to strip a ':' or
prepend a prefix. */
#define tc_canonicalize_symbol_name(x) \
(mmix_current_prefix == NULL && (x)[0] != ':' ? (x) : mmix_prefix_name (x))
#define md_undefined_symbol(x) NULL
extern void mmix_fb_label PARAMS ((expressionS *));
/* Since integer_constant is local to expr.c, we have to make this a
macro. FIXME: Do it cleaner. */
#define md_operand(exp) \
do { \
if (input_line_pointer[0] == '#') \
{ \
input_line_pointer++; \
integer_constant (16, (exp)); \
} \
else if (input_line_pointer[0] == '&' \
&& input_line_pointer[1] != '&') \
as_bad (_("`&' serial number operator is not supported")); \
else \
mmix_fb_label (exp); \
} while (0)
/* Gas dislikes the 2ADD, 8ADD etc. insns, so we have to assemble them in
the error-recovery loop. Hopefully there are no significant
differences. Also, space on a line isn't gracefully handled. */
extern int mmix_assemble_return_nonzero PARAMS ((char *));
#define tc_unrecognized_line(c) \
((c) == ' ' \
|| (((c) == '1' || (c) == '2' || (c) == '4' || (c) == '8') \
&& mmix_assemble_return_nonzero (input_line_pointer - 1)))
#define md_number_to_chars number_to_chars_bigendian
#define WORKING_DOT_WORD
extern const struct relax_type mmix_relax_table[];
#define TC_GENERIC_RELAX_TABLE mmix_relax_table
/* We use the relax table for everything except the GREG frags. */
extern long mmix_md_relax_frag PARAMS ((segT, fragS *, long));
#define md_relax_frag mmix_md_relax_frag
#define tc_fix_adjustable(X) \
((! (X)->fx_addsy \
|| (! S_IS_WEAK ((X)->fx_addsy) \
&& S_GET_SEGMENT ((X)->fx_addsy) != reg_section)) \
&& (X)->fx_r_type != BFD_RELOC_VTABLE_INHERIT \
&& (X)->fx_r_type != BFD_RELOC_VTABLE_ENTRY)
/* Adjust symbols which are registers. */
#define tc_adjust_symtab() mmix_adjust_symtab ()
extern void mmix_adjust_symtab PARAMS ((void));
/* Avoid outputting GAS register section symbols. This happens when the
assembly had errors, and will propagate to an assert in BFD. FIXME:
It seems the symbol output when-errors is a bug in GAS. Fix that
some time. See also tc_gen_reloc.
Here's where we make all symbols global, when so requested.
We must avoid doing that for expression symbols or section symbols,
though. */
extern int mmix_globalize_symbols;
#define tc_frob_symbol(sym, punt) \
do { \
if (S_GET_SEGMENT (sym) == reg_section \
|| (symp) == section_symbol (absolute_section)) \
(punt) = 1; \
\
if (mmix_globalize_symbols \
&& ! symbol_section_p (sym) \
&& symp != section_symbol (absolute_section) \
&& (! S_IS_LOCAL (sym) \
|| S_GET_SEGMENT (sym) == reg_section) \
&& (S_GET_SEGMENT (sym) != reg_section \
|| (S_GET_NAME (sym)[0] != '$' \
&& S_GET_VALUE (sym) < 256))) \
S_SET_EXTERNAL (sym); \
} while (0)
/* When relaxing, we need to emit various relocs we otherwise wouldn't. */
#define TC_FORCE_RELOCATION(fix) mmix_force_relocation (fix)
extern int mmix_force_relocation PARAMS ((struct fix *));
/* Call md_pcrel_from_section(), not md_pcrel_from(). */
#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section (FIXP, SEC)
extern long md_pcrel_from_section PARAMS ((struct fix *, segT));
#define MD_APPLY_FIX3
#define TC_HANDLES_FX_DONE
#define md_section_align(seg, size) (size)
#define LISTING_HEADER "GAS for MMIX"
/* The default of 4 means Bcc expansion looks like it's missing a line. */
#define LISTING_LHS_CONT_LINES 5
extern fragS *mmix_opcode_frag;
#define TC_FRAG_TYPE fragS *
#define TC_FRAG_INIT(frag) (frag)->tc_frag_data = mmix_opcode_frag
/* We need to associate each section symbol with a list of GREGs defined
for that section/segment and sorted on offset, between the point where
all symbols have been evaluated and all frags mapped, and when the
fixups are done and relocs are output. Similarly for each unknown
symbol. */
extern void mmix_frob_file PARAMS ((void));
#define tc_frob_file mmix_frob_file
/* Used by mmix_frob_file. Hangs on section symbols and unknown symbols. */
struct mmix_symbol_gregs;
#define TC_SYMFIELD_TYPE struct mmix_symbol_gregs *
extern void mmix_frob_file_before_adjust PARAMS ((void));
#define tc_frob_file_before_adjust mmix_frob_file_before_adjust
extern void mmix_md_elf_section_change_hook PARAMS ((void));
#define md_elf_section_change_hook mmix_md_elf_section_change_hook
extern void mmix_md_do_align PARAMS ((int, char *, int, int));
#define md_do_align(n, fill, len, max, label) \
mmix_md_do_align (n, fill, len, max)
/* Each insn is a tetrabyte (4 bytes) long, but if there are BYTE
sequences sprinkled in, we can get unaligned DWARF2 offsets, so let's
explicitly say one byte. */
#define DWARF2_LINE_MIN_INSN_LENGTH 1

487
gas/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -359,6 +359,7 @@ changequote([,])dnl
mips-*-elf* | mips-*-rtems* | mips-*-openbsd*)
fmt=elf ;;
mips-*-vxworks*) fmt=elf mips_stabs_elf=y ;;
mmix-*-*) fmt=elf bfd_gas=yes ;;
mn10200-*-*) fmt=elf bfd_gas=yes ;;
mn10300-*-*) fmt=elf bfd_gas=yes ;;
openrisc-*-*) fmt=elf bfd_gas=yes ;;

View File

@ -39,6 +39,7 @@ CPU_DOCS = \
c-m68k.texi \
c-m88k.texi \
c-mips.texi \
c-mmix.texi \
c-ns32k.texi \
c-pdp11.texi \
c-pj.texi \

View File

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -149,6 +149,7 @@ CPU_DOCS = \
c-m68k.texi \
c-m88k.texi \
c-mips.texi \
c-mmix.texi \
c-ns32k.texi \
c-pdp11.texi \
c-pj.texi \
@ -185,7 +186,7 @@ DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
@ -275,7 +276,7 @@ uninstall-info:
else ii=; fi; \
list='$(INFO_DEPS)'; \
for file in $$list; do \
test -z "$ii" \
test -z "$$ii" \
|| install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
done
@$(NORMAL_UNINSTALL)

View File

@ -44,6 +44,7 @@
@set M880X0
@set MCORE
@set MIPS
@set MMIX
@set PDP11
@set PJ
@set PPC

View File

@ -43,6 +43,7 @@
@set M880X0
@set MCORE
@set MIPS
@set MMIX
@set PDP11
@set PJ
@set PPC
@ -346,6 +347,11 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}.
[ -m4650 ] [ -no-m4650 ]
[ --trap ] [ --break ] [ -n ]
[ --emulation=@var{name} ]
@end ifset
@ifset MMIX
[ --fixed-special-register-names ] [ --globalize-symbols ]
[ --gnu-syntax ] [ --relax ] [ --no-predefined-symbols ]
[ --no-expand ] [ --no-merge-gregs ] [ -x ]
@end ifset
[ -- | @var{files} @dots{} ]
@c man end
@ -880,6 +886,10 @@ Assemble for a little endian target.
@end table
@end ifset
@ifset MMIX
See the info pages for documentation of the MMIX-specific options.
@end ifset
@c man end
@menu
@ -5566,6 +5576,9 @@ subject, see the hardware manufacturer's manual.
@ifset MIPS
* MIPS-Dependent:: MIPS Dependent Features
@end ifset
@ifset MMIX
* MMIX-Dependent:: MMIX Dependent Features
@end ifset
@ifset SH
* SH-Dependent:: Hitachi SH Dependent Features
@end ifset
@ -5693,6 +5706,10 @@ family.
@include c-mips.texi
@end ifset
@ifset MMIX
@include c-mmix.texi
@end ifset
@ifset NS32K
@include c-ns32k.texi
@end ifset

559
gas/doc/c-mmix.texi Normal file
View File

@ -0,0 +1,559 @@
@c Copyright 2001 Free Software Foundation, Inc.
@c This is part of the GAS manual.
@c For copying conditions, see the file as.texinfo.
@c MMIX description by Hans-Peter Nilsson, hp@bitrange.com
@ifset GENERIC
@page
@node MMIX-Dependent
@chapter MMIX Dependent Features
@end ifset
@ifclear GENERIC
@node Machine Dependencies
@chapter MMIX Dependent Features
@end ifclear
@cindex MMIX support
@menu
* MMIX-Opts:: Command-line Options
* MMIX-Expand:: Instruction expansion
* MMIX-Syntax:: Syntax
* MMIX-mmixal:: Differences to @code{mmixal} syntax and semantics
@end menu
@node MMIX-Opts
@section Command-line Options
@cindex options, MMIX
@cindex MMIX options
The MMIX version of @code{@value{AS}} has some machine-dependent options.
@cindex @samp{--fixed-special-register-names} command line option, MMIX
When @samp{--fixed-special-register-names} is specified, only the register
names specified in @ref{MMIX-Regs} are recognized in the instructions
@code{PUT} and @code{GET}.
@cindex @samp{--globalize-symbols} command line option, MMIX
You can use the @samp{--globalize-symbols} to make all symbols global.
This option is useful when splitting up a @code{mmixal} program into
several files.
@cindex @samp{--gnu-syntax} command line option, MMIX
The @samp{--gnu-syntax} turns off most syntax compatibility with
@code{mmixal}. Its usability is currently doubtful.
@cindex @samp{--relax} command line option, MMIX
The @samp{--relax} option is not fully supported, but will eventually make
the object file prepared for linker relaxation.
@cindex @samp{--no-predefined-syms} command line option, MMIX
If you want to avoid inadvertently calling a predefined symbol and would
rather get an error, for example when using @code{@value{AS}} with a
compiler or other machine-generated code, specify
@samp{--no-predefined-syms}. This turns off built-in predefined
definitions of all such symbols, including rounding-mode symbols, segment
symbols, @samp{BIT} symbols, and @code{TRAP} symbols used in @code{mmix}
``system calls''. It also turns off predefined special-register names,
except when used in @code{PUT} and @code{GET} instructions.
@cindex @samp{--no-expand} command line option, MMIX
By default, some instructions are expanded to fit the size of the operand
or an external symbol (@pxref{MMIX-Expand}). By passing
@samp{--no-expand}, no such expansion will be done, instead causing errors
at link time if the operand does not fit.
@cindex @samp{--no-merge-gregs} command line option, MMIX
The @code{mmixal} documentation (@pxref{MMIX-Syntax}) specifies that global
registers allocated with the @samp{GREG} directive (@pxref{MMIX-Pseudos}) and
initialized to the same non-zero value, will refer to the same global
register. This isn't strictly enforcable in @code{@value{AS}} since the
final addresses aren't known until link-time, but it will do an effort
unless the @samp{--no-merge-gregs} option is specified. (Register merging
isn't yet implemented in @code{@value{LD}}.)
@cindex @samp{-x} command line option, MMIX
@code{@value{AS}} will warn every time it expands an instruction to fit an
operand unless the option @samp{-x} is specified. It is believed that
this behaviour is more useful than just mimicking @code{mmixal}'s
behaviour, in which instructions are only expanded if the @samp{-x} option
is specified, and assembly fails otherwise, when an instruction needs to
be expanded. It needs to be kept in mind that @code{mmixal} is both an
assembler and linker, while @code{@value{AS}} will expand instructions
that at link stage can be contracted. (Though linker relaxation isn't yet
implemented in @code{@value{LD}}.)
@node MMIX-Expand
@section Instruction expansion
@cindex instruction expansion, MMIX
When @code{@value{AS}} encounters an instruction with an operand that is
either not known or does not fit the operand size of the instruction,
@code{@value{AS}} (and @code{@value{LD}}) will expand the instruction into
a sequence of instructions semantically equivalent to the operand fitting
the instruction. Expansion will take place for the following
instructions:
@table @asis
@item @samp{GETA}
Expands to a sequence of four instructions: @code{SETL}, @code{INCML},
@code{INCMH} and @code{INCH}. The operand must be a multiple of four.
@item Conditional branches
A branch instruction is turned into a branch with the complemented
condition and prediction bit over five instructions; four instructions
setting @code{$255} to the operand value, which like with @code{GETA} must
be a multiple of four, and a final @code{GO $255,$255,0}.
@item @samp{PUSHJ}
Similar to expansion for conditional branches; four instructions set
@code{$255} to the operand value, followed by a @code{PUSHGO $255,$255,0}.
@item @samp{JMP}
Similar to conditional branches and @code{PUSHJ}. The final instruction
is @code{GO $255,$255,0}.
@end table
The linker @code{@value{LD}} is expected to shrink these expansions for
code assembled with @samp{--relax} (though not currently implemented).
@node MMIX-Syntax
@section Syntax
The assembly syntax is supposed to be upward compatible with that
described in Sections 1.3 and 1.4 of @samp{The Art of Computer
Programming, Volume 1}. Draft versions of those chapters as well as other
MMIX information is located at
@emph{mmixsite} @emph{http://www-cs-faculty.stanford.edu/~knuth/mmix-news.html}.
Most code examples from the mmixal package located there should work
unmodified when assembled and linked as single files, with a few
noteworthy exceptions (@pxref{MMIX-mmixal}).
Before an instruction is emitted, the current location is aligned to the
next four-byte boundary. If a label is defined at the beginning of the
line, its value will be the aligned value.
In addition to the traditional hex-prefix @samp{0x}, a hexadecimal number
can also be specified by the prefix character @samp{#}.
After all operands to an MMIX instruction or directive have been
specified, the rest of the line is ignored, treated as a comment.
@menu
* MMIX-Chars:: Special Characters
* MMIX-Symbols:: Symbols
* MMIX-Regs:: Register Names
* MMIX-Pseudos:: Assembler Directives
@end menu
@node MMIX-Chars
@subsection Special Characters
@cindex line comment characters, MMIX
@cindex MMIX line comment characters
The characters @samp{*} and @samp{#} are line comment characters; each
start a comment at the beginning of a line, but only at the beginning of a
line. A @samp{#} prefixes a hexadecimal number if found elsewhere on a
line.
Two other characters, @samp{%} and @samp{!}, each start a comment anywhere
on the line. Thus you can't use the @samp{modulus} and @samp{not}
operators in expressions normally associated with these two characters.
A @samp{;} is a line separator, treated as a new-line, so separate
instructions can be specified on a single line.
@node MMIX-Symbols
@subsection Symbols
The character @samp{:} is permitted in identifiers. There are two
exceptions to it being treated as any other symbol character: if a symbol
begins with @samp{:}, it means that the symbol is in the global namespace
and that the current prefix should not be prepended to that symbol
(@pxref{MMIX-Pseudos}). The @samp{:} is then not considered part of the
symbol. For a symbol in the label position (first on a line), a @samp{:}
at the end of a symbol is silently stripped off. A label is permitted,
but not required, to be followed by a @samp{:}, as with many other
assembly formats.
The character @samp{@@} in an expression, is a synonym for @samp{.}, the
current location.
In addition to the common forward and backward local symbol formats
(@pxref{Symbol Names}), they can be specified with upper-case @samp{B} and
@samp{F}, as in @samp{8B} and @samp{9F}. A local label defined for the
current position is written with a @samp{H} appended to the number:
@smallexample
3H LDB $0,$1,2
@end smallexample
This and traditional local-label formats cannot be mixed: a label must be
defined and referred to using the same format.
There's a minor caveat: just as for the ordinary local symbols, the local
symbols are translated into ordinary symbols using control characters are
to hide the ordinal number of the symbol. Unfortunately, these symbols
are not translated back in error messages. Thus you may see confusing
error messages when local symbols are used. Control characters
@samp{\003} (control-C) and @samp{\004} (control-D) are used for the
MMIX-specific local-symbol syntax.
The symbol @samp{Main} is handled specially; it is always global.
By defining the symbols @samp{__.MMIX.start..text} and
@samp{__.MMIX.start..data}, the address of respectively the @samp{.text}
and @samp{.data} segments of the final program can be defined, though when
linking more than one object file, the code or data in the object file
containing the symbol is not guaranteed to be start at that position; just
the final executable. @xref{MMIX-Pseudos}.
@node MMIX-Regs
@subsection Register names
@cindex register names, MMIX
@cindex MMIX register names
Local and global registers are specified as @samp{$0} to @samp{$255}.
The recognized special register names are @samp{rJ}, @samp{rA}, @samp{rB},
@samp{rC}, @samp{rD}, @samp{rE}, @samp{rF}, @samp{rG}, @samp{rH},
@samp{rI}, @samp{rK}, @samp{rL}, @samp{rM}, @samp{rN}, @samp{rO},
@samp{rP}, @samp{rQ}, @samp{rR}, @samp{rS}, @samp{rT}, @samp{rU},
@samp{rV}, @samp{rW}, @samp{rX}, @samp{rY}, @samp{rZ}, @samp{rBB},
@samp{rTT}, @samp{rWW}, @samp{rXX}, @samp{rYY} and @samp{rZZ}. A leading
@samp{:} is optional for special register names.
Local and global symbols can be equated to register names and used in
place of ordinary registers.
Similarly for special registers, local and global symbols can be used.
Also, symbols equated from numbers and constant expressions are allowed in
place of a special register, except when either of the options
@code{--no-predefined-syms} and @code{--fixed-special-register-names} are
specified. Then only the special register names above are allowed for the
instructions having a special register operand; @code{GET} and @code{PUT}.
@node MMIX-Pseudos
@subsection Assembler Directives
@cindex assembler directives, MMIX
@cindex pseudo-ops, MMIX
@cindex MMIX assembler directives
@cindex MMIX pseudo-ops
@table @code
@item LOC
@cindex assembler directive LOC, MMIX
@cindex pseudo-op LOC, MMIX
@cindex MMIX assembler directive LOC
@cindex MMIX pseudo-op LOC
@emph{MMIX-loc}
The @code{LOC} directive sets the current location to the value of the
operand field, which may include changing sections. If the operand is a
constant, the section is set to either @code{.data} if the value is
@code{0x2000000000000000} or larger, else it is set to @code{.text}.
Within a section, the current location may only be changed to
monotonically higher addresses. A LOC expression must be a previously
defined symbol or a ``pure'' constant.
An example, which sets the label @var{prev} to the current location, and
updates the current location to eight bytes forward:
@smallexample
prev LOC @@+8
@end smallexample
When a LOC has a constant as its operand, a symbol
@code{__.MMIX.start..text} or @code{__.MMIX.start..data} is defined
depending on the address as mentioned above. Each such symbol is
interpreted as special by the linker, locating the section at that
address. Note that if multiple files are linked, the first object file
with that section will be mapped to that address (not necessarily the file
with the LOC definition).
@item LOCAL
@cindex assembler directive LOCAL, MMIX
@cindex pseudo-op LOCAL, MMIX
@cindex MMIX assembler directive LOCAL
@cindex MMIX pseudo-op LOCAL
@emph{MMIX-local}
Example:
@smallexample
LOCAL external_symbol
LOCAL 42
.local asymbol
@end smallexample
This directive-operation generates a link-time assertion that the operand
does not correspond to a global register. The operand is an expression
that at link-time resolves to a register symbol or a number. A number is
treated as the register having that number. There is one restriction on
the use of this directive: the pseudo-directive must be placed in a
section with contents, code or data.
@item IS
@cindex assembler directive IS, MMIX
@cindex pseudo-op IS, MMIX
@cindex MMIX assembler directive IS
@cindex MMIX pseudo-op IS
@emph{MMIX-is}
The @code{IS} directive:
@smallexample
asymbol IS an_expression
@end smallexample
sets the symbol @samp{asymbol} to @samp{an_expression}. A symbol may not
be set more than once using this directive. Local labels may be set using
this directive, for example:
@smallexample
5H IS @@+4
@end smallexample
@item GREG
@cindex assembler directive GREG, MMIX
@cindex pseudo-op GREG, MMIX
@cindex MMIX assembler directive GREG
@cindex MMIX pseudo-op GREG
@emph{MMIX-greg}
This directive reserves a global register, gives it an initial value and
optionally gives it a symbolic name. Some examples:
@smallexample
areg GREG
breg GREG data_value
GREG data_buffer
.greg creg, another_data_value
@end smallexample
The symbolic register name can be used in place of a (non-special)
register. If a value isn't provided, it defaults to zero. Unless the
option @samp{--no-merge-gregs} is specified, non-zero registers allocated
with this directive may be eliminated by @code{@value{AS}}; another
register with the same value used in its place.
Any of the instructions
@samp{CSWAP},
@samp{GO},
@samp{LDA},
@samp{LDBU},
@samp{LDB},
@samp{LDHT},
@samp{LDOU},
@samp{LDO},
@samp{LDSF},
@samp{LDTU},
@samp{LDT},
@samp{LDUNC},
@samp{LDVTS},
@samp{LDWU},
@samp{LDW},
@samp{PREGO},
@samp{PRELD},
@samp{PREST},
@samp{PUSHGO},
@samp{STBU},
@samp{STB},
@samp{STCO},
@samp{STHT},
@samp{STOU},
@samp{STSF},
@samp{STTU},
@samp{STT},
@samp{STUNC},
@samp{SYNCD},
@samp{SYNCID},
can have a value nearby @emph{GREG-base}an initial value in place of its
second and third operands. Here, ``nearby'' is defined as within the
range 0@dots{}255 from the initial value of such an allocated register.
@smallexample
buffer1 BYTE 0,0,0,0,0
buffer2 BYTE 0,0,0,0,0
@dots{}
GREG buffer1
LDOU $42,buffer2
@end smallexample
In the example above, the @samp{Y} field of the @code{LDOUI} instruction
(LDOU with a constant Z) will be replaced with the global register
allocated for @samp{buffer1}, and the @samp{Z} field will have the value
5, the offset from @samp{buffer1} to @samp{buffer2}. The result is
equivalent to this code:
@smallexample
buffer1 BYTE 0,0,0,0,0
buffer2 BYTE 0,0,0,0,0
@dots{}
tmpreg GREG buffer1
LDOU $42,tmpreg,(buffer2-buffer1)
@end smallexample
Global registers allocated with this directive are allocated in order
higher-to-lower within a file. Other than that, the exact order of
register allocation and elimination is undefined. For example, the order
is undefined when more than one file with such directives are linked
together.
@item BYTE
@cindex assembler directive BYTE, MMIX
@cindex pseudo-op BYTE, MMIX
@cindex MMIX assembler directive BYTE
@cindex MMIX pseudo-op BYTE
@emph{MMIX-byte}
The @samp{BYTE} directive takes a series of operands separated by a comma.
If an operand is a string (@pxref{Strings}), each character of that string
is emitted as a byte. Other operands must be constant expressions without
forward references, in the range 0@dots{}255. If you need operands having
expressions with forward references, use @samp{.byte} (@pxref{Byte}). An
operand can be omitted, defaulting to a zero value.
@item WYDE
@itemx TETRA
@itemx OCTA
@cindex assembler directive WYDE, MMIX
@cindex pseudo-op WYDE, MMIX
@cindex MMIX assembler directive WYDE
@cindex MMIX pseudo-op WYDE
@cindex assembler directive TETRA, MMIX
@cindex pseudo-op TETRA, MMIX
@cindex MMIX assembler directive TETRA
@cindex MMIX pseudo-op TETRA
@cindex assembler directive OCTA, MMIX
@cindex pseudo-op OCTA, MMIX
@cindex MMIX assembler directive OCTA
@cindex MMIX pseudo-op OCTA
@emph{MMIX-constants}
The directives @samp{WYDE}, @samp{TETRA} and @samp{OCTA} emit constants of
two, four and eight bytes size respectively. Before anything else happens
for the directive, the current location is aligned to the respective
constant-size bondary. If a label is defined at the beginning of the
line, its value will be that after the alignment. A single operand can be
omitted, defaulting to a zero value emitted for the directive. Operands
can be expressed as strings (@pxref{Strings}), in which case each
character in the string is emitted as a separate constant of the size
indicated by the directive.
@item PREFIX
@cindex assembler directive PREFIX, MMIX
@cindex pseudo-op PREFIX, MMIX
@cindex MMIX assembler directive PREFIX
@cindex MMIX pseudo-op PREFIX
@emph{MMIX-prefix}
The @samp{PREFIX} directive sets a symbol name prefix to be prepended to
all symbols (except local symbols, @pxref{MMIX-Symbols}), that are not
prefixed with @samp{:}, until the next @samp{PREFIX} directive. Such
prefixes accumulate. For example,
@smallexample
PREFIX a
PREFIX b
c IS 0
@end smallexample
defines a symbol @samp{abc} with the value 0.
@item BSPEC
@itemx ESPEC
@cindex assembler directive BSPEC, MMIX
@cindex pseudo-op BSPEC, MMIX
@cindex MMIX assembler directive BSPEC
@cindex MMIX pseudo-op BSPEC
@cindex assembler directive ESPEC, MMIX
@cindex pseudo-op ESPEC, MMIX
@cindex MMIX assembler directive ESPEC
@cindex MMIX pseudo-op ESPEC
@emph{MMIX-spec}
A pair of @samp{BSPEC} and @samp{ESPEC} directives delimit a section of
special contents (without specified semantics). Example:
@smallexample
BSPEC 42
TETRA 1,2,3
ESPEC
@end smallexample
The single operand to @samp{BSPEC} must be number in the range
0@dots{}255. The @samp{BSPEC} number 80 is used by the GNU binutils
implementation.
@end table
@node MMIX-mmixal
@section Differences to @code{mmixal}
@cindex mmixal differences
@cindex differences, mmixal
The binutils @code{@value{AS}} and @code{@value{LD}} combination has a few
differences in function compared to @code{mmixal} (@pxref{MMIX-Syntax}).
The replacement of a symbol with a GREG-allocated register
(@xref{MMIX-Pseudos}) is not handled the exactly same way in
@code{@value{AS}} as in @code{mmixal}. This is apparent in the
@code{mmixal} example file @code{inout.mms}, where different registers
with different offsets, eventually yielding the same address, are used in
the first instruction. This type of difference should however not affect
the function of any program unless it has specific assumptions about the
allocated register number.
Line numbers (in the @samp{mmo} object format) are currently not
supported.
Expression operator precedence is not that of mmixal: operator precedence
is that of the C programming language. It's recommended to use
parentheses to explicitly specify wanted operator precedence whenever more
than one type of operators are used.
The serialize unary operator @code{&}, the fractional division operator
@samp{//}, the logical not operator @code{!} and the modulus operator
@samp{%} are not available.
Symbols are not global by default, unless the option
@samp{--globalize-symbols} is passed. Use the @samp{.global} directive to
globalize symbols (@pxref{Global}).
Operand syntax is a bit stricter with @code{@value{AS}} than
@code{mmixal}. For example, you can't say @code{addu 1,2,3}, instead you
must write @code{addu $1,$2,3}.
You can't LOC to a lower address than those already visited
(i.e. ``backwards'').
A LOC directive must come before any emitted code.
Predefined symbols are visible as file-local symbols after use. (In the
ELF file, that is---the linked mmo file has no notion of a file-local
symbol.)
Some mapping of constant expressions to sections in LOC expressions is
attempted, but that functionality is easily confused and should be avoided
unless compatibility with @code{mmixal} is required. A LOC expression to
@samp{0x2000000000000000} or higher, maps to the @samp{.data} section and
lower addresses map to the @samp{.text} section (@pxref{MMIX-Pseudos}).
The code and data areas are each contiguous. Sparse programs with
far-away LOC directives will take up the same amount of space as a
contiguous program with zeros filled in the gaps between the LOC
directives. If you need sparse programs, you might try and get the wanted
effect with a linker script and splitting up the code parts into sections
(@pxref{Section}). Assembly code for this, to be compatible with
@code{mmixal}, would look something like:
@smallexample
.if 0
LOC away_expression
.else
.section away,"ax"
.fi
@end smallexample
@code{@value{AS}} will not execute the LOC directive and @code{mmixal}
ignores the lines with @code{.}. This construct can be used generally to
help compatibility.
Symbols can't be defined twice--not even to the same value.
Instruction mnemonics are recognized case-insensitive, though the
@samp{IS} and @samp{GREG} pseudo-operations must be specified in
upper-case characters.
There's no unicode support.
The following is a list of programs in
@emph{http://www-cs-faculty.stanford.edu/~knuth/mmix-news.html} dated
2001-08-25 (md5sum c393470cfc86fac040487d22d2bf0172) that assembles with
@code{mmixal} but don't with @code{@value{AS}}:
@table @code
@item silly.mms
LOC to a previous address.
@item sim.mms
Redefines symbol @samp{Done}.
@item test.mms
Uses the serial operator @samp{&}.
@end table

View File

@ -1,3 +1,7 @@
2001-10-30 Hans-Peter Nilsson <hp@bitrange.com>
* gas/mmix: New testsuite directory.
2001-10-24 Chris Demetriou <cgd@broadcom.com>
* gas/mips/ld-empic.d: Remove extra whitespace at beginning of

View File

@ -0,0 +1,12 @@
# objdump: -dr
# source: 1cjmp1b.s
# as: -no-expand
.*: file format elf64-mmix
Disassembly of section \.text:
0000000000000000 <Main>:
0: fd000000 swym 0,0,0
4: f0000001 jmp 8 <Main\+0x8>
8: f0000000 jmp 8 <Main\+0x8>
c: f1ffffff jmp 8 <Main\+0x8>

View File

@ -0,0 +1,15 @@
# objdump: -dr
# as: -linkrelax
# source: 1cjmp1b.s
.*: file format elf64-mmix
Disassembly of section \.text:
0000000000000000 <Main>:
0: fd000000 swym 0,0,0
4: f0000001 jmp 8 <Main\+0x8>
4: R_MMIX_ADDR27 \.text\+0x8
8: f0000000 jmp 8 <Main\+0x8>
8: R_MMIX_ADDR27 \.text\+0x8
c: f1ffffff jmp 8 <Main\+0x8>
c: R_MMIX_ADDR27 \.text\+0x8

View File

@ -0,0 +1,10 @@
# objdump: -dr
.*: file format elf64-mmix
Disassembly of section \.text:
0000000000000000 <Main>:
0: fd000000 swym 0,0,0
4: f0000001 jmp 8 <Main\+0x8>
8: f0000000 jmp 8 <Main\+0x8>
c: f1ffffff jmp 8 <Main\+0x8>

View File

@ -0,0 +1,14 @@
GAS for MMIX .*/1cjmp1b.s page 1
1 0000 FD000000 Main SWYM 0,0,0
2 0004 F0000001 1: JMP 1f
3 0008 F0000000 1: JMP 1b
4 000c F1FFFFFF JMP 1b
GAS for MMIX .*/1cjmp1b.s page 2
DEFINED SYMBOLS
.*/1cjmp1b.s:1 .text:0000000000000000 Main
NO UNDEFINED SYMBOLS

View File

@ -0,0 +1,4 @@
Main SWYM 0,0,0
1: JMP 1f
1: JMP 1b
JMP 1b

View File

@ -0,0 +1,15 @@
# objdump: -dr
# source: 1cjmp1b.s
# as: -linkrelax -no-expand
.*: file format elf64-mmix
Disassembly of section \.text:
0000000000000000 <Main>:
0: fd000000 swym 0,0,0
4: f0000000 jmp 4 <Main\+0x4>
4: R_MMIX_ADDR27 \.text\+0x8
8: f0000000 jmp 8 <Main\+0x8>
8: R_MMIX_ADDR27 \.text\+0x8
c: f0000000 jmp c <Main\+0xc>
c: R_MMIX_ADDR27 \.text\+0x8

View File

@ -0,0 +1,10 @@
# objdump: -dr
.*: file format elf64-mmix
Disassembly of section \.text:
0000000000000000 <Main>:
0: fd000000 swym 0,0,0
4: f0000001 jmp 8 <Main\+0x8>
8: f1ffffff jmp 4 <Main\+0x4>
c: f1ffffff jmp 8 <Main\+0x8>

View File

@ -0,0 +1,14 @@
GAS for MMIX .*/1hjmp1b.s page 1
1 0000 FD000000 Main SWYM 0,0,0
2 0004 F0000001 1H JMP 1F
3 0008 F1FFFFFF 1H JMP 1B
4 000c F1FFFFFF JMP 1B
GAS for MMIX .*/1hjmp1b.s page 2
DEFINED SYMBOLS
.*/1hjmp1b.s:1 .text:0000000000000000 Main
NO UNDEFINED SYMBOLS

View File

@ -0,0 +1,4 @@
Main SWYM 0,0,0
1H JMP 1F
1H JMP 1B
JMP 1B

View File

@ -0,0 +1,18 @@
#objdump: -srt
.*: file format elf64-mmix
SYMBOL TABLE:
0000000000000000 l d \.text 0000000000000000
0000000000000000 l d \.data 0000000000000000
0000000000000000 l d \.bss 0000000000000000
0000000000000002 l \.text 0000000000000000 a
0000000000000008 l \.text 0000000000000000 b
0000000000000010 l \.text 0000000000000000 c
000000000000001c g F \.text 0000000000000000 Main
Contents of section \.text:
0000 00000001 02000000 00000003 04000000 .*
0010 00000000 00000005 06000000 fd000102 .*
Contents of section \.data:

View File

@ -0,0 +1,11 @@
# Check that alignment is applied for instructions and pseudos, and that
# labels to such entities are aligned.
BYTE 0
a WYDE 1
BYTE 2
b TETRA 3
BYTE 4
c OCTA 5
BYTE 6
Main SWYM 0,1,2

View File

@ -0,0 +1,10 @@
#objdump: -dr
.*: file format elf64-mmix
Disassembly of section \.text:
0+ <a>:
0: 0000002a trap 0,0,42
4: 8d2b0034 ldo \$43,\$0,52
6: R_MMIX_REG \.MMIX\.reg_contents

View File

@ -0,0 +1,4 @@
# Simple base-plus-offset
b GREG @
a TETRA 42
LDO $43,a+52

View File

@ -0,0 +1,23 @@
#as: --no-predefined-syms
#objdump: -dr
.*: file format elf64-mmix
Disassembly of section \.text:
0000000000000000 <a>:
0: 0000002a trap 0,0,42
4: 8d2b0034 ldo \$43,\$0,52
6: R_MMIX_REG \.MMIX\.reg_contents\+0x8
\.\.\.
0000000000000108 <d>:
108: 0000001c trap 0,0,28
10c: 8d8f000c ldo \$143,\$0,12
10e: R_MMIX_REG \.MMIX\.reg_contents
110: 8df3000c ldo \$243,\$0,12
112: R_MMIX_REG \.MMIX\.reg_contents\+0x8
114: 23670028 addu \$103,\$0,40
116: R_MMIX_REG \.MMIX\.reg_contents
118: 230d0018 addu \$13,\$0,24
11a: R_MMIX_REG \.MMIX\.reg_contents\+0x8

View File

@ -0,0 +1,12 @@
# Simple base-plus-offset
b GREG @
a TETRA 42
LDO $43,a+52
LOC @+256
c GREG @
d TETRA 28
LDO $143,d+12
LDO $243,a+12
LDA $103,d+40
LDA $13,a+24

View File

@ -0,0 +1,13 @@
#objdump: -dr
.*: file format elf64-mmix
Disassembly of section \.text:
0+ <Main>:
0: bf2a0000 pushgo \$42,\$0,0
2: R_MMIX_REG \.MMIX\.reg_contents
4: fd000000 swym 0,0,0
0+8 <extfn>:
8: f8000000 pop 0,0

View File

@ -0,0 +1,5 @@
# PUSHGO is eligible for base-plus-offset addressing.
GREG fn
Main PUSHGO $42,fn
SWYM 0
extfn POP 0,0

View File

@ -0,0 +1,48 @@
#readelf: -Ssr -x1 -x4
There are 9 section headers, starting at offset 0xa0:
Section Headers:
\[Nr\] Name Type Address Offset
Size EntSize Flags Link Info Align
\[ 0\] NULL 0000000000000000 00000000
0000000000000000 0000000000000000 0 0 0
\[ 1\] \.text PROGBITS 0000000000000000 00000040
0000000000000004 0000000000000000 AX 0 0 4
\[ 2\] \.data PROGBITS 0000000000000000 00000044
0000000000000000 0000000000000000 WA 0 0 1
\[ 3\] \.bss NOBITS 0000000000000000 00000044
0000000000000000 0000000000000000 WA 0 0 1
\[ 4\] \.MMIX\.spec_data\.2 PROGBITS 0000000000000000 00000044
0000000000000004 0000000000000000 0 0 4
\[ 5\] \.rela\.MMIX\.spec_d RELA 0000000000000000 00000378
0000000000000018 0000000000000018 7 4 8
\[ 6\] \.shstrtab STRTAB 0000000000000000 00000048
0000000000000055 0000000000000000 0 0 1
\[ 7\] \.symtab SYMTAB 0000000000000000 000002e0
0000000000000090 0000000000000018 8 5 8
\[ 8\] \.strtab STRTAB 0000000000000000 00000370
0000000000000006 0000000000000000 0 0 1
Key to Flags:
W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\)
I \(info\), L \(link order\), G \(group\), x \(unknown\)
O \(extra OS processing required\) o \(OS specific\), p \(processor specific\)
Relocation section '\.rela\.MMIX\.spec_data\.2' at offset 0x378 contains 1 entries:
[ ]+Offset[ ]+Info[ ]+Type[ ]+Symbol's Value[ ]+Symbol's Name[ ]+Addend
0+ 0+500000004 R_MMIX_32 0+ forw \+ 0
Symbol table '\.symtab' contains 6 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0+ 0 NOTYPE LOCAL DEFAULT UND
1: 0+ 0 SECTION LOCAL DEFAULT 1
2: 0+ 0 SECTION LOCAL DEFAULT 2
3: 0+ 0 SECTION LOCAL DEFAULT 3
4: 0+ 0 SECTION LOCAL DEFAULT 4
5: 0+ 0 NOTYPE GLOBAL DEFAULT UND forw
Hex dump of section '\.text':
0x00000000 fd010203 .*
Hex dump of section '\.MMIX\.spec_data\.2':
0x00000000 00000000 .*

View File

@ -0,0 +1,4 @@
SWYM 1,2,3
BSPEC 2
TETRA forw
ESPEC

View File

@ -0,0 +1,47 @@
#readelf: -Sr -x1 -x4
There are 11 section headers, starting at offset 0xe0:
Section Headers:
\[Nr\] Name Type Address Offset
Size EntSize Flags Link Info Align
\[ 0\] NULL 0+ 0+
0+ 0+ 0 0 0
\[ 1\] \.text PROGBITS 0+ 0+40
0+4 0+ AX 0 0 4
\[ 2\] \.data PROGBITS 0+ 0+44
0+ 0+ WA 0 0 1
\[ 3\] \.bss NOBITS 0+ 0+44
0+ 0+ WA 0 0 1
\[ 4\] \.MMIX\.spec_data\.2 PROGBITS 0+ 0+48
0+10 0+ 0 0 8
\[ 5\] \.rela\.MMIX\.spec_d RELA 0+ 0+470
0+30 0+18 9 4 8
\[ 6\] \.MMIX\.spec_data\.3 PROGBITS 0+ 0+58
0+8 0+ 0 0 8
\[ 7\] \.rela\.MMIX\.spec_d RELA 0+ 0+4a0
0+18 0+18 9 6 8
\[ 8\] \.shstrtab STRTAB 0+ 0+60
0+7e 0+ 0 0 1
\[ 9\] \.symtab SYMTAB 0+ 0+3a0
0+c0 0+18 10 6 8
\[10\] \.strtab STRTAB 0+ 0+460
0+c 0+ 0 0 1
Key to Flags:
W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\)
I \(info\), L \(link order\), G \(group\), x \(unknown\)
O \(extra OS processing required\) o \(OS specific\), p \(processor specific\)
Relocation section '\.rela\.MMIX\.spec_data\.2' at offset 0x470 contains 2 entries:
[ ]+Offset[ ]+Info[ ]+Type[ ]+Symbol's Value[ ]+Symbol's Name[ ]+Addend
0+ 0+600000004 R_MMIX_32 0+ forw \+ 0
0+8 0+700000005 R_MMIX_64 0+ other \+ 0
Relocation section '\.rela\.MMIX\.spec_data\.3' at offset 0x4a0 contains 1 entries:
[ ]+Offset[ ]+Info[ ]+Type[ ]+Symbol's Value[ ]+Symbol's Name[ ]+Addend
0+ 0+700000005 R_MMIX_64 0+ other \+ 0
Hex dump of section '\.text':
0x00000000 fd010203 .*
Hex dump of section '\.MMIX\.spec_data\.2':
0x00000000 00000000 0000002a 00000000 00000000 .*

View File

@ -0,0 +1,11 @@
SWYM 1,2,3
BSPEC 2
TETRA forw
ESPEC
BSPEC 3
OCTA other
ESPEC
BSPEC 2
TETRA 42
OCTA other
ESPEC

View File

@ -0,0 +1,22 @@
# objdump: -dtr
# Make sure we can override a built-in symbol with a known constant, like
# with mmixal.
.*: file format elf64-mmix
SYMBOL TABLE:
0+14 l \*ABS\* 0+ rJ
0+ l d \.text 0+
0+ l d \.data 0+
0+ l d \.bss 0+
0+ g F \.text 0+ Main
Disassembly of section \.text:
0+ <Main>:
0: fe050014 get \$5,rL
4: fe060014 get \$6,rL
8: f6140007 put rL,\$7
c: f6140008 put rL,\$8

View File

@ -0,0 +1,8 @@
# When disallowing built-in names, we have to treat GET and PUT
# specially, so when parsing the special register operand we do
# not use the symbol table.
rJ IS 20
Main GET $5,rJ
GET $6,:rJ
PUT rJ,$7
PUT :rJ,$8

View File

@ -0,0 +1,24 @@
# as: -no-predefined-syms
# objdump: -dtr
# source: builtin1.s
# Make sure we don't look at the symbol table when parsing special
# register names.
.*: file format elf64-mmix
SYMBOL TABLE:
0+ l d \.text 0+
0+ l d \.data 0+
0+ l d \.bss 0+
0+14 l \*ABS\* 0+ rJ
0+ g F \.text 0+ Main
Disassembly of section \.text:
0+ <Main>:
0: fe050004 get \$5,rJ
4: fe060004 get \$6,rJ
8: f6040007 put rJ,\$7
c: f6040008 put rJ,\$8

View File

@ -0,0 +1,24 @@
# as: -fixed-special-register-names
# objdump: -dtr
# source: builtin1.s
# Make sure we don't look at the symbol table when parsing special
# register names.
.*: file format elf64-mmix
SYMBOL TABLE:
0+14 l \*ABS\* 0+ rJ
0+ l d \.text 0+
0+ l d \.data 0+
0+ l d \.bss 0+
0+ g F \.text 0+ Main
Disassembly of section \.text:
0+ <Main>:
0: fe050004 get \$5,rJ
4: fe060004 get \$6,rJ
8: f6040007 put rJ,\$7
c: f6040008 put rJ,\$8

View File

@ -0,0 +1,41 @@
#readelf: -Ssrx1
There are 7 section headers, starting at offset 0x88:
Section Headers:
\[Nr\] Name Type Address Offset
Size EntSize Flags Link Info Align
\[ 0\] NULL 0000000000000000 00000000
0000000000000000 0000000000000000 0 0 0
\[ 1\] \.text PROGBITS 0000000000000000 00000040
0000000000000018 0000000000000000 AX 0 0 4
\[ 2\] \.data PROGBITS 0000000000000000 00000058
0000000000000000 0000000000000000 WA 0 0 1
\[ 3\] \.bss NOBITS 0000000000000000 00000058
0000000000000000 0000000000000000 WA 0 0 1
\[ 4\] \.shstrtab STRTAB 0000000000000000 00000058
000000000000002c 0000000000000000 0 0 1
\[ 5\] \.symtab SYMTAB 0000000000000000 00000248
00000000000000c0 0000000000000018 6 7 8
\[ 6\] \.strtab STRTAB 0000000000000000 00000308
0000000000000018 0000000000000000 0 0 1
Key to Flags:
W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\)
I \(info\), L \(link order\), G \(group\), x \(unknown\)
O \(extra OS processing required\) o \(OS specific\), p \(processor specific\)
There are no relocations in this file\.
Symbol table '\.symtab' contains 8 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0+ 0 NOTYPE LOCAL DEFAULT UND
1: 0+ 0 SECTION LOCAL DEFAULT 1
2: 0+ 0 SECTION LOCAL DEFAULT 2
3: 0+ 0 SECTION LOCAL DEFAULT 3
4: 0+2a 0 NOTYPE LOCAL DEFAULT ABS number
5: 0+4 0 NOTYPE LOCAL DEFAULT 1 label
6: 0+c 0 NOTYPE LOCAL DEFAULT 1 lab2
7: 0+ 0 FUNC GLOBAL DEFAULT 1 Main
Hex dump of section '\.text':
0x00000000 fd2b2a29 73747269 6e670aff 8e007374 .*
0x00000010 72696e67 320a0000 .*

View File

@ -0,0 +1,6 @@
# Test BYTE sequences, excercising code paths for valid input.
number IS 42
Main SWYM 43,number,41
label BYTE "string",#a,255
lab2 BYTE number+100,0,"string2",#a

View File

@ -0,0 +1,30 @@
#as: -x
#objdump: -tdr
.*: file format elf64-mmix
SYMBOL TABLE:
0+ l d .text 0+
0+ l d .data 0+
0+ l d .bss 0+
ffff0000ffff0000 l \*ABS\* 0+ i1
ffff0000ffff0000 l \*ABS\* 0+ i2
0+ g F .text 0+ Main
Disassembly of section .text:
0+ <Main>:
0: 42ff0000 bz \$255,0 <Main>
0: R_MMIX_CBRANCH \*ABS\*\+0xffff0000ffff0000
4: fd000000 swym 0,0,0
8: fd000000 swym 0,0,0
c: fd000000 swym 0,0,0
10: fd000000 swym 0,0,0
14: fd000000 swym 0,0,0
18: 42ff0000 bz \$255,18 <Main\+0x18>
18: R_MMIX_CBRANCH i2
1c: fd000000 swym 0,0,0
20: fd000000 swym 0,0,0
24: fd000000 swym 0,0,0
28: fd000000 swym 0,0,0
2c: fd000000 swym 0,0,0

View File

@ -0,0 +1,5 @@
% BZ far away must not fail
i1 IS #ffff0000ffff0000
Main BZ $255,i1
BZ $255,i2
i2 IS #ffff0000ffff0000

View File

@ -0,0 +1,69 @@
#as: -no-expand
#readelf: -Ssrx1 -x6
There are 10 section headers, starting at offset 0x130:
Section Headers:
\[Nr\] Name Type Address Offset
Size EntSize Flags Link Info Align
\[ 0\] NULL 0+ 0+
0+ 0+ 0 0 0
\[ 1\] \.text PROGBITS 0+ 0+40
0+88 0+ AX 0 0 8
\[ 2\] \.rela\.text RELA 0+ 0+4f8
0+78 0+18 8 1 8
\[ 3\] \.data PROGBITS 0+ 0+c8
0+ 0+ WA 0 0 1
\[ 4\] \.bss NOBITS 0+ 0+c8
0+ 0+ WA 0 0 1
\[ 5\] \.MMIX\.spec_data\.4 PROGBITS 0+ 0+c8
0+ 0+ 0 0 1
\[ 6\] \.MMIX\.reg_content PROGBITS 0+ 0+c8
0+8 0+ W 0 0 1
\[ 7\] \.shstrtab STRTAB 0+ 0+d0
0+5d 0+ 0 0 1
\[ 8\] \.symtab SYMTAB 0+ 0+3b0
0+120 0+18 9 8 8
\[ 9\] \.strtab STRTAB 0+ 0+4d0
0+21 0+ 0 0 1
Key to Flags:
W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\)
I \(info\), L \(link order\), G \(group\), x \(unknown\)
O \(extra OS processing required\) o \(OS specific\), p \(processor specific\)
Relocation section '\.rela\.text' at offset 0x4f8 contains 5 entries:
[ ]+Offset[ ]+Info[ ]+Type[ ]+Symbol's Value[ ]+Symbol's Name[ ]+Addend
0+34 0+90000001e R_MMIX_ADDR19 0+ target \+ 2c
0+46 0+a00000002 R_MMIX_16 0+ target2 \+ 30
0+48 0+b0000001f R_MMIX_ADDR27 0+ target3 \+ 38
0+54 0+b0000001e R_MMIX_ADDR19 0+ target3 \+ 0
0+78 0+23 R_MMIX_LOCAL 0+30
Symbol table '\.symtab' contains 12 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0+ 0 NOTYPE LOCAL DEFAULT UND
1: 0+ 0 SECTION LOCAL DEFAULT 1
2: 0+ 0 SECTION LOCAL DEFAULT 3
3: 0+ 0 SECTION LOCAL DEFAULT 4
4: 0+18 0 NOTYPE LOCAL DEFAULT ABS z
5: 0+80 0 NOTYPE LOCAL DEFAULT 1 x
6: 0+ 0 SECTION LOCAL DEFAULT 5
7: 0+ 0 SECTION LOCAL DEFAULT 6
8: 0+ 0 FUNC GLOBAL DEFAULT 1 Main
9: 0+ 0 NOTYPE GLOBAL DEFAULT UND target
10: 0+ 0 NOTYPE GLOBAL DEFAULT UND target2
11: 0+ 0 NOTYPE GLOBAL DEFAULT UND target3
Hex dump of section '\.text':
0x0+ 0000007b 00010017 00010203 01030201 .*
0x0+10 09050006 09070208 0509000a 050b030c .*
0x0+20 230f1011 23121300 23141516 34170018 .*
0x0+30 34191a1b 401c0000 b91d1e1f bf202122 .*
0x0+40 c1232400 e0250000 f0000000 f8260027 .*
0x0+50 f9000028 f2290000 fa2a0000 fb00002b .*
0x0+60 f604002c fe2d0004 00000000 03020104 .*
0x0+70 0007000c 00000014 00000000 0000001c .*
0x0+80 fd221538 00000000 .*
Hex dump of section '\.MMIX\.reg_contents':
0x0+ 00000000 00000033 .*

View File

@ -0,0 +1,46 @@
# Check that "naked" comments are accepted and ignored on all different
# mnemonic types and pseudos. The goal is to use all combinations of
# operands where varying number of operands are allowed. If any
# combinations are missing, for simplicity, add them to another file.
Main TRAP 123 ignore; x y z
TRAP 1,23 all; x y z
TRAP 1,2,3 these; x y z
FCMP $3,$2,$1 comments; x y z
FLOT $5,6 and; x y z
FLOT $7,ROUND_UP,8 do; x y z
FIX $9,$10 nothing; x y z
FIX $11,ROUND_DOWN,$12 that; x y z
ADDU $15,$16,17 would make; x y z
LDA $18,$19 a; x y z
LDA $20,$21,22 difference; x y z
NEG $23,$24 in; x y z
NEG $25,26,$27 the; x y z
bn $28,target + 44 generated; x y z
SYNCD 29,$30,31 code; x y z
PUSHGO 32,$33,34 so; x y z
SET $35,$36 it; x y z
SETH $37,target2 + 48 is; x y z
JMP target3 + 56 as; x y z
POP 38,39 if; x y z
RESUME 40 it; x y z
PUSHJ $41,target3 had; x y z
SAVE $42,0 never; x y z
UNSAVE 0,$43 been; x y z
PUT rJ,$44 there; x y z
GET $45,rJ at all.; x y z
LOC @+4 likewise; x y z
PREFIX : with; x y z
BYTE 3,2,1,0+4 the; x y z
WYDE 7,4+8 different; x y z
TETRA 8+12 pseudo; x y z
OCTA 12+16 ops,; x y z
LOCAL 48 they; x y z
BSPEC 49 too; x y z
# Specifying an operand field (although ignored) is necessary for a comment
# with a ';' to be ignorable and not interpreted as eoln, both for GAS and
# mmixal.
ESPEC 0 ignore; x y z
GREG 50 + 1 naked; x y z
z IS 9 + 8 + 7 comments; x y z
x SWYM 34,21,56

View File

@ -0,0 +1,15 @@
#objdump: -drt
.*: file format elf64-mmix
SYMBOL TABLE:
0+ l d \.text 0+
0+ l d \.data 0+
0+ l d \.bss 0+
0+ g F \.text 0+ Main
Disassembly of section \.text:
0+ <Main>:
0: f801e240 pop 1,57920

View File

@ -0,0 +1 @@
Main POP 123456 ignore; x y z

View File

@ -0,0 +1,21 @@
#objdump: -srt
.*: file format elf64-mmix
SYMBOL TABLE:
0000000000000000 l d \.text 0000000000000000
0000000000000000 l d \.data 0000000000000000
0000000000000000 l d \.bss 0000000000000000
0000000000000000 l \.MMIX\.reg_contents 0000000000000000 im
0000000000000000 l d \.MMIX\.reg_contents 0000000000000000
RELOCATION RECORDS FOR \[\.MMIX\.reg_contents\]:
OFFSET TYPE VALUE
0000000000000000 R_MMIX_64 \.text
Contents of section \.text:
Contents of section \.data:
Contents of section \.MMIX\.reg_contents:
0000 00000000 00000000 .*

View File

@ -0,0 +1,2 @@
# If we aren't careful, '@' will be considered an operator.
im GREG @ home

View File

@ -0,0 +1,7 @@
#objdump: -sr
.*: file format elf64-mmix
Contents of section \.text:
0000 00000000 00000000 .*
Contents of section \.data:

View File

@ -0,0 +1,2 @@
# Empty expressions are a single zero.
d OCTA

View File

@ -0,0 +1,14 @@
#objdump: -str
.*: file format elf64-mmix
SYMBOL TABLE:
0+ l d \.text 0+
0+ l d \.data 0+
0+ l d \.bss 0+
0+ g F \.text 0+ Main
Contents of section \.text:
0000 61623b00 00000000 00000000 00000064 .*
0010 00000000 00000065 .*
Contents of section \.data:

View File

@ -0,0 +1,4 @@
# Character constants. We actually see e.g. 'b' as 98, so ww just check
# that we get the right output with this test.
Main BYTE 'a','b',';'
OCTA 'd','e'

View File

@ -0,0 +1,12 @@
% { dg-do assemble { target mmix-*-* } }
% SAVE, UNSAVE are not valid with base-plus-offset
.data
buffer OCTA 0,0,0
.text
GREG buffer
Main SWYM 0
SAVE buffer,0 % { dg-error "operands" "" }
UNSAVE 0,buffer % { dg-error "operands" "" }

View File

@ -0,0 +1,4 @@
% { dg-do assemble { target mmix-*-* } }
Main SET $45,23
BSPEC 5 % { dg-error "BSPEC without ESPEC" "" }
TETRA 4

View File

@ -0,0 +1,7 @@
% { dg-do assemble { target mmix-*-* } }
Main SET $45,23
BSPEC 5
TETRA 4
BSPEC 6 % { dg-error "BSPEC already active" "" }
TETRA 5
ESPEC

View File

@ -0,0 +1,4 @@
% { dg-do assemble { target mmix-*-* } }
Main SET $45,23
TETRA 4
ESPEC % { dg-error "ESPEC without preceding BSPEC" "" }

View File

@ -0,0 +1,7 @@
% { dg-do assemble { target mmix-*-* } }
Main SET $45,23
BSPEC 2
TETRA 4
ESPEC
TETRA 5
ESPEC % { dg-error "ESPEC without preceding BSPEC" "" }

View File

@ -0,0 +1,23 @@
% { dg-do assemble { target mmix-*-* } }
Main SET $45,23
here SWYM 0,0,0
BSPEC 0
TETRA 4
ESPEC
BSPEC 65535
TETRA 4
ESPEC
BSPEC 65536 % { dg-error "invalid BSPEC expression" "" }
TETRA 4
ESPEC
BSPEC forw % { dg-error "invalid BSPEC expression" "" }
TETRA 4
ESPEC
BSPEC here % { dg-error "invalid BSPEC expression" "" }
TETRA 4
ESPEC
BSPEC -1 % { dg-error "invalid BSPEC expression" "" }
TETRA 4
ESPEC

View File

@ -0,0 +1,14 @@
% { dg-do assemble { target mmix-*-* } }
% { dg-options "-no-predefined-syms" }
% When disallowing built-in names, we have to treat GET and PUT
% specially, so when parsing the special register operand we do
% not use the symbol table. Make sure an error is emitted for
% invalid registers despite there being a valid user label and
% the construct being valid without the -no-builtin-syms option.
% FIXME: Another option? Or is this just the consequence?
RJ IS 4
other IS 20
Main GET $5,RJ % { dg-error "invalid operands" "" }
PUT other,$7 % { dg-error "invalid operands" "" }
GET garbage % { dg-error "invalid operands" "" }
PUT garbage % { dg-error "invalid operands" "" }

View File

@ -0,0 +1,11 @@
% { dg-do assemble { target mmix-*-* } }
% { dg-error "unterminated string" "" { target mmix-*-* } 10 }
% { dg-bogus "end of file" "" { xfail mmix-*-* } 0 }
# Note that the error is detected in the preformatter, before the text
# gets to the assembler. It also gets confused about the unterminated
# string. Well, at least we get error messages for it, so no worries.
Main SWYM 0,0,0
BYTE 2,"no end
BYTE 0

View File

@ -0,0 +1,17 @@
% { dg-do assemble { target mmix-*-* } }
m1 IS -1
zero IS 0
zero2 IS 0
1H IS 42
2H IS 5
Main SWYM 0,0,0
BYTE 0
BYTE -1 % { dg-error "BYTE expression not in the range 0..255" "" }
BYTE m1 % { dg-error "BYTE expression not in the range 0..255" "" }
BYTE zero2
BYTE 1B+2B+55
BYTE zero+m1 % { dg-error "BYTE expression not in the range 0..255" "" }
BYTE 255
BYTE 256 % { dg-error "BYTE expression not in the range 0..255" "" }
BYTE unk+1 % { dg-error "BYTE expression not a pure number" "" }

View File

@ -0,0 +1,8 @@
% Check that lowercase pseudos with mmixal syntax (no dot prefix) aren't
% recognized. Since local is handled as an insn, it's actually
% misrecognized in lower case.
% { dg-do assemble { target mmix-*-* } }
Main SWYM 0,0,0
X is 42 % { dg-error "unknown opcode: \`is\'" "" }
local 56 % { dg-error "unknown opcode: \`fatal\'" "" { xfail *-*-* } }
a greg 94 % { dg-error "unknown opcode: \`greg\'" "" }

View File

@ -0,0 +1,7 @@
% { dg-do assemble { target mmix-*-* } }
% { dg-error "may not appear alone on a line" "" { target mmix-*-* } 5 }
% { dg-error "may not appear alone on a line" "" { target mmix-*-* } 6 }
0H .local 32 % { dg-error "do not mix with dot-pseudos" "" }
1H
2H
3H .set s,32 % { dg-error "do not mix with dot-pseudos" "" }

View File

@ -0,0 +1,10 @@
% { dg-do assemble { target mmix-*-* } }
% One more than greg9.s is one too many.
% The error is reported on the wrong line. Methinks that error is
% attributable to the .rept machinery. No xfail+bogus for this one.
Main SWYM 0
.rept 223
GREG
.endr % { dg-error "too many GREG registers allocated" "" }

View File

@ -0,0 +1,5 @@
% { dg-do assemble { target mmix-*-* } }
Main SWYM 0,0,0
FLOT $112,$223,$41 % { dg-error "invalid operands" "Y field of FLOT 1" }
FLOT $112,$223,141 % { dg-error "invalid operands" "Y field of FLOT 2" }
LDA $122,$203,256 % { dg-error "invalid operands" "Z field too large" }

View File

@ -0,0 +1,4 @@
% { dg-do assemble { target mmix-*-* } }
IS 42 % { dg-error "empty label field for IS" "" }
2H IS 1
IS 2B % { dg-error "empty label field for IS" "" }

View File

@ -0,0 +1,5 @@
% { dg-do assemble { target mmix-*-* } }
LOC #200
Main SET $45,23
LOC #100 % { dg-error "LOC expression stepping backwards" "" }
SET $57,$67

View File

@ -0,0 +1,5 @@
% { dg-do assemble { target mmix-*-* } }
LOC (#20 << 56) + #200
TETRA 1
LOC (#20 << 56) + #100 % { dg-error "LOC expression stepping backwards" "" }
TETRA 2

View File

@ -0,0 +1,4 @@
% { dg-do assemble { target mmix-*-* } }
LOC (#20 << 56) + #202
TETRA 1
OCTA 1 % { dg-error "data item with alignment larger than location" "" }

View File

@ -0,0 +1,4 @@
% { dg-do assemble { target mmix-*-* } }
LOC #201
WYDE 1
SWYM 1 % { dg-error "specified location wasn't TETRA-aligned" "" }

View File

@ -0,0 +1,4 @@
% { dg-do assemble { target mmix-*-* } }
LOC (#20<<56)|1
.p2align 0
SWYM 1 % { dg-error "unaligned data at an absolute location" "" }

View File

@ -0,0 +1,4 @@
% { dg-do assemble { target mmix-*-* } }
LOC #201
.p2align 0
SWYM 1 % { dg-error "unaligned data at an absolute location" "" }

View File

@ -0,0 +1,4 @@
% { dg-do assemble { target mmix-*-* } }
LOC (#20<<56)|1
.p2align 0
TETRA 1 % { dg-error "unaligned data at an absolute location" "" }

View File

@ -0,0 +1,4 @@
% { dg-do assemble { target mmix-*-* } }
LOC #201
.p2align 0
TETRA 1 % { dg-error "unaligned data at an absolute location" "" }

Some files were not shown because too many files have changed in this diff Show More