diff options
author | Todd T. Fries <todd@cvs.openbsd.org> | 2005-08-10 16:58:43 +0000 |
---|---|---|
committer | Todd T. Fries <todd@cvs.openbsd.org> | 2005-08-10 16:58:43 +0000 |
commit | 93c5dd72ddbdfa6097c4e92f1743008fa331b3cc (patch) | |
tree | edf8e57f8f36bb0ac0d638fd9e5e33a9ad9a2629 | |
parent | c2c95ff7ad15cd260aa246ed68da761b04435013 (diff) |
suggested by art, go for it deraadt, ok miod@
remove ECOFF support
-rw-r--r-- | sys/arch/alpha/stand/boot/Makefile | 7 | ||||
-rw-r--r-- | sys/arch/alpha/stand/bootxx/Makefile | 4 | ||||
-rw-r--r-- | sys/arch/alpha/stand/headersize.c | 14 | ||||
-rw-r--r-- | sys/arch/alpha/stand/loadfile.c | 123 | ||||
-rw-r--r-- | sys/arch/alpha/stand/netboot/Makefile | 4 | ||||
-rw-r--r-- | sys/arch/alpha/stand/start.S | 6 |
6 files changed, 9 insertions, 149 deletions
diff --git a/sys/arch/alpha/stand/boot/Makefile b/sys/arch/alpha/stand/boot/Makefile index 74aee0ec7d1..29514f0ef7f 100644 --- a/sys/arch/alpha/stand/boot/Makefile +++ b/sys/arch/alpha/stand/boot/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.14 2001/05/16 00:38:11 deraadt Exp $ +# $OpenBSD: Makefile,v 1.15 2005/08/10 16:58:42 todd Exp $ # $NetBSD: Makefile,v 1.17 1997/04/17 07:27:46 thorpej Exp $ S= ${.CURDIR}/../../../.. @@ -20,9 +20,6 @@ CLEANFILES+= vers.c vers.o ${PROG}.sym ${PROG}.nosym ${HEADERSIZE_PROG} DEFNS= -DCOMPAT_UFS -DALPHA_BOOT_ELF -#.if !defined(BOOT_NO_ECOFF) -#DEFNS+=-DALPHA_BOOT_ECOFF -#.endif AFLAGS += -DASSEMBLER ${DEFNS} CPPFLAGS += -I${.CURDIR}/../../../../lib/libsa -I${.CURDIR}/../.. -I${S} ${DEFNS} @@ -67,4 +64,4 @@ ${PROG}.sym: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${COMPILE.c} vers.c ${LD} -Ttext ${BOOT_RELOC} -N -e start -o ${PROG}.sym \ ${OBJS} vers.o ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} - size ${PROG}.sym
\ No newline at end of file + size ${PROG}.sym diff --git a/sys/arch/alpha/stand/bootxx/Makefile b/sys/arch/alpha/stand/bootxx/Makefile index 3c2e6391928..c9d82a03846 100644 --- a/sys/arch/alpha/stand/bootxx/Makefile +++ b/sys/arch/alpha/stand/bootxx/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.7 2001/01/16 15:36:36 art Exp $ +# $OpenBSD: Makefile,v 1.8 2005/08/10 16:58:42 todd Exp $ # $NetBSD: Makefile,v 1.12 1997/04/17 07:27:49 thorpej Exp $ S= ${.CURDIR}/../../../.. @@ -18,7 +18,7 @@ HEADERSIZE_PROG = headersize CLEANFILES+= ${PROG}.sym ${PROG}.nosym ${PROG}.trunc ${HEADERSIZE_PROG} DEFNS= -DPRIMARY_BOOTBLOCK -DEFNS+= -DALPHA_BOOT_ECOFF -DALPHA_BOOT_ELF +DEFNS+= -DALPHA_BOOT_ELF AFLAGS += -DASSEMBLER ${DEFNS} CPPFLAGS += -I${.CURDIR}/../.. -I${S} ${DEFNS} diff --git a/sys/arch/alpha/stand/headersize.c b/sys/arch/alpha/stand/headersize.c index c8f222d467b..b1e9d7e318f 100644 --- a/sys/arch/alpha/stand/headersize.c +++ b/sys/arch/alpha/stand/headersize.c @@ -1,4 +1,4 @@ -/* $OpenBSD: headersize.c,v 1.7 2001/01/15 12:07:35 art Exp $ */ +/* $OpenBSD: headersize.c,v 1.8 2005/08/10 16:58:42 todd Exp $ */ /* $NetBSD: headersize.c,v 1.5 1996/09/23 04:32:59 cgd Exp $ */ /* @@ -48,9 +48,6 @@ main(argc, argv) char *argv[]; { char buf[HDR_BUFSIZE], *fname; -#ifdef ALPHA_BOOT_ECOFF - struct ecoff_exechdr *ecoffp; -#endif #ifdef ALPHA_BOOT_ELF Elf64_Ehdr *elfp; #endif @@ -68,19 +65,10 @@ main(argc, argv) if (read(fd, &buf, HDR_BUFSIZE) < HDR_BUFSIZE) err(1, "%s: read failed", fname); -#ifdef ALPHA_BOOT_ECOFF - ecoffp = (struct ecoff_exechdr *)buf; -#endif #ifdef ALPHA_BOOT_ELF elfp = (Elf64_Ehdr *)buf; #endif -#ifdef ALPHA_BOOT_ECOFF - if (!ECOFF_BADMAG(ecoffp)) { - printf("%ld\n", ECOFF_TXTOFF(ecoffp)); - } - else -#endif #ifdef ALPHA_BOOT_ELF if (memcmp(ELFMAG, elfp->e_ident, SELFMAG) == 0) { Elf64_Phdr phdr; diff --git a/sys/arch/alpha/stand/loadfile.c b/sys/arch/alpha/stand/loadfile.c index c1a40af12b7..fe1e25c6953 100644 --- a/sys/arch/alpha/stand/loadfile.c +++ b/sys/arch/alpha/stand/loadfile.c @@ -1,4 +1,4 @@ -/* $OpenBSD: loadfile.c,v 1.16 2004/12/01 20:55:07 deraadt Exp $ */ +/* $OpenBSD: loadfile.c,v 1.17 2005/08/10 16:58:42 todd Exp $ */ /* $NetBSD: loadfile.c,v 1.3 1997/04/06 08:40:59 cgd Exp $ */ /* @@ -53,9 +53,6 @@ #define _KERNEL #include "include/pte.h" -#ifdef ALPHA_BOOT_ECOFF -static int coff_exec(int, struct ecoff_exechdr *, u_int64_t *); -#endif #ifdef ALPHA_BOOT_ELF static int elf_exec(int, Elf64_Ehdr *, u_int64_t *); #endif @@ -76,9 +73,6 @@ loadfile(fname, entryp) { struct devices *dp; union { -#ifdef ALPHA_BOOT_ECOFF - struct ecoff_exechdr coff; -#endif #ifdef ALPHA_BOOT_ELF Elf64_Ehdr elf; #endif @@ -100,11 +94,6 @@ loadfile(fname, entryp) goto err; } -#ifdef ALPHA_BOOT_ECOFF - if (!ECOFF_BADMAG(&hdr.coff)) { - rval = coff_exec(fd, &hdr.coff, entryp); - } else -#endif #ifdef ALPHA_BOOT_ELF if (memcmp(ELFMAG, hdr.elf.e_ident, SELFMAG) == 0) { rval = elf_exec(fd, &hdr.elf, entryp); @@ -120,116 +109,6 @@ err: return (rval); } -#ifdef ALPHA_BOOT_ECOFF -static int -coff_exec(fd, coff, entryp) - int fd; - struct ecoff_exechdr *coff; - u_int64_t *entryp; -{ - struct nlist *symtab; - struct ecoff_symhdr symhdr; - struct ecoff_extsym sym; - int symsize, nesyms; - - /* Read in text. */ - (void)printf("%lu", coff->a.tsize); - if (lseek(fd, ECOFF_TXTOFF(coff), SEEK_SET) == -1) { - WARN(("seek to text: %s\n", strerror(errno))); - return (1); - } - if (read(fd, (void *)coff->a.text_start, coff->a.tsize) != - coff->a.tsize) { - WARN(("read text: %s\n", strerror(errno))); - return (1); - } - - /* Read in data. */ - if (coff->a.dsize != 0) { - (void)printf("+%lu", coff->a.dsize); - if (read(fd, (void *)coff->a.data_start, coff->a.dsize) != - coff->a.dsize) { - WARN(("read data: %s\n", strerror(errno))); - return (1); - } - } - - - /* Zero out bss. */ - if (coff->a.bsize != 0) { - (void)printf("+%lu", coff->a.bsize); - bzero((void *)coff->a.bss_start, coff->a.bsize); - } - - ffp_save = coff->a.text_start + coff->a.tsize; - if (ffp_save < coff->a.data_start + coff->a.dsize) - ffp_save = coff->a.data_start + coff->a.dsize; - if (ffp_save < coff->a.bss_start + coff->a.bsize) - ffp_save = coff->a.bss_start + coff->a.bsize; - - /* Get symbols if there for DDB's sake. */ - if (coff->f.f_symptr && coff->f.f_nsyms) { - if (lseek(fd, coff->f.f_symptr, SEEK_SET) == -1) { - WARN(("seek to symbol table header: %s\n", - strerror(errno))); - return (1); - } - if (read(fd, &symhdr, coff->f.f_nsyms) != coff->f.f_nsyms) { - WARN(("read symbol table header: %s\n", - strerror(errno))); - return (1); - } - *(long *)ffp_save = symsize = - symhdr.esymMax * sizeof(struct nlist); - ffp_save += sizeof(long); - printf("+[%d", symsize); - symtab = (struct nlist *)ffp_save; - bzero(symtab, symsize); - if (lseek(fd, symhdr.cbExtOffset, SEEK_SET) == -1) { - WARN(("lseek to symbol table: %s\n", strerror(errno))); - return (1); - } - nesyms = symhdr.esymMax; - while (nesyms--) { - if (read(fd, &sym, sizeof(sym)) != sizeof(sym)) { - WARN(("read symbols: %s\n", strerror(errno))); - return (1); - } - symtab->n_un.n_strx = sym.es_strindex + sizeof(int); - symtab->n_value = sym.es_value; - symtab->n_type = N_EXT; - if (sym.es_class == 1) /* scText */ - symtab->n_type != N_TEXT; - symtab++; - } - ffp_save += symsize; - *(int *)ffp_save = symhdr.estrMax + sizeof(int); - ffp_save += sizeof(int); - if (lseek(fd, symhdr.cbSsExtOffset, SEEK_SET) == -1) { - WARN(("seek to string table: %s\n", strerror(errno))); - return (1); - } - if (read(fd, (char *)ffp_save, symhdr.estrMax) != - symhdr.estrMax) { - WARN(("read string table: %s\n", strerror(errno))); - return (1); - } - ffp_save += symhdr.estrMax; - printf("+%d]", symhdr.estrMax); - esym = ((ffp_save + sizeof(int) - 1) & ~(sizeof(int) - 1)); - ssym = (vaddr_t)symtab; - } - - ffp_save = ALPHA_K0SEG_TO_PHYS((ffp_save + PGOFSET & ~PGOFSET)) >> - PGSHIFT; - ffp_save += 2; /* XXX OSF/1 does this, no idea why. */ - - (void)printf("\n"); - *entryp = coff->a.entry; - return (0); -} -#endif /* ALPHA_BOOT_ECOFF */ - #ifdef ALPHA_BOOT_ELF static int elf_exec(fd, elf, entryp) diff --git a/sys/arch/alpha/stand/netboot/Makefile b/sys/arch/alpha/stand/netboot/Makefile index b953b86fcd3..472f79cef43 100644 --- a/sys/arch/alpha/stand/netboot/Makefile +++ b/sys/arch/alpha/stand/netboot/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.5 2001/01/16 15:36:36 art Exp $ +# $OpenBSD: Makefile,v 1.6 2005/08/10 16:58:42 todd Exp $ # $NetBSD: Makefile,v 1.11 1997/04/17 07:27:50 thorpej Exp $ S= ${.CURDIR}/../../../.. @@ -20,7 +20,7 @@ HEADERSIZE_PROG = headersize CLEANFILES+= vers.c vers.o ${PROG}.sym ${PROG}.nosym ${HEADERSIZE_PROG} -DEFNS= -DPRIMARY_BOOTBLOCK -DALPHA_BOOT_ECOFF -DALPHA_BOOT_ELF +DEFNS= -DPRIMARY_BOOTBLOCK -DALPHA_BOOT_ELF AFLAGS += -DASSEMBLER ${DEFNS} CPPFLAGS += -I${.CURDIR}/../.. -I${S} ${DEFNS} diff --git a/sys/arch/alpha/stand/start.S b/sys/arch/alpha/stand/start.S index a3eb03974e4..f1ac66d77d6 100644 --- a/sys/arch/alpha/stand/start.S +++ b/sys/arch/alpha/stand/start.S @@ -1,4 +1,4 @@ -/* $OpenBSD: start.S,v 1.3 1996/10/30 22:40:36 niklas Exp $ */ +/* $OpenBSD: start.S,v 1.4 2005/08/10 16:58:42 todd Exp $ */ /* $NetBSD: start.S,v 1.4 1996/10/17 02:50:40 cgd Exp $ */ /* @@ -54,11 +54,7 @@ Lstartgp: lda sp,-ENTRY_FRAME(sp) #endif -#ifdef ECOFF_COMPAT - lda a0,_EDATA -#else lda a0,_edata -#endif lda a1,_end subq a1,a0,a1 CALL(bzero) |