From a51c9b66271f0551fb83b90a7db6c464eac2318b Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 17 Sep 2002 01:49:00 +0000 Subject: Initiate deorbit burn for the i386-only a.out related support. Moves are under way to move the remnants of the a.out toolchain to ports. As the comment in src/Makefile said, this stuff is deprecated and one should not expect this to remain beyond 4.0-REL. It has already lasted WAY beyond that. Notable exceptions: gcc - I have not touched the a.out generation stuff there. ldd/ldconfig - still have some code to interface with a.out rtld. old as/ld/etc - I have not removed these yet, pending their move to ports. some includes - necessary for ldd/ldconfig for now. Tested on: i386 (extensively), alpha --- sys/alpha/include/asm.h | 18 +++------------ sys/alpha/include/param.h | 7 ------ sys/amd64/amd64/locore.S | 6 ----- sys/amd64/amd64/locore.s | 6 ----- sys/amd64/include/asm.h | 9 -------- sys/amd64/include/param.h | 7 ------ sys/amd64/include/profile.h | 4 ---- sys/arm/include/param.h | 7 ------ sys/boot/i386/boot0/Makefile | 5 ---- sys/boot/i386/btx/btx/Makefile | 5 ---- sys/boot/i386/btx/btxldr/Makefile | 5 ---- sys/boot/i386/btx/lib/Makefile | 2 -- sys/boot/i386/cdboot/Makefile | 5 ---- sys/boot/i386/kgzldr/Makefile | 11 --------- sys/boot/i386/kgzldr/crt.s | 4 ++-- sys/boot/i386/kgzldr/kgzldr.m4 | 18 --------------- sys/boot/i386/kgzldr/sio.s | 4 ++-- sys/boot/i386/kgzldr/start.s | 4 ++-- sys/boot/i386/liloldr/Makefile | 11 --------- sys/boot/i386/mbr/Makefile | 5 ---- sys/boot/i386/pxeldr/Makefile | 5 ---- sys/boot/pc98/btx/btx/Makefile | 5 ---- sys/boot/pc98/btx/btxldr/Makefile | 5 ---- sys/boot/pc98/kgzldr/Makefile | 5 ---- sys/conf/Makefile.powerpc | 2 +- sys/conf/kern.post.mk | 5 ++-- sys/conf/kern.pre.mk | 12 ---------- sys/conf/kmod.mk | 5 ---- sys/i386/i386/bioscall.s | 8 ------- sys/i386/i386/locore.s | 6 ----- sys/i386/include/asm.h | 9 -------- sys/i386/include/param.h | 7 ------ sys/i386/include/profile.h | 4 ---- sys/ia64/ia64/interrupt.c | 2 -- sys/ia64/include/asm.h | 25 +------------------- sys/ia64/include/param.h | 7 ------ sys/kern/link_elf.c | 8 ------- sys/kern/link_elf_obj.c | 8 ------- sys/modules/oltr/Makefile | 2 +- sys/pc98/apm/apm_bioscall.s | 4 ---- sys/powerpc/include/asm.h | 2 -- sys/powerpc/include/param.h | 7 ------ sys/sparc64/include/param.h | 7 ------ sys/sys/cdefs.h | 22 ------------------ sys/sys/linker_set.h | 48 --------------------------------------- 45 files changed, 14 insertions(+), 349 deletions(-) delete mode 100644 sys/boot/i386/kgzldr/kgzldr.m4 (limited to 'sys') diff --git a/sys/alpha/include/asm.h b/sys/alpha/include/asm.h index d4129ab..84601f3 100644 --- a/sys/alpha/include/asm.h +++ b/sys/alpha/include/asm.h @@ -619,11 +619,9 @@ label: ASCIZ msg; \ /* * WEAK_ALIAS: create a weak alias (ELF only). */ -#ifdef __ELF__ #define WEAK_ALIAS(alias,sym) \ .weak alias; \ alias = sym -#endif /* * Kernel RCS ID tag and copyright macros @@ -631,19 +629,9 @@ label: ASCIZ msg; \ #ifdef _KERNEL -#ifdef __ELF__ -#define __KERNEL_SECTIONSTRING(_sec, _str) \ - .section _sec ; .asciz _str ; .text -#else /* __ELF__ */ -#define __KERNEL_SECTIONSTRING(_sec, _str) \ - .data ; .asciz _str ; .align 3 ; .text -#endif /* __ELF__ */ - -#define __KERNEL_RCSID(_n, _s) __KERNEL_SECTIONSTRING(.ident, _s) -#define __KERNEL_COPYRIGHT(_n, _s) __KERNEL_SECTIONSTRING(.copyright, _s) - -#ifdef NO_KERNEL_RCSIDS -#undef __KERNEL_RCSID +#if !defined(lint) && !defined(NO_KERNEL_RCSIDS) +#define __KERNEL_RCSID(_n, _s) .ident _s +#else #define __KERNEL_RCSID(_n, _s) /* nothing */ #endif diff --git a/sys/alpha/include/param.h b/sys/alpha/include/param.h index 444b8b7..5a286f4 100644 --- a/sys/alpha/include/param.h +++ b/sys/alpha/include/param.h @@ -91,13 +91,6 @@ #include #include -/* - * OBJFORMAT_NAMES is a comma-separated list of the object formats - * that are supported on the architecture. - */ -#define OBJFORMAT_NAMES "elf" -#define OBJFORMAT_DEFAULT "elf" - #ifdef SMP #define MAXCPU 32 #else diff --git a/sys/amd64/amd64/locore.S b/sys/amd64/amd64/locore.S index 94a3a10..5d5b39e 100644 --- a/sys/amd64/amd64/locore.S +++ b/sys/amd64/amd64/locore.S @@ -58,12 +58,6 @@ #include "assym.s" -#ifdef __AOUT__ -#define etext _etext -#define edata _edata -#define end _end -#endif - /* * XXX * diff --git a/sys/amd64/amd64/locore.s b/sys/amd64/amd64/locore.s index 94a3a10..5d5b39e 100644 --- a/sys/amd64/amd64/locore.s +++ b/sys/amd64/amd64/locore.s @@ -58,12 +58,6 @@ #include "assym.s" -#ifdef __AOUT__ -#define etext _etext -#define edata _edata -#define end _end -#endif - /* * XXX * diff --git a/sys/amd64/include/asm.h b/sys/amd64/include/asm.h index cf5f767..685b583 100644 --- a/sys/amd64/include/asm.h +++ b/sys/amd64/include/asm.h @@ -69,13 +69,8 @@ * language name. HIDENAME is given an assembly-language name, and expands * to a possibly-modified form that will be invisible to C programs. */ -#ifdef __ELF__ #define CNAME(csym) csym #define HIDENAME(asmsym) __CONCAT(.,asmsym) -#else -#define CNAME(csym) __CONCAT(_,csym) -#define HIDENAME(asmsym) asmsym -#endif /* XXX should use .p2align 4,0x90 for -m486. */ #define _START_ENTRY .text; .p2align 2,0x90 @@ -103,12 +98,8 @@ #undef __FBSDID #if !defined(lint) && !defined(STRIP_FBSDID) -#ifdef __ELF__ #define __FBSDID(s) .ident s #else -#define __FBSDID(s) .data ; .asciz s ; .previous -#endif -#else #define __FBSDID(s) /* nothing */ #endif /* not lint and not STRIP_FBSDID */ diff --git a/sys/amd64/include/param.h b/sys/amd64/include/param.h index a6ab20c..b166a1a 100644 --- a/sys/amd64/include/param.h +++ b/sys/amd64/include/param.h @@ -84,13 +84,6 @@ #endif #define MID_MACHINE MID_X86_64 -/* - * OBJFORMAT_NAMES is a comma-separated list of the object formats - * that are supported on the architecture. - */ -#define OBJFORMAT_NAMES "elf" -#define OBJFORMAT_DEFAULT "elf" - #ifdef SMP #define MAXCPU 16 #else diff --git a/sys/amd64/include/profile.h b/sys/amd64/include/profile.h index 0c07444..043d2ba 100644 --- a/sys/amd64/include/profile.h +++ b/sys/amd64/include/profile.h @@ -145,11 +145,7 @@ void stopguprof(struct gmonparam *p); __BEGIN_DECLS #ifdef __GNUC__ -#ifdef __ELF__ void mcount(void) __asm(".mcount"); -#else -void mcount(void) __asm("mcount"); -#endif #endif static void _mcount(uintfptr_t frompc, uintfptr_t selfpc); __END_DECLS diff --git a/sys/arm/include/param.h b/sys/arm/include/param.h index 1fd9b60..eb3ae34 100644 --- a/sys/arm/include/param.h +++ b/sys/arm/include/param.h @@ -76,13 +76,6 @@ #include -/* - * OBJFORMAT_NAMES is a comma-separated list of the object formats - * that are supported on the architecture. - */ -#define OBJFORMAT_NAMES "elf" -#define OBJFORMAT_DEFAULT "elf" - #ifdef SMP #define MAXCPU 2 #else diff --git a/sys/boot/i386/boot0/Makefile b/sys/boot/i386/boot0/Makefile index 9de7dcf..434691e 100644 --- a/sys/boot/i386/boot0/Makefile +++ b/sys/boot/i386/boot0/Makefile @@ -24,13 +24,8 @@ BOOT_BOOT0_TICKS?= 0xb6 BOOT_BOOT0_ORG?= 0x600 boot0: boot0.o -.if ${OBJFORMAT} == aout - ${LD} -N -s -T ${BOOT_BOOT0_ORG} -o boot0.out boot0.o - dd if=boot0.out of=${.TARGET} ibs=32 skip=1 -.else ${LD} -N -e start -Ttext ${BOOT_BOOT0_ORG} -o boot0.out boot0.o objcopy -S -O binary boot0.out ${.TARGET} -.endif boot0.o: boot0.s ${AS} ${AFLAGS} --defsym FLAGS=${BOOT_BOOT0_FLAGS} \ diff --git a/sys/boot/i386/btx/btx/Makefile b/sys/boot/i386/btx/btx/Makefile index 1d03cfd..c2a33a6 100644 --- a/sys/boot/i386/btx/btx/Makefile +++ b/sys/boot/i386/btx/btx/Makefile @@ -28,13 +28,8 @@ ORG= 0x9000 all: btx btx: btx.o -.if ${OBJFORMAT} == aout - ${LD} -nostdlib -N -s -T ${ORG} -o btx.out btx.o - dd if=btx.out of=${.TARGET} ibs=32 skip=1 -.else ${LD} -N -e start -Ttext ${ORG} -o btx.out btx.o objcopy -S -O binary btx.out ${.TARGET} -.endif btx.o: btx.s (cd ${.CURDIR}; ${M4} ${M4FLAGS} btx.s) | \ diff --git a/sys/boot/i386/btx/btxldr/Makefile b/sys/boot/i386/btx/btxldr/Makefile index 0d61889..bd69850 100644 --- a/sys/boot/i386/btx/btxldr/Makefile +++ b/sys/boot/i386/btx/btxldr/Makefile @@ -10,13 +10,8 @@ M4FLAGS+= -DBTXLDR_VERBOSE all: btxldr btxldr: btxldr.o -.if ${OBJFORMAT} == aout - ${LD} -nostdlib -N -s -T ${LOADER_ADDRESS} -o btxldr.out btxldr.o - dd if=btxldr.out of=${.TARGET} ibs=32 skip=1 -.else ${LD} -N -e start -Ttext ${LOADER_ADDRESS} -o btxldr.out btxldr.o objcopy -S -O binary btxldr.out ${.TARGET} -.endif btxldr.o: btxldr.s (cd ${.CURDIR}; ${M4} ${M4FLAGS} btxldr.s ) | \ diff --git a/sys/boot/i386/btx/lib/Makefile b/sys/boot/i386/btx/lib/Makefile index 737d5ec..0eba8f9 100644 --- a/sys/boot/i386/btx/lib/Makefile +++ b/sys/boot/i386/btx/lib/Makefile @@ -1,8 +1,6 @@ # $FreeBSD$ OBJS= btxcsu.o btxsys.o btxv86.o -AFLAGS+= -elf -LDFLAGS+= -elf CLEANFILES+= crt0.o ${OBJS} all: crt0.o diff --git a/sys/boot/i386/cdboot/Makefile b/sys/boot/i386/cdboot/Makefile index 18ca69f..9e8e813 100644 --- a/sys/boot/i386/cdboot/Makefile +++ b/sys/boot/i386/cdboot/Makefile @@ -10,13 +10,8 @@ STRIP= BINDIR?= /boot ${PROG}: ${PROG}.o -.if ${OBJFORMAT} == aout - ${LD} -nostdlib -N -s -T ${ORG} -o ${PROG}.out ${PROG}.o - dd if=${PROG}.out of=${.TARGET} ibs=32 skip=1 -.else ${LD} -N -e start -Ttext ${ORG} -o ${PROG}.out ${PROG}.o objcopy -S -O binary ${PROG}.out ${.TARGET} -.endif CLEANFILES+= ${PROG}.o ${PROG}.out diff --git a/sys/boot/i386/kgzldr/Makefile b/sys/boot/i386/kgzldr/Makefile index 607b686..9ed9114 100644 --- a/sys/boot/i386/kgzldr/Makefile +++ b/sys/boot/i386/kgzldr/Makefile @@ -4,11 +4,7 @@ FILES= kgzldr.o SRCS= start.s boot.c inflate.c lib.c crt.s sio.s OBJS= ${SRCS:N*.h:R:S/$/.o/g} CFLAGS= -ffreestanding -.if ${OBJFORMAT} == aout -CFLAGS+=-O2 -.else CFLAGS+=-Os -.endif CFLAGS+=-DKZIP LDFLAGS=-nostdlib -static -r BINDIR= /usr/lib @@ -16,17 +12,10 @@ BINDIR= /usr/lib CLEANFILES=${FILES} -M4?= m4 -M4FLAGS=-DOBJFORMAT=${OBJFORMAT} - BOOT_COMCONSOLE_PORT?= 0x3f8 M4FLAGS+=-DSIOPRT=${BOOT_COMCONSOLE_PORT} kgzldr.o: ${OBJS} ${CC} ${LDFLAGS} -o ${.TARGET} ${OBJS} -.s.o: - (cd ${.CURDIR}; ${M4} ${M4FLAGS} kgzldr.m4 ${.IMPSRC}) |\ - ${AS} ${AFLAGS} -o ${.TARGET} - .include diff --git a/sys/boot/i386/kgzldr/crt.s b/sys/boot/i386/kgzldr/crt.s index ac26a20..cfb479f 100644 --- a/sys/boot/i386/kgzldr/crt.s +++ b/sys/boot/i386/kgzldr/crt.s @@ -38,11 +38,11 @@ .set BDA_SCR,0x449 # Video mode .set BDA_POS,0x450 # Cursor position - .globl _(crt_putchr) + .globl crt_putchr # void crt_putchr(int c) -_(crt_putchr): movb 0x4(%esp,1),%al # Get character +crt_putchr: movb 0x4(%esp,1),%al # Get character pusha # Save xorl %ecx,%ecx # Zero for loops movb $SCR_MAT,%ah # Mode/attribute diff --git a/sys/boot/i386/kgzldr/kgzldr.m4 b/sys/boot/i386/kgzldr/kgzldr.m4 deleted file mode 100644 index 1441a4b..0000000 --- a/sys/boot/i386/kgzldr/kgzldr.m4 +++ /dev/null @@ -1,18 +0,0 @@ -# -# Copyright (c) 2000 Robert Nordier -# All rights reserved. -# -# Redistribution and use in source and binary forms are freely -# permitted provided that the above copyright notice and this -# paragraph and the following disclaimer are duplicated in all -# such forms. -# -# This software is provided "AS IS" and without any express or -# implied warranties, including, without limitation, the implied -# warranties of merchantability and fitness for a particular -# purpose. -# - -# $FreeBSD$ - -define(_,`ifelse(OBJFORMAT,`aout',`_$1',`$1')') diff --git a/sys/boot/i386/kgzldr/sio.s b/sys/boot/i386/kgzldr/sio.s index 86b8ccd..79ea8a6 100644 --- a/sys/boot/i386/kgzldr/sio.s +++ b/sys/boot/i386/kgzldr/sio.s @@ -29,11 +29,11 @@ .set SIO_PRT,SIOPRT # Base port - .globl _(sio_putchr) + .globl sio_putchr # void sio_putchr(int c) -_(sio_putchr): movw $SIO_PRT+0x5,%dx # Line status reg +sio_putchr: movw $SIO_PRT+0x5,%dx # Line status reg xor %ecx,%ecx # Timeout movb $0x40,%ch # counter sio_putchr.1: inb %dx,%al # Transmitter diff --git a/sys/boot/i386/kgzldr/start.s b/sys/boot/i386/kgzldr/start.s index ff43c77..550fa52 100644 --- a/sys/boot/i386/kgzldr/start.s +++ b/sys/boot/i386/kgzldr/start.s @@ -40,6 +40,6 @@ _start: cld # String ops inc rep # Clear stosb # bss pushl 0x4(%esp) # Pass howto flags - call _(boot) # Call C code + call boot # Call C code popl %ecx # Clear stack - jmp *_(kgz)+entry # To loaded code + jmp *kgz+entry # To loaded code diff --git a/sys/boot/i386/liloldr/Makefile b/sys/boot/i386/liloldr/Makefile index 3986eca..5ccffee 100644 --- a/sys/boot/i386/liloldr/Makefile +++ b/sys/boot/i386/liloldr/Makefile @@ -27,23 +27,12 @@ ${BOOT}: ${BSECT} ${LDR} ${LOADER} rm ${.TARGET}.tmp ${LDR}: ${LDR}.o -.if ${OBJFORMAT} == aout - ${LD} -nostdlib -N -s -T ${ORG} -o ${LDR}.out ${LDR}.o - dd if=${LDR}.out of=${.TARGET} ibs=32 skip=1 -.else ${LD} -N -e start -Ttext ${ORG} -o ${LDR}.out ${LDR}.o objcopy -S -O binary ${LDR}.out ${.TARGET} -.endif ${BSECT}: ${BSECT}.o -.if ${OBJFORMAT} == aout - ${LD} -nostdlib -N -s -T ${ORG} -o ${BSECT}.out ${BSECT}.o - dd if=${BSECT}.out of=${.TARGET} ibs=32 skip=1 -.else ${LD} -N -e start -Ttext ${ORG} -o ${BSECT}.out ${BSECT}.o objcopy -S -O binary ${BSECT}.out ${.TARGET} -.endif - ${BSECT}.o: ${BSECT}.s ${LOADER} diff --git a/sys/boot/i386/mbr/Makefile b/sys/boot/i386/mbr/Makefile index ed77dba..50add632 100644 --- a/sys/boot/i386/mbr/Makefile +++ b/sys/boot/i386/mbr/Makefile @@ -9,13 +9,8 @@ BINMODE= 444 ORG= 0x600 mbr: mbr.o -.if ${OBJFORMAT} == aout - ${LD} -N -s -T ${ORG} -o mbr.out mbr.o - dd if=mbr.out of=${.TARGET} ibs=32 skip=1 -.else ${LD} -N -e start -Ttext ${ORG} -o mbr.out mbr.o objcopy -S -O binary mbr.out ${.TARGET} -.endif CLEANFILES+= mbr.out mbr.o diff --git a/sys/boot/i386/pxeldr/Makefile b/sys/boot/i386/pxeldr/Makefile index e798824..6ba21a3 100644 --- a/sys/boot/i386/pxeldr/Makefile +++ b/sys/boot/i386/pxeldr/Makefile @@ -43,13 +43,8 @@ ${LOADER}: ${LOADERBIN} ${BTXLDR} ${BTXKERN} ${BTXCRT} -b ${BTXKERN} ${LOADERBIN} ${LDR}: ${LDR}.o -.if ${OBJFORMAT} == aout - ${LD} -nostdlib -N -s -T ${ORG} -o ${LDR}.out ${LDR}.o - dd if=${LDR}.out of=${.TARGET} ibs=32 skip=1 -.else ${LD} -N -e start -Ttext ${ORG} -o ${LDR}.out ${LDR}.o objcopy -S -O binary ${LDR}.out ${.TARGET} -.endif ${LDR}.o: ${LDR}.s (cd ${.CURDIR}; ${M4} ${M4FLAGS} ${LDR}.s) | \ diff --git a/sys/boot/pc98/btx/btx/Makefile b/sys/boot/pc98/btx/btx/Makefile index de14daa..3b8408d 100644 --- a/sys/boot/pc98/btx/btx/Makefile +++ b/sys/boot/pc98/btx/btx/Makefile @@ -29,13 +29,8 @@ ORG= 0x9000 all: btx btx: btx.o -.if ${OBJFORMAT} == aout - ${LD} -nostdlib -N -s -T ${ORG} -o btx.out btx.o - dd if=btx.out of=${.TARGET} ibs=32 skip=1 -.else ${LD} -N -e start -Ttext ${ORG} -o btx.out btx.o objcopy -S -O binary btx.out ${.TARGET} -.endif btx.o: btx.s (cd ${.CURDIR}; ${M4} ${M4FLAGS} btx.s) | \ diff --git a/sys/boot/pc98/btx/btxldr/Makefile b/sys/boot/pc98/btx/btxldr/Makefile index 35964ce..f88004b 100644 --- a/sys/boot/pc98/btx/btxldr/Makefile +++ b/sys/boot/pc98/btx/btxldr/Makefile @@ -10,13 +10,8 @@ M4FLAGS+= -DBTXLDR_VERBOSE all: btxldr btxldr: btxldr.o -.if ${OBJFORMAT} == aout - ${LD} -nostdlib -N -s -T ${LOADER_ADDRESS} -o btxldr.out btxldr.o - dd if=btxldr.out of=${.TARGET} ibs=32 skip=1 -.else ${LD} -N -e start -Ttext ${LOADER_ADDRESS} -o btxldr.out btxldr.o objcopy -S -O binary btxldr.out ${.TARGET} -.endif btxldr.o: btxldr.s (cd ${.CURDIR}; ${M4} ${M4FLAGS} btxldr.s ) | \ diff --git a/sys/boot/pc98/kgzldr/Makefile b/sys/boot/pc98/kgzldr/Makefile index 0c2998b..22f0cb4 100644 --- a/sys/boot/pc98/kgzldr/Makefile +++ b/sys/boot/pc98/kgzldr/Makefile @@ -4,11 +4,7 @@ FILES= kgzldr.o SRCS= start.s boot.c inflate.c lib.c crt.s sio.s OBJS= ${SRCS:N*.h:R:S/$/.o/g} CFLAGS= -ffreestanding -.if ${OBJFORMAT} == aout -CFLAGS+=-O2 -.else CFLAGS+=-Os -.endif CFLAGS+=-DKZIP LDFLAGS=-nostdlib -static -r BINDIR= /usr/lib @@ -20,7 +16,6 @@ AFLAGS+=--defsym PC98=1 CLEANFILES=${FILES} M4?= m4 -M4FLAGS=-DOBJFORMAT=${OBJFORMAT} BOOT_COMCONSOLE_PORT?= 0x238 M4FLAGS+=-DSIOPRT=${BOOT_COMCONSOLE_PORT} diff --git a/sys/conf/Makefile.powerpc b/sys/conf/Makefile.powerpc index ec3b588..caa127b 100644 --- a/sys/conf/Makefile.powerpc +++ b/sys/conf/Makefile.powerpc @@ -37,7 +37,7 @@ _OS!=uname .if ${_OS} != "FreeBSD" CWARNFLAGS=-Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -COPTS+= -D__ELF__ -D__FreeBSD__ +COPTS+= -D__FreeBSD__ .endif COPTS+= -msoft-float diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk index 0c5aeb4..52f833d 100644 --- a/sys/conf/kern.post.mk +++ b/sys/conf/kern.post.mk @@ -52,8 +52,7 @@ ${mfile:T:S/.m$/.h/}: ${mfile} kernel-clean: rm -f *.o *.so *.So *.ko *.s eddep errs \ - ${FULLKERNEL} ${KERNEL_KO} linterrs makelinks \ - setdef[01].c setdefs.h tags \ + ${FULLKERNEL} ${KERNEL_KO} linterrs makelinks tags \ vers.c vnode_if.c vnode_if.h \ ${MFILES:T:S/.m$/.c/} ${MFILES:T:S/.m$/.h/} \ ${CLEAN} @@ -77,7 +76,7 @@ hack.So: Makefile ./assym.s: assym.s assym.s: $S/kern/genassym.sh genassym.o - NM=${NM} OBJFORMAT=elf sh $S/kern/genassym.sh genassym.o > ${.TARGET} + NM=${NM} sh $S/kern/genassym.sh genassym.o > ${.TARGET} # XXX used to force -elf after CFLAGS to work around breakage of cc -aout # (genassym.sh makes some assumptions and cc stopped satisfying them). diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index 693de33..2a58b29 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -31,24 +31,12 @@ INCLUDES+= -I$S/contrib/dev/acpica # ... and the same for ipfilter INCLUDES+= -I$S/contrib/ipfilter -# This hack is to allow kernel compiles to succeed on machines w/out srcdist -.if exists($S/../include) -INCLUDES+= -I$S/../include -.else -INCLUDES+= -I/usr/include -.endif - COPTS= ${INCLUDES} -D_KERNEL -include opt_global.h CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} -fno-common # XXX LOCORE means "don't declare C stuff" not "for locore.s". ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS} -# Select the correct set of tools. Can't set OBJFORMAT here because it -# doesn't get exported into the environment, and if it were exported -# then it might break building of utilities. -CFLAGS+= ${FMT} - .if defined(PROFLEVEL) && ${PROFLEVEL} >= 1 CFLAGS+= -DGPROF -falign-functions=16 .if ${PROFLEVEL} >= 2 diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index c27762c..709ac34 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -106,11 +106,6 @@ LDFLAGS+= -d -warn-common CFLAGS+= ${DEBUG_FLAGS} -.if ${OBJFORMAT} == elf -CLEANFILES+= setdef0.c setdef1.c setdefs.h -CLEANFILES+= setdef0.o setdef1.o -.endif - OBJS+= ${SRCS:N*.h:R:S/$/.o/g} .if !defined(PROG) diff --git a/sys/i386/i386/bioscall.s b/sys/i386/i386/bioscall.s index 59600a6..3af198a 100644 --- a/sys/i386/i386/bioscall.s +++ b/sys/i386/i386/bioscall.s @@ -63,11 +63,7 @@ ENTRY(bios32) movl 16(%ebp),%esi movl 20(%ebp),%edi pushl %ebp -#ifdef __AOUT__ - lcall bioscall_vector /* Stupid a.out gas! */ -#else lcall *bioscall_vector -#endif popl %ebp movl %eax,0(%ebp) movl %ebx,4(%ebp) @@ -131,11 +127,7 @@ ENTRY(bios16_call) lret /* ...continue below */ .globl CNAME(bios16_jmp) CNAME(bios16_jmp): -#ifdef __AOUT__ - lcallw bioscall_vector /* Stupid a.out gas! */ -#else lcallw *bioscall_vector /* 16-bit call */ -#endif jc 1f pushl $0 /* success */ diff --git a/sys/i386/i386/locore.s b/sys/i386/i386/locore.s index 94a3a10..5d5b39e 100644 --- a/sys/i386/i386/locore.s +++ b/sys/i386/i386/locore.s @@ -58,12 +58,6 @@ #include "assym.s" -#ifdef __AOUT__ -#define etext _etext -#define edata _edata -#define end _end -#endif - /* * XXX * diff --git a/sys/i386/include/asm.h b/sys/i386/include/asm.h index cf5f767..685b583 100644 --- a/sys/i386/include/asm.h +++ b/sys/i386/include/asm.h @@ -69,13 +69,8 @@ * language name. HIDENAME is given an assembly-language name, and expands * to a possibly-modified form that will be invisible to C programs. */ -#ifdef __ELF__ #define CNAME(csym) csym #define HIDENAME(asmsym) __CONCAT(.,asmsym) -#else -#define CNAME(csym) __CONCAT(_,csym) -#define HIDENAME(asmsym) asmsym -#endif /* XXX should use .p2align 4,0x90 for -m486. */ #define _START_ENTRY .text; .p2align 2,0x90 @@ -103,12 +98,8 @@ #undef __FBSDID #if !defined(lint) && !defined(STRIP_FBSDID) -#ifdef __ELF__ #define __FBSDID(s) .ident s #else -#define __FBSDID(s) .data ; .asciz s ; .previous -#endif -#else #define __FBSDID(s) /* nothing */ #endif /* not lint and not STRIP_FBSDID */ diff --git a/sys/i386/include/param.h b/sys/i386/include/param.h index bdc1057..cf9cfe4 100644 --- a/sys/i386/include/param.h +++ b/sys/i386/include/param.h @@ -73,13 +73,6 @@ #endif #define MID_MACHINE MID_I386 -/* - * OBJFORMAT_NAMES is a comma-separated list of the object formats - * that are supported on the architecture. - */ -#define OBJFORMAT_NAMES "elf", "aout" -#define OBJFORMAT_DEFAULT "elf" - #ifdef SMP #define MAXCPU 16 #else diff --git a/sys/i386/include/profile.h b/sys/i386/include/profile.h index 0c07444..043d2ba 100644 --- a/sys/i386/include/profile.h +++ b/sys/i386/include/profile.h @@ -145,11 +145,7 @@ void stopguprof(struct gmonparam *p); __BEGIN_DECLS #ifdef __GNUC__ -#ifdef __ELF__ void mcount(void) __asm(".mcount"); -#else -void mcount(void) __asm("mcount"); -#endif #endif static void _mcount(uintfptr_t frompc, uintfptr_t selfpc); __END_DECLS diff --git a/sys/ia64/ia64/interrupt.c b/sys/ia64/ia64/interrupt.c index 8048868..75c708a 100644 --- a/sys/ia64/ia64/interrupt.c +++ b/sys/ia64/ia64/interrupt.c @@ -37,8 +37,6 @@ #include /* RCS ID & Copyright macro defns */ -/* __KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.23 1998/02/24 07:38:01 thorpej Exp $");*/ - #include #include #include diff --git a/sys/ia64/include/asm.h b/sys/ia64/include/asm.h index 2eb8254..f0a1ec2 100644 --- a/sys/ia64/include/asm.h +++ b/sys/ia64/include/asm.h @@ -164,36 +164,13 @@ label: ASCIZ msg; \ /* * WEAK_ALIAS: create a weak alias (ELF only). */ -#ifdef __ELF__ #define WEAK_ALIAS(alias,sym) \ .weak alias; \ alias = sym -#endif /* - * Kernel RCS ID tag and copyright macros + * ID tag macros */ - -#ifdef _KERNEL - -#ifdef __ELF__ -#define __KERNEL_SECTIONSTRING(_sec, _str) \ - .section _sec ; .asciz _str ; .text -#else /* __ELF__ */ -#define __KERNEL_SECTIONSTRING(_sec, _str) \ - .data ; .asciz _str ; .align 3 ; .text -#endif /* __ELF__ */ - -#define __KERNEL_RCSID(_n, _s) __KERNEL_SECTIONSTRING(.ident, _s) -#define __KERNEL_COPYRIGHT(_n, _s) __KERNEL_SECTIONSTRING(.copyright, _s) - -#ifdef NO_KERNEL_RCSIDS -#undef __KERNEL_RCSID -#define __KERNEL_RCSID(_n, _s) /* nothing */ -#endif - -#endif /* _KERNEL */ - #if !defined(lint) && !defined(STRIP_FBSDID) #define __FBSDID(s) .ident s #else diff --git a/sys/ia64/include/param.h b/sys/ia64/include/param.h index 1d6fcb8..1813d33 100644 --- a/sys/ia64/include/param.h +++ b/sys/ia64/include/param.h @@ -87,13 +87,6 @@ #endif #define MID_MACHINE MID_IA64 -/* - * OBJFORMAT_NAMES is a comma-separated list of the object formats - * that are supported on the architecture. - */ -#define OBJFORMAT_NAMES "elf" -#define OBJFORMAT_DEFAULT "elf" - #ifdef SMP #define MAXCPU 16 #else diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index fb1e73d..9980005 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -55,9 +55,6 @@ #include #include -#ifdef __AOUT__ -#include -#endif #include #include "linker_if.h" @@ -177,7 +174,6 @@ extern struct _dynamic _DYNAMIC; static void link_elf_init(void* arg) { -#ifdef __ELF__ Elf_Dyn *dp; caddr_t modptr, baseptr, sizeptr; elf_file_t ef; @@ -185,11 +181,9 @@ link_elf_init(void* arg) #ifdef DDB char *newfilename; #endif -#endif linker_add_class(&link_elf_class); -#ifdef __ELF__ dp = (Elf_Dyn*) &_DYNAMIC; modname = NULL; modptr = preload_search_by_type("elf kernel"); @@ -240,8 +234,6 @@ link_elf_init(void* arg) r_debug_state(NULL, NULL); /* say hello to gdb! */ #endif - -#endif } SYSINIT(link_elf, SI_SUB_KLD, SI_ORDER_SECOND, link_elf_init, 0); diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c index fb1e73d..9980005 100644 --- a/sys/kern/link_elf_obj.c +++ b/sys/kern/link_elf_obj.c @@ -55,9 +55,6 @@ #include #include -#ifdef __AOUT__ -#include -#endif #include #include "linker_if.h" @@ -177,7 +174,6 @@ extern struct _dynamic _DYNAMIC; static void link_elf_init(void* arg) { -#ifdef __ELF__ Elf_Dyn *dp; caddr_t modptr, baseptr, sizeptr; elf_file_t ef; @@ -185,11 +181,9 @@ link_elf_init(void* arg) #ifdef DDB char *newfilename; #endif -#endif linker_add_class(&link_elf_class); -#ifdef __ELF__ dp = (Elf_Dyn*) &_DYNAMIC; modname = NULL; modptr = preload_search_by_type("elf kernel"); @@ -240,8 +234,6 @@ link_elf_init(void* arg) r_debug_state(NULL, NULL); /* say hello to gdb! */ #endif - -#endif } SYSINIT(link_elf, SI_SUB_KLD, SI_ORDER_SECOND, link_elf_init, 0); diff --git a/sys/modules/oltr/Makefile b/sys/modules/oltr/Makefile index aac495b..19adc98 100644 --- a/sys/modules/oltr/Makefile +++ b/sys/modules/oltr/Makefile @@ -11,7 +11,7 @@ TR_INET6?= 0 # 0/1 requires INET6 to be configured in the kernel TR_IPX?= 0 # 0/1 requires IPX to be configured in the kernel trlld.o: - uudecode < ${.CURDIR}/../../contrib/dev/oltr/i386-${OBJFORMAT}.trlld.o.uu + uudecode < ${.CURDIR}/../../contrib/dev/oltr/i386-elf.trlld.o.uu opt_inet.h: touch opt_inet.h diff --git a/sys/pc98/apm/apm_bioscall.s b/sys/pc98/apm/apm_bioscall.s index f652cd4..2d21f9e 100644 --- a/sys/pc98/apm/apm_bioscall.s +++ b/sys/pc98/apm/apm_bioscall.s @@ -61,11 +61,7 @@ ENTRY(bios32_apm98) pushl %ebp pushfl cli -#ifdef __AOUT__ - lcall bioscall_vector /* Stupid a.out gas! */ -#else lcall *bioscall_vector -#endif movl %eax,%edi movl %edx,%esi lahf diff --git a/sys/powerpc/include/asm.h b/sys/powerpc/include/asm.h index 52580b4..4f311c0 100644 --- a/sys/powerpc/include/asm.h +++ b/sys/powerpc/include/asm.h @@ -84,11 +84,9 @@ #define __FBSDID(s) /* nothing */ #endif /* not lint and not STRIP_FBSDID */ -#ifdef __ELF__ #define WEAK_ALIAS(alias,sym) \ .weak alias; \ alias = sym -#endif #ifdef __STDC__ #define WARN_REFERENCES(_sym,_msg) \ diff --git a/sys/powerpc/include/param.h b/sys/powerpc/include/param.h index 7969e4f..a0ae3db 100644 --- a/sys/powerpc/include/param.h +++ b/sys/powerpc/include/param.h @@ -80,13 +80,6 @@ #include #endif -/* - * OBJFORMAT_NAMES is a comma-separated list of the object formats - * that are supported on the architecture. - */ -#define OBJFORMAT_NAMES "elf" -#define OBJFORMAT_DEFAULT "elf" - #ifdef SMP #define MAXCPU 2 #else diff --git a/sys/sparc64/include/param.h b/sys/sparc64/include/param.h index 9532671..8b7cb39 100644 --- a/sys/sparc64/include/param.h +++ b/sys/sparc64/include/param.h @@ -69,13 +69,6 @@ #endif #define MID_MACHINE MID_SPARC64 -/* - * OBJFORMAT_NAMES is a comma-separated list of the object formats - * that are supported on the architecture. - */ -#define OBJFORMAT_NAMES "elf" -#define OBJFORMAT_DEFAULT "elf" - #ifdef SMP #define MAXCPU 16 #else diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 7bba1d3..2d584f8 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -184,7 +184,6 @@ #ifdef __GNUC__ #define __strong_reference(sym,aliassym) \ extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym))); -#ifdef __ELF__ #ifdef __STDC__ #define __weak_reference(sym,alias) \ __asm__(".weak " #alias); \ @@ -202,32 +201,11 @@ __asm__(".asciz \"msg\""); \ __asm__(".previous") #endif /* __STDC__ */ -#else /* !__ELF__ */ -#ifdef __STDC__ -#define __weak_reference(sym,alias) \ - __asm__(".stabs \"_" #alias "\",11,0,0,0"); \ - __asm__(".stabs \"_" #sym "\",1,0,0,0") -#define __warn_references(sym,msg) \ - __asm__(".stabs \"" msg "\",30,0,0,0"); \ - __asm__(".stabs \"_" #sym "\",1,0,0,0") -#else -#define __weak_reference(sym,alias) \ - __asm__(".stabs \"_/**/alias\",11,0,0,0"); \ - __asm__(".stabs \"_/**/sym\",1,0,0,0") -#define __warn_references(sym,msg) \ - __asm__(".stabs msg,30,0,0,0"); \ - __asm__(".stabs \"_/**/sym\",1,0,0,0") -#endif /* __STDC__ */ -#endif /* __ELF__ */ #endif /* __GNUC__ */ #ifdef __GNUC__ -#ifdef __ELF__ #define __IDSTRING(name,string) __asm__(".ident\t\"" string "\"") #else -#define __IDSTRING(name,string) __asm__(".data\n\t.asciz\t\"" string "\"\n\t.previous") -#endif -#else /* * This doesn't work in header files. But it may be better than nothing. * The alternative is: #define __IDSTRING(name,string) [nothing] diff --git a/sys/sys/linker_set.h b/sys/sys/linker_set.h index 7f6438b..ee60ffd 100644 --- a/sys/sys/linker_set.h +++ b/sys/sys/linker_set.h @@ -34,10 +34,8 @@ * The following macros are used to declare global sets of objects, which * are collected by the linker into a `linker_set' as defined below. * For ELF, this is done by constructing a separate segment for each set. - * For a.out, it is done automatically by the linker. */ -#if defined(__ELF__) /* * Private macros, not to be used outside this header file. */ @@ -73,52 +71,6 @@ #define SET_LIMIT(set) \ (&__CONCAT(__stop_set_,set)) -#else /* __ELF__ */ - -/* - * The old way. This depends on GNU ld extensions that are not widely - * available outside of the a.out format. - * - * NB: the constants defined below must match those defined in - * ld/ld.h. Since their calculation requires arithmetic, we - * can't name them symbolically (e.g., 23 is N_SETT | N_EXT). - * - * In the __MAKE_SET macro below, the line: - * static void const * const __set_##set##_sym_##sym = &sym; - * is present only to prevent the compiler from producing bogus - * warnings about unused symbols. - */ -/* Private macros */ -#ifdef __UNDERSCORES__ -#define __MAKE_SET(set, sym, type) \ - static void const * const __set_##set##_sym_##sym = &sym; \ - __asm(".stabs \"_" #set "\", " #type ", 0, 0, _" #sym) -#else -#define __MAKE_SET(set, sym, type) \ - static void const * const __set_##set##_sym_##sym = &sym; \ - __asm(".stabs \"" #set "\", " #type ", 0, 0, " #sym) -#endif - -/* Public Macros */ -#define TEXT_SET(set, sym) __MAKE_SET(set, sym, 23) -#define DATA_SET(set, sym) __MAKE_SET(set, sym, 25) -#define BSS_SET(set, sym) __MAKE_SET(set, sym, 27) -#define ABS_SET(set, sym) __MAKE_SET(set, sym, 21) -#define SET_ENTRY(set, sym) error error must provide text/data type - -#define SET_DECLARE(set, ptype) \ - extern struct { \ - int ls_length; \ - ptype *ls_items[1]; \ - } set - -#define SET_BEGIN(set) \ - (&((set).ls_items[0])) -#define SET_LIMIT(set) \ - (&((set).ls_items[(set).ls_length])) - -#endif /* __ELF__ */ - /* * Iterate over all the elements of a set. * -- cgit v1.1