diff options
Diffstat (limited to 'gnu/usr.bin/binutils/gas')
-rw-r--r-- | gnu/usr.bin/binutils/gas/conf-a-gas.com | 168 | ||||
-rw-r--r-- | gnu/usr.bin/binutils/gas/config/obj-evax.c | 42 | ||||
-rw-r--r-- | gnu/usr.bin/binutils/gas/config/obj-evax.h | 115 | ||||
-rw-r--r-- | gnu/usr.bin/binutils/gas/makefile.vms | 54 |
4 files changed, 379 insertions, 0 deletions
diff --git a/gnu/usr.bin/binutils/gas/conf-a-gas.com b/gnu/usr.bin/binutils/gas/conf-a-gas.com new file mode 100644 index 00000000000..ca5dd945644 --- /dev/null +++ b/gnu/usr.bin/binutils/gas/conf-a-gas.com @@ -0,0 +1,168 @@ +$! +$! This file sets things up to build gas on a openVMS/Alpha system to generate +$! object files for a openVMS/Alpha system. +$! We do not use the configure script, since there is no /bin/sh to execute it. +$! +$! If you are running this file, then obviously the host is alpha-dec-vms. +$! +$gas_host="vms" +$! +$cpu_type="alpha" +$emulation="generic" +$obj_format="evax" +$atof="ieee" +$! +$ DELETE = "delete/noConfirm" +$ ECHO = "write sys$output" +$! +$! Target specific information +$call link targ-cpu.c [.config]tc-'cpu_type'.c +$call link targ-cpu.h [.config]tc-'cpu_type'.h +$call link targ-env.h [.config]te-'emulation'.h +$! +$! Code to handle the object file format. +$call link obj-format.h [.config]obj-'obj_format'.h +$call link obj-format.c [.config]obj-'obj_format'.c +$! +$! Code to handle floating point. +$call link atof-targ.c [.config]atof-'atof'.c +$! +$! +$! Create the file version.opt, which helps identify the executable. +$! +$if f$trnlnm("IFILE$").nes."" then close/noLog ifile$ +$search Makefile.in "VERSION="/Exact/Output=config-gas-tmp.tmp +$open ifile$ config-gas-tmp.tmp +$read ifile$ line +$close ifile$ +$DELETE config-gas-tmp.tmp;* +$! Discard "VERSION=" and "\n" parts. +$ijk=f$locate("=",line)+1 +$line=f$extract(ijk,f$length(line)-ijk,line) +$! [what "\n" part?? this seems to be useless, but is benign] +$ijk=f$locate("\n",line) +$line=f$extract(0,ijk,line) +$! +$ if f$search("version.opt").nes."" then DELETE version.opt;* +$copy _NL: version.opt +$open/Append ifile$ version.opt +$write ifile$ "identification="+""""+line+"""" +$close ifile$ +$! +$! Now write config.h. +$! +$ if f$search("config.h").nes."" then DELETE config.h;* +$copy _NL: config.h +$open/Append ifile$ config.h +$write ifile$ "/* config.h. Generated by config-gas.com. */ +$write ifile$ "#ifndef GAS_VERSION" +$write ifile$ "#define GAS_VERSION """,line,"""" +$write ifile$ "#endif" +$write ifile$ "/*--*/" +$append [.config]vms-a-conf.h ifile$: +$close ifile$ +$ECHO "Created config.h." +$! +$! Check for, and possibly make, header file <unistd.h>. +$! +$ if f$search("tmp-chk-h.*").nes."" then DELETE tmp-chk-h.*;* +$!can't use simple `#include HDR' with `gcc /Define="HDR=<foo.h>"' +$!because the 2.6.[0-3] preprocessor handles it wrong (VMS-specific gcc bug) +$ create tmp-chk-h.c +int tmp_chk_h; /* guarantee non-empty output */ +#ifdef HAVE_STDIO_H +#include <stdio.h> +#endif +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif +#ifdef HAVE_UNIXIO_H +#include <unixio.h> +#endif +#ifdef HAVE_UNIXLIB_H +#include <unixlib.h> +#endif +$ on warning then continue +$ CHECK = "call tmp_chk_h" +$ CHECK "HAVE_STDIO_H" +$ if .not.$status +$ then type sys$input: + +? could not compile <stdio.h>. + Since gcc is not set up correctly, gas configuration cannot proceed. + +$ DELETE tmp-chk-h.c;* +$ exit %x002C +$ endif +$! +$ CHECK "HAVE_UNISTD_H" +$ if .not.$status +$ then +$ if f$trnlnm("HFILE$").nes."" then close/noLog hfile$ +$ CHECK "HAVE_UNIXIO_H" +$ got_unixio = ($status .and. 1) +$ CHECK "HAVE_UNIXLIB_H" +$ got_unixlib = ($status .and. 1) +$ create []unistd.h !with rudimentary contents +/* <unistd.h> substitute for building gas */ +#ifndef UNISTD_H +#define UNISTD_H + +$ open/Append hfile$ []unistd.h +$ if got_unixio +$ then write hfile$ "#include <unixio.h>" +$ else append sys$input: hfile$: +/* some of the routines normally prototyped in <unixio.h> */ +extern int creat(), open(), close(), read(), write(); +extern int access(), dup(), dup2(), fstat(), stat(); +extern long lseek(); +$ endif +$ write hfile$ "" +$ if got_unixlib +$ then write hfile$ "#include <unixlib.h>" +$ else append sys$input: hfile$: +/* some of the routines normally prototyped in <unixlib.h> */ +extern char *sbrk(), *getcwd(), *cuserid(); +extern int brk(), chdir(), chmod(), chown(), mkdir(); +extern unsigned getuid(), umask(); +$ endif +$ append sys$input: hfile$: + +#endif /*UNISTD_H*/ +$ close hfile$ +$ ECHO "Created ""[]unistd.h""." +$ endif !gcc '#include <unistd.h>' failed +$ DELETE tmp-chk-h.c;* +$ +$tmp_chk_h: subroutine +$ set noOn +$ hname = f$edit("<" + (p1 - "HAVE_" - "_H") + ".h>","LOWERCASE") +$ write sys$output "Checking for ''hname'." +$ if f$search("tmp-chk-h.obj").nes."" then DELETE tmp-chk-h.obj;* +$ define/noLog sys$error _NL: !can't use /User_Mode here due to gcc +$ define/noLog sys$output _NL: ! driver's use of multiple image activation +$ gcc /Include=([],[-.include]) /Define=("''p1'") tmp-chk-h.c +$!can't just check $status; gcc 2.6.[0-3] preprocessor doesn't set it correctly +$ ok = (($status.and.1).and.(f$search("tmp-chk-h.obj").nes."")) .or. %x10000000 +$ deassign sys$error !restore, more or less +$ deassign sys$output +$ if ok then DELETE tmp-chk-h.obj;* +$ exit ok +$ endsubroutine !tmp_chk_h +$ +$! +$! Done +$! +$ if f$search("config.status") .nes. "" then DELETE config.status;* +$ create config.status +Links are now set up for use with an Alpha running openVMS. +$ type config.status +$exit +$! +$! +$link: +$subroutine +$ if f$search(p1).nes."" then DELETE 'p1';* +$ copy 'p2' 'p1' +$ ECHO "Copied ''f$edit(p2,"LOWERCASE")' to ''f$edit(p1,"LOWERCASE")'." +$endsubroutine diff --git a/gnu/usr.bin/binutils/gas/config/obj-evax.c b/gnu/usr.bin/binutils/gas/config/obj-evax.c new file mode 100644 index 00000000000..fbe5069a60a --- /dev/null +++ b/gnu/usr.bin/binutils/gas/config/obj-evax.c @@ -0,0 +1,42 @@ +/* obj-evax.c - EVAX (openVMS/Alpha) object file format. + Copyright (C) 1996 Free Software Foundation, Inc. + Contributed by Klaus Kämpf (kkaempf@progis.de) of + proGIS Software, Aachen, Germany. + + 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 OBJ_HEADER "obj-evax.h" + +#include "as.h" + +void obj_read_begin_hook () {} + +const pseudo_typeS obj_pseudo_table[] = +{ + {0, 0, 0}, +}; /* obj_pseudo_table */ + + +/* + * Local Variables: + * comment-column: 0 + * fill-column: 131 + * End: + */ + +/* end of obj-evax.c */ diff --git a/gnu/usr.bin/binutils/gas/config/obj-evax.h b/gnu/usr.bin/binutils/gas/config/obj-evax.h new file mode 100644 index 00000000000..03e3cbdf63f --- /dev/null +++ b/gnu/usr.bin/binutils/gas/config/obj-evax.h @@ -0,0 +1,115 @@ +/* This file is obj-evax.h + Copyright (C) 1996 Free Software Foundation, Inc. + Contributed by Klaus Kämpf (kkaempf@progis.de) of + proGIS Software, Aachen, Germany. + + 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. */ + +/* + * This file is obj-evax.h and is intended to be a template for + * object format specific header files. + */ + +/* define an obj specific macro off which target cpu back ends may key. */ +#define OBJ_EVAX 1 + +/* include whatever target cpu is appropriate. */ +#include "targ-cpu.h" + +#ifdef BFD_ASSEMBLER +#define OUTPUT_FLAVOR bfd_target_evax_flavour +#endif + +/* + * SYMBOLS + */ + +/* + * If your object format needs to reorder symbols, define this. When + * defined, symbols are kept on a doubly linked list and functions are + * made available for push, insert, append, and delete. If not defined, + * symbols are kept on a singly linked list, only the append and clear + * facilities are available, and they are macros. + */ + +/* #define SYMBOLS_NEED_PACKPOINTERS */ + +/* */ +typedef struct + { + void *nothing; + } +obj_symbol_type; /* should be the format's symbol structure */ + +typedef void *object_headers; + +#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE (0) /* your magic number */ + +#define OBJ_EMIT_LINENO(a,b,c) /* must be *something*. This no-op's it out. */ + +#define obj_symbol_new_hook(s) {;} + +#define S_SET_OTHER(S,V) +#define S_SET_TYPE(S,T) +#define S_SET_DESC(S,D) +#define S_GET_OTHER(S) 0 +#define S_GET_TYPE(S) 0 +#define S_GET_DESC(S) 0 + +#undef AXP_REG_GP +#define AXP_REG_GP AXP_REG_PV + +#define PDSC_S_K_KIND_FP_STACK 9 +#define PDSC_S_K_KIND_FP_REGISTER 10 +#define PDSC_S_K_KIND_NULL 8 + +#define PDSC_S_K_MIN_STACK_SIZE 32 +#define PDSC_S_K_MIN_REGISTER_SIZE 24 +#define PDSC_S_K_NULL_SIZE 16 + +#define PDSC_S_M_BASE_REG_IS_FP 0x80 /* low byte */ +#define PDSC_S_M_NATIVE 0x10 /* high byte */ +#define PDSC_S_M_NO_JACKET 0x20 /* high byte */ + +#define LKP_S_K_SIZE 16 + +struct evaxProc { + symbolS *symbol; /* proc pdesc symbol */ + int pdsckind; + int framereg; /* register for frame pointer */ + int framesize; /* size of frame */ + int rsa_offset; + int ra_save; + int fp_save; + long imask; + long fmask; + int type; + int prologue; +}; + +typedef struct evaxProc evaxProcT; +typedef struct evaxProc *evaxProcP; + +/* + * Local Variables: + * comment-column: 0 + * fill-column: 131 + * End: + */ + +/* end of obj-evax.h */ diff --git a/gnu/usr.bin/binutils/gas/makefile.vms b/gnu/usr.bin/binutils/gas/makefile.vms new file mode 100644 index 00000000000..c9d4d7e5227 --- /dev/null +++ b/gnu/usr.bin/binutils/gas/makefile.vms @@ -0,0 +1,54 @@ +# +# makefile for gas +# +# Created by Klaus Kämpf, kkaempf@progis.de +# + +CC=gcc + +ifeq ($(CC),gcc) +DEFS= +CFLAGS=/include=([],[-.bfd],[.config],[-.include],[-])$(DEFS) +LFLAGS= +LIBS=,GNU_CC:[000000]LIBGCC2/lib,GNU_CC:[000000]LIBGCCLIB/lib,\ + sys$$library:vaxcrtl.olb/lib,GNU_CC:[000000]crt0.obj +else +DEFS=/define=("table_size_of_flonum_powers_of_ten"="tabsiz_flonum_powers_of_ten",\ +"_bfd_generic_get_section_contents_in_window"="_bfd_generic_get_win_section_cont",\ +"_elf_section_from_bfd_section"="_bfd_elf_sec_from_bfd_sec","const=") +CFLAGS=/noopt/debug/include=([],[-.bfd],[.config],[-.include],[-])$(DEFS) +LFLAGS= +LIBS= +endif + +OBJS=targ-cpu.obj,obj-format.obj,atof-targ.obj,app.obj,as.obj,atof-generic.obj,\ + bignum-copy.obj,cond.obj,expr.obj,flonum-konst.obj,flonum-copy.obj,\ + flonum-mult.obj,frags.obj,hash.obj,input-file.obj,input-scrub.obj,\ + literal.obj,messages.obj,output-file.obj,read.obj,subsegs.obj,symbols.obj,\ + write.obj,listing.obj,ecoff.obj,stabs.obj,sb.obj,macro.obj + +LIBIBERTY = [-.libiberty]libiberty.olb +LIBBFD = [-.bfd]libbfd.olb +LIBOPCODES = [-.opcodes]libopcodes.olb + + +as.exe: $(OBJS) $(LIBOPCODES) $(LIBBFD) $(LIBIBERTY) + link$(LFLAGS)/exe=$@ $(OBJS),$(LIBOPCODES)/lib,$(LIBBFD)/lib,$(LIBIBERTY)/lib$(LIBS) + +gasp.exe: gasp.obj $(LIBBFD) $(LIBIBERTY) + link$(LFLAGS)/exe=$@ gasp.obj,$(LIBBFD)/lib,$(LIBIBERTY)/lib$(LIBS) + +targ-cpu.c: [.config]tc-alpha.c + copy $< $@ +targ-cpu.h: [.config]tc-alpha.h + copy $< $@ +targ-env.h: [.config]te-generic.h + copy $< $@ +obj-format.h: [.config]obj-evax.h + copy $< $@ +obj-format.c: [.config]obj-evax.c + copy $< $@ +atof-targ.c: [.config]atof-ieee.c + copy $< $@ + +targ-cpu.obj: targ-cpu.c targ-cpu.h [.config]atof-vax.c |