From 66422f5b7a1a6055f0b2358268eb902aab6e2e3e Mon Sep 17 00:00:00 2001 From: Peter Wemm 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 --- Makefile | 14 +------ Makefile.inc1 | 13 +++--- etc/Makefile | 3 -- etc/mtree/BSD.usr.dist | 4 -- etc/rc | 20 ++++------ etc/rc.d/ldconfig | 20 ++++------ gnu/lib/Makefile | 6 --- gnu/lib/libgcc/Makefile | 7 ---- gnu/usr.bin/binutils/Makefile.inc | 2 +- gnu/usr.bin/cc/c++filt/Makefile | 1 - gnu/usr.bin/cc/cc_int/Makefile | 4 -- gnu/usr.bin/gzip/Makefile | 2 +- gnu/usr.bin/gzip/match.S | 2 +- include/link.h | 4 -- lib/Makefile | 4 +- lib/libc/amd64/SYS.h | 6 +-- lib/libc/gen/dlfcn.c | 79 +----------------------------------- lib/libc/gen/getobjformat.c | 84 ++------------------------------------- lib/libc/gmon/gmon.c | 2 +- lib/libc/i386/SYS.h | 6 +-- lib/libmd/Makefile | 2 - lib/libncurses/Makefile | 13 ------ lib/libpam/libpam/Makefile | 4 -- lib/liby/Makefile | 25 ------------ lib/ncurses/ncurses/Makefile | 13 ------ libexec/Makefile | 8 +--- libexec/rtld-aout/shlib.c | 2 +- release/Makefile | 8 +--- sbin/ldconfig/ldconfig.c | 19 ++++----- share/mk/bsd.dep.mk | 9 ----- share/mk/bsd.lib.mk | 20 ---------- share/mk/bsd.own.mk | 7 ---- share/mk/bsd.prog.mk | 7 ---- share/mk/sys.mk | 10 +---- 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 ---------------------- tools/tools/kernxref/kernxref.sh | 7 +--- usr.bin/Makefile | 10 +---- usr.bin/doscmd/Makefile | 31 --------------- usr.bin/ldd/sods.c | 4 +- usr.bin/objformat/Makefile | 16 -------- usr.bin/objformat/objformat.1 | 59 +++++---------------------- usr.bin/objformat/objformat.c | 51 ++---------------------- usr.bin/xlint/lint1/Makefile | 3 +- usr.sbin/keyserv/Makefile | 3 -- usr.sbin/keyserv/crypt_server.c | 29 -------------- 89 files changed, 84 insertions(+), 922 deletions(-) delete mode 100644 sys/boot/i386/kgzldr/kgzldr.m4 diff --git a/Makefile b/Makefile index e99c0f011201..6c08c5e2d07d 100644 --- a/Makefile +++ b/Makefile @@ -56,13 +56,6 @@ # # See src/UPDATING `COMMON ITEMS' for more complete information. # -# If -DWANT_AOUT is specified, a `make world' with OBJFORMAT=elf will -# update the legacy support for aout. This includes all libraries, ld.so -# and boot objects. This part of build should be regarded as -# deprecated and you should _not_ expect to be able to do this past the -# release of 4.0. You have exactly one major release to move entirely -# to elf. -# # If TARGET_ARCH=arch (e.g. ia64, sparc64, ...) is specified you can # cross build world for other architectures using the buildworld target, # and once the world is built you can cross build a kernel using the @@ -87,9 +80,6 @@ # upgrade. Optionally, you can also start it with NOCONFIRM=yes and skip # the confirmation steps. # -# At the end of the upgrade procedure, /etc/objformat is created or -# updated to contain OBJFORMAT=elf. From then on, you're elf by default. -# # ---------------------------------------------------------------------------- # # @@ -132,7 +122,7 @@ STARTTIME!= LC_ALL=C date # world: upgrade_checks @echo "--------------------------------------------------------------" - @echo ">>> ${OBJFORMAT} make world started on ${STARTTIME}" + @echo ">>> elf make world started on ${STARTTIME}" @echo "--------------------------------------------------------------" .if target(pre-world) @echo @@ -152,7 +142,7 @@ world: upgrade_checks .endif @echo @echo "--------------------------------------------------------------" - @printf ">>> ${OBJFORMAT} make world completed on `LC_ALL=C date`\n (started ${STARTTIME})\n" + @printf ">>> elf make world completed on `LC_ALL=C date`\n (started ${STARTTIME})\n" @echo "--------------------------------------------------------------" # diff --git a/Makefile.inc1 b/Makefile.inc1 index 357f6432716c..51609ef68e4c 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -156,7 +156,6 @@ WORLDTMP= ${OBJTREE}${.CURDIR}/${MACHINE_ARCH} # /usr/games added for fortune which depend on strfile STRICTTMPPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games TMPPATH= ${STRICTTMPPATH}:${PATH} -OBJFORMAT_PATH?= /usr/libexec INSTALLTMP!= /usr/bin/mktemp -d -u -t install @@ -186,7 +185,6 @@ CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \ MACHINE_ARCH=${TARGET_ARCH} \ MACHINE=${TARGET} \ CPUTYPE=${TARGET_CPUTYPE} \ - OBJFORMAT_PATH=${WORLDTMP}/usr/libexec \ GROFF_BIN_PATH=${WORLDTMP}/usr/bin \ GROFF_FONT_PATH=${WORLDTMP}/usr/share/groff_font \ GROFF_TMAC_PATH=${WORLDTMP}/usr/share/tmac @@ -222,11 +220,10 @@ IMAKEENV= ${CROSSENV} \ IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 # kernel stage -KMAKEENV= ${WMAKEENV} \ - OBJFORMAT_PATH=${WORLDTMP}/usr/libexec:${OBJFORMAT_PATH} +KMAKEENV= ${WMAKEENV} USRDIRS= usr/bin usr/lib/compat/aout usr/games usr/libdata/ldscripts \ - usr/libexec/${OBJFORMAT} usr/sbin usr/share/misc \ + usr/libexec usr/sbin usr/share/misc \ usr/share/dict \ usr/share/groff_font/devX100 \ usr/share/groff_font/devX100-12 \ @@ -654,7 +651,7 @@ _xlint= usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint cross-tools: .for _tool in ${_btxld} ${_elf2aout} ${_elf2exe} \ - gnu/usr.bin/binutils usr.bin/objformat usr.sbin/crunch/crunchide \ + gnu/usr.bin/binutils usr.sbin/crunch/crunchide \ gnu/usr.bin/cc ${_xlint} ${ECHODIR} "===> ${_tool}"; \ cd ${.CURDIR}/${_tool}; \ @@ -689,8 +686,8 @@ libraries: # shared libraries for ELF. # _startup_libs= gnu/lib/csu gnu/lib/libgcc -.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-${OBJFORMAT}) -_startup_libs+= lib/csu/${MACHINE_ARCH}-${OBJFORMAT} +.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf) +_startup_libs+= lib/csu/${MACHINE_ARCH}-elf .else _startup_libs+= lib/csu/${MACHINE_ARCH} .endif diff --git a/etc/Makefile b/etc/Makefile index 8f7e38993f78..752240f355c0 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -60,9 +60,6 @@ FREEBSD=COPYRIGHT distribute: cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION} -.if defined(OBJFORMAT) - echo OBJFORMAT=${OBJFORMAT} > ${DISTDIR}/${DISTRIBUTION}/etc/objformat -.endif ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \ ${DISTDIR}/${DISTRIBUTION}/boot/device.hints diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index ced5cbdce23a..0593d95b04bf 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -38,10 +38,6 @@ .. .. libexec - aout - .. - elf - .. lpr ru .. diff --git a/etc/rc b/etc/rc index c2e47c414d9c..4e56afd4379e 100644 --- a/etc/rc +++ b/etc/rc @@ -698,18 +698,14 @@ case ${ldconfig_insecure} in ;; esac if [ -x /sbin/ldconfig ]; then - case `/usr/bin/objformat` in - elf) - _LDC=/usr/lib - for i in ${ldconfig_paths}; do - if [ -d "${i}" ]; then - _LDC="${_LDC} ${i}" - fi - done - echo 'ELF ldconfig path:' ${_LDC} - ${ldconfig} -elf ${_LDC} - ;; - esac + _LDC=/usr/lib + for i in ${ldconfig_paths}; do + if [ -d "${i}" ]; then + _LDC="${_LDC} ${i}" + fi + done + echo 'ELF ldconfig path:' ${_LDC} + ${ldconfig} ${_LDC} # Legacy aout support for i386 only case `sysctl -n hw.machine_arch` in diff --git a/etc/rc.d/ldconfig b/etc/rc.d/ldconfig index f88e91844431..6723cd4682ff 100755 --- a/etc/rc.d/ldconfig +++ b/etc/rc.d/ldconfig @@ -23,18 +23,14 @@ ldconfig_start() ldconfig=${ldconfig_command} checkyesno ldconfig_insecure && ldconfig="${ldconfig} -i" if [ -x "${ldconfig_command}" ]; then - case `/usr/bin/objformat` in - elf) - _LDC=/usr/lib - for i in ${ldconfig_paths}; do - if [ -d "${i}" ]; then - _LDC="${_LDC} ${i}" - fi - done - echo 'ELF ldconfig path:' ${_LDC} - ${ldconfig} -elf ${_LDC} - ;; - esac + _LDC=/usr/lib + for i in ${ldconfig_paths}; do + if [ -d "${i}" ]; then + _LDC="${_LDC} ${i}" + fi + done + echo 'ELF ldconfig path:' ${_LDC} + ${ldconfig} -elf ${_LDC} # Legacy aout support for i386 only case `sysctl -n hw.machine_arch` in diff --git a/gnu/lib/Makefile b/gnu/lib/Makefile index 9c07c7c0769a..494f888d905f 100644 --- a/gnu/lib/Makefile +++ b/gnu/lib/Makefile @@ -2,12 +2,6 @@ SUBDIR= csu libgcc libdialog libregex libreadline -.if ${OBJFORMAT} == aout -.if !defined(NOLIBC_R) -SUBDIR+= libgcc_r -.endif -.endif - # libsupc++ uses libstdc++ headers, although 'make includes' should # have taken care of that already. .if !defined(NO_CXX) diff --git a/gnu/lib/libgcc/Makefile b/gnu/lib/libgcc/Makefile index ed19ee21e0f4..4a6adf6080bf 100644 --- a/gnu/lib/libgcc/Makefile +++ b/gnu/lib/libgcc/Makefile @@ -13,11 +13,6 @@ LIB= gcc #SHLIB_MAJOR= 1 #SHLIB_MINOR= 0 -.if ${OBJFORMAT} == aout -# Install libgcc_pic.a, since ld.so uses it. -INSTALL_PIC_ARCHIVE= yes -.endif - # # XXX This is a hack, but it seems to work. # libgcc2.a is meant to be compiled by *this* version of gcc. @@ -37,9 +32,7 @@ XCXX= ${CXX} CFLAGS+= -fexceptions CFLAGS+= -DIN_GCC -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED \ -DFINE_GRAINED_LIBRARIES -.if ${OBJFORMAT} != aout CFLAGS+= -D_PTHREADS -DGTHREAD_USE_WEAK -.endif CFLAGS+= -I${.CURDIR}/../../usr.bin/cc/cc_tools \ -I${GCCDIR}/config -I${GCCDIR} -I. LDFLAGS= -nostdlib diff --git a/gnu/usr.bin/binutils/Makefile.inc b/gnu/usr.bin/binutils/Makefile.inc index a988a12b9466..929ef50f5b4d 100644 --- a/gnu/usr.bin/binutils/Makefile.inc +++ b/gnu/usr.bin/binutils/Makefile.inc @@ -1,6 +1,6 @@ # # $FreeBSD$ # +.include "../Makefile.inc" -BINDIR?= /usr/libexec/elf WARNS?= 3 diff --git a/gnu/usr.bin/cc/c++filt/Makefile b/gnu/usr.bin/cc/c++filt/Makefile index 6c42e2a42ad3..95c340d713b5 100644 --- a/gnu/usr.bin/cc/c++filt/Makefile +++ b/gnu/usr.bin/cc/c++filt/Makefile @@ -6,7 +6,6 @@ PROG= c++filt SRCS= cp-demangle.c cplus-dem+%DIKED.c -BINDIR= /usr/libexec/${OBJFORMAT} NOMAN= 1 CFLAGS+= -DMAIN -DIN_GCC -DVERSION=\"$(version)\" diff --git a/gnu/usr.bin/cc/cc_int/Makefile b/gnu/usr.bin/cc/cc_int/Makefile index 831b8761fd23..ef892e7adcd1 100644 --- a/gnu/usr.bin/cc/cc_int/Makefile +++ b/gnu/usr.bin/cc/cc_int/Makefile @@ -71,11 +71,7 @@ CFLAGS+= -DTARGET_NAME=\"${target}\" -DIN_GCC CFLAGS+= -DTARGET_CPU_DEFAULT=${TARGET_CPU_DEFAULT} .endif -.if ${OBJFORMAT} == aout -UNDERSCORES= 1 -.else UNDERSCORES= 0 -.endif SRCS+= underscore.c CLEANFILES+= underscore.c underscore.c: Makefile diff --git a/gnu/usr.bin/gzip/Makefile b/gnu/usr.bin/gzip/Makefile index 4088b2c2fd78..ecea234c0a37 100644 --- a/gnu/usr.bin/gzip/Makefile +++ b/gnu/usr.bin/gzip/Makefile @@ -31,7 +31,7 @@ MLINKS+= zgrep.1 zfgrep.1 zgrep.1 zegrep.1 .endif match.o: ${.CURDIR}/match.S - $(CC) -E -traditional ${.CURDIR}/match.S >_match.s + $(CC) -E -DNO_UNDERLINE -traditional ${.CURDIR}/match.S >_match.s $(CC) -c _match.s mv -f _match.o match.o rm -f _match.s diff --git a/gnu/usr.bin/gzip/match.S b/gnu/usr.bin/gzip/match.S index 2eb114f9d22b..f283f862e214 100644 --- a/gnu/usr.bin/gzip/match.S +++ b/gnu/usr.bin/gzip/match.S @@ -14,7 +14,7 @@ /* Preprocess with -DNO_UNDERLINE if your C compiler does not prefix * external symbols with an underline character '_'. */ -#ifdef __ELF__ /* NO_UNDERLINE */ +#ifdef NO_UNDERLINE # define _prev prev # define _window window # define _match_start match_start diff --git a/include/link.h b/include/link.h index 6282db9f9092..f95bbe8872a4 100644 --- a/include/link.h +++ b/include/link.h @@ -30,8 +30,4 @@ * $FreeBSD$ */ -#if (defined(FREEBSD_ELF) || defined(__ELF__)) && !defined(FREEBSD_AOUT) #include -#else -#include -#endif diff --git a/lib/Makefile b/lib/Makefile index b9fae5c44657..922b66cc99a2 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -32,8 +32,8 @@ SUBDIR= ${_csu} libcom_err libcrypt libkvm msun libmd \ libstand ${_libtelnet} libufs libugidfw libusbhid ${_libvgl} \ libwrap libxpg4 liby libz -.if exists(${.CURDIR}/csu/${MACHINE_ARCH}-${OBJFORMAT}) -_csu=csu/${MACHINE_ARCH}-${OBJFORMAT} +.if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf) +_csu=csu/${MACHINE_ARCH}-elf .elif exists(${.CURDIR}/csu/${MACHINE_ARCH}/Makefile) _csu=csu/${MACHINE_ARCH} .else diff --git a/lib/libc/amd64/SYS.h b/lib/libc/amd64/SYS.h index 5a636f8b33b9..1483f9d8e763 100644 --- a/lib/libc/amd64/SYS.h +++ b/lib/libc/amd64/SYS.h @@ -58,8 +58,4 @@ /* gas messes up offset -- although we don't currently need it, do for BCS */ #define LCALL(x,y) .byte 0x9a ; .long y; .word x -#ifdef __ELF__ -#define KERNCALL int $0x80 /* Faster */ -#else -#define KERNCALL LCALL(7,0) /* The old way */ -#endif +#define KERNCALL int $0x80 diff --git a/lib/libc/gen/dlfcn.c b/lib/libc/gen/dlfcn.c index 4a3500d4aa65..ff1d9006c860 100644 --- a/lib/libc/gen/dlfcn.c +++ b/lib/libc/gen/dlfcn.c @@ -28,12 +28,8 @@ __FBSDID("$FreeBSD$"); /* - * Linkage to services provided by the dynamic linker. These are - * implemented differently in ELF and a.out, because the dynamic - * linkers have different interfaces. + * Linkage to services provided by the dynamic linker. */ -#ifdef __ELF__ - #include #include @@ -107,76 +103,3 @@ dlsym(void * __restrict handle, const char * __restrict name) _rtld_error(sorry); return NULL; } - -#else /* a.out format */ - -#include -#include /* XXX - Required by link.h */ -#include -#include -#include - -/* - * For a.out, entry to the dynamic linker is via these trampolines. - * They enter the dynamic linker through the ld_entry struct that was - * passed back from the dynamic linker at startup time. - */ - -/* GCC is needed because we use its __builtin_return_address construct. */ - -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif - -/* - * These variables are set by code in crt0.o. For compatibility with - * old executables, they must be common, not extern. - */ -struct ld_entry *__ldso_entry; /* Entry points to dynamic linker */ -int __ldso_version; /* Dynamic linker version number */ - -int -dladdr(const void *addr, Dl_info *dlip) -{ - if (__ldso_entry == NULL || __ldso_version < LDSO_VERSION_HAS_DLADDR) - return 0; - return (__ldso_entry->dladdr)(addr, dlip); -} - -int -dlclose(void *handle) -{ - if (__ldso_entry == NULL) - return -1; - return (__ldso_entry->dlclose)(handle); -} - -const char * -dlerror(void) -{ - if (__ldso_entry == NULL) - return "Service unavailable"; - return (__ldso_entry->dlerror)(); -} - -void * -dlopen(const char *name, int mode) -{ - if (__ldso_entry == NULL) - return NULL; - return (__ldso_entry->dlopen)(name, mode); -} - -void * -dlsym(void * __restrict handle, const char * __restrict name) -{ - if (__ldso_entry == NULL) - return NULL; - if (__ldso_version >= LDSO_VERSION_HAS_DLSYM3) { - void *retaddr = __builtin_return_address(0); /* __GNUC__ only */ - return (__ldso_entry->dlsym3)(handle, name, retaddr); - } else - return (__ldso_entry->dlsym)(handle, name); -} - -#endif /* __ELF__ */ diff --git a/lib/libc/gen/getobjformat.c b/lib/libc/gen/getobjformat.c index de5c9c161f99..7428f36b884b 100644 --- a/lib/libc/gen/getobjformat.c +++ b/lib/libc/gen/getobjformat.c @@ -33,88 +33,12 @@ __FBSDID("$FreeBSD$"); #include #include -#define PATH_OBJFORMAT "/etc/objformat" - -static int copyformat(char *, const char *, size_t); - -static const char *known_formats[] = { OBJFORMAT_NAMES, NULL }; - -static int -copyformat(char *buf, const char *fmt, size_t bufsize) -{ - size_t len; - - len = strlen(fmt); - if (len > bufsize - 1) - return -1; - strcpy(buf, fmt); - return len; -} - int getobjformat(char *buf, size_t bufsize, int *argcp, char **argv) { - const char *fmt; - char **src, **dst; - const char *env; - FILE *fp; - fmt = NULL; - - if (argv != NULL) { - /* - * Scan for arguments setting known formats, e.g., "-elf". - * If "argcp" is non-NULL, delete these arguments from the - * list and update the argument count in "*argcp". - */ - for (dst = src = argv; *src != NULL; src++) { - if ((*src)[0] == '-') { - const char **p; - - for (p = known_formats; *p != NULL; p++) - if (strcmp(*src + 1, *p) == 0) - break; - if (*p != NULL) { - fmt = *p; - if (argcp == NULL) /* Don't delete */ - *dst++ = *src; - } else - *dst++ = *src; - } else - *dst++ = *src; - } - *dst = NULL; - if (argcp != NULL) - *argcp -= src - dst; - if (fmt != NULL) - return copyformat(buf, fmt, bufsize); - } - - /* Check the OBJFORMAT environment variable. */ - if ((env = getenv("OBJFORMAT")) != NULL) - return copyformat(buf, env, bufsize); - - /* Take a look at "/etc/objformat". */ - if ((fp = fopen(PATH_OBJFORMAT, "r")) != NULL) { - char line[1024]; - int found; - int len; - - found = len = 0; - while (fgets(line, sizeof line, fp) != NULL) { - if (strncmp(line, "OBJFORMAT=", 10) == 0) { - char *p = &line[10]; - - p[strcspn(p, " \t\n")] = '\0'; - len = copyformat(buf, p, bufsize); - found = 1; - } - } - fclose(fp); - if (found) - return len; - } - - /* As a last resort, use the compiled in default. */ - return copyformat(buf, OBJFORMAT_DEFAULT, bufsize); + if (bufsize < 4) + return -1; + strcpy(buf, "elf"); + return 3; } diff --git a/lib/libc/gmon/gmon.c b/lib/libc/gmon/gmon.c index 34dc9360a766..95302202da5e 100644 --- a/lib/libc/gmon/gmon.c +++ b/lib/libc/gmon/gmon.c @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" -#if defined(__ELF__) && (defined(__i386__) || defined(__sparc64__)) +#if defined(__i386__) || defined(__sparc64__) extern char *minbrk asm (".minbrk"); #else extern char *minbrk asm ("minbrk"); diff --git a/lib/libc/i386/SYS.h b/lib/libc/i386/SYS.h index 5a636f8b33b9..1483f9d8e763 100644 --- a/lib/libc/i386/SYS.h +++ b/lib/libc/i386/SYS.h @@ -58,8 +58,4 @@ /* gas messes up offset -- although we don't currently need it, do for BCS */ #define LCALL(x,y) .byte 0x9a ; .long y; .word x -#ifdef __ELF__ -#define KERNCALL int $0x80 /* Faster */ -#else -#define KERNCALL LCALL(7,0) /* The old way */ -#endif +#define KERNCALL int $0x80 diff --git a/lib/libmd/Makefile b/lib/libmd/Makefile index 7256d6deb559..eec6b3bf1a27 100644 --- a/lib/libmd/Makefile +++ b/lib/libmd/Makefile @@ -32,7 +32,6 @@ CLEANFILES+= md[245]hl.c md[245].ref md[245].3 mddriver \ CFLAGS+= -I${.CURDIR} .PATH: ${.CURDIR}/${MACHINE_ARCH} -.if ${OBJFORMAT} == "elf" .if exists(${MACHINE_ARCH}/sha.S) SRCS+= sha.S CFLAGS+= -DSHA1_ASM -DELF @@ -41,7 +40,6 @@ CFLAGS+= -DSHA1_ASM -DELF SRCS+= rmd160.S CFLAGS+= -DRMD160_ASM -DELF .endif -.endif md2hl.c: mdXhl.c (echo '#define LENGTH 16'; \ diff --git a/lib/libncurses/Makefile b/lib/libncurses/Makefile index f024b9168bf3..f7d46edece7f 100644 --- a/lib/libncurses/Makefile +++ b/lib/libncurses/Makefile @@ -233,18 +233,6 @@ SYMLINKS+=libncurses.a ${LIBDIR}/libtermlib.a SYMLINKS+=libncurses.a ${LIBDIR}/libmytinfo.a SYMLINKS+=libncurses.a ${LIBDIR}/libtinfo.a .if !defined(NOPIC) -.if ${OBJFORMAT} == aout -SYMLINKS+=libncurses.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ - libcurses.so.${SHLIB_MAJOR}.${SHLIB_MINOR} -SYMLINKS+=libncurses.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ - libtermcap.so.${SHLIB_MAJOR}.${SHLIB_MINOR} -SYMLINKS+=libncurses.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ - libtermlib.so.${SHLIB_MAJOR}.${SHLIB_MINOR} -SYMLINKS+=libncurses.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ - libmytinfo.so.${SHLIB_MAJOR}.${SHLIB_MINOR} -SYMLINKS+=libncurses.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ - libtinfo.so.${SHLIB_MAJOR}.${SHLIB_MINOR} -.else # no need for major at all, it's an ld-time redirection only SYMLINKS+=libncurses.so ${SHLIBDIR}/libcurses.so SYMLINKS+=libncurses.so ${SHLIBDIR}/libtermcap.so @@ -252,7 +240,6 @@ SYMLINKS+=libncurses.so ${SHLIBDIR}/libtermlib.so SYMLINKS+=libncurses.so ${SHLIBDIR}/libmytinfo.so SYMLINKS+=libncurses.so ${SHLIBDIR}/libtinfo.so .endif -.endif .if !defined(NOPROFILE) SYMLINKS+=libncurses_p.a ${LIBDIR}/libcurses_p.a SYMLINKS+=libncurses_p.a ${LIBDIR}/libtermcap_p.a diff --git a/lib/libpam/libpam/Makefile b/lib/libpam/libpam/Makefile index 7326a90716f7..76d83185e9a8 100644 --- a/lib/libpam/libpam/Makefile +++ b/lib/libpam/libpam/Makefile @@ -153,11 +153,7 @@ CLEANFILES += openpam_static.o CLEANFILES+= openpam_static_modules.o openpam_static_modules.o: openpam_static.o ${STATIC_MODULES} -.if ${OBJFORMAT} == elf ${LD} -o ${.TARGET} -r --whole-archive ${.ALLSRC} -.else - ${LD} -o ${.TARGET} -r -Bforcearchive ${.ALLSRC} -.endif # Headers INCS= ${HEADERS} ${ADD_HEADERS} diff --git a/lib/liby/Makefile b/lib/liby/Makefile index e66ea5de6051..9aa41548de20 100644 --- a/lib/liby/Makefile +++ b/lib/liby/Makefile @@ -6,31 +6,6 @@ SHLIB_MINOR= 0 SRCS= main.c yyerror.c -.if ${OBJFORMAT} != aout NOPIC= true -.endif - -# -# Before complaining about this, please *double-check* that you have -# updated the ldconfig path in /etc/rc to include /usr/lib/compat that -# was added in src/etc/rc rev 1.98. -# This is so that `ld' will not continue to generate binaries linked -# shared against liby, so that in a future release we can move this -# off to a compat dist (like compat22). -# -beforeinstall: - -rm -f ${DESTDIR}/usr/lib/compat/lib${LIB}.so \ - ${DESTDIR}${ORIG_SHLIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ - ${DESTDIR}/usr/lib/compat/lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ - ${DESTDIR}/usr/lib/compat/lib${LIB}.so.${SHLIB_MAJOR} .include - -# This must follow the .include in case SHLIBDIR is defined there. -ORIG_SHLIBDIR:= ${SHLIBDIR} - -.if ${OBJFORMAT} == aout -# The ldconfig line in/etc/rc doesn't depend on ${LIBDIR} or ${SHLIBDIR}, -# so neither does this. -SHLIBDIR= /usr/lib/compat/aout -.endif diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile index f024b9168bf3..f7d46edece7f 100644 --- a/lib/ncurses/ncurses/Makefile +++ b/lib/ncurses/ncurses/Makefile @@ -233,18 +233,6 @@ SYMLINKS+=libncurses.a ${LIBDIR}/libtermlib.a SYMLINKS+=libncurses.a ${LIBDIR}/libmytinfo.a SYMLINKS+=libncurses.a ${LIBDIR}/libtinfo.a .if !defined(NOPIC) -.if ${OBJFORMAT} == aout -SYMLINKS+=libncurses.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ - libcurses.so.${SHLIB_MAJOR}.${SHLIB_MINOR} -SYMLINKS+=libncurses.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ - libtermcap.so.${SHLIB_MAJOR}.${SHLIB_MINOR} -SYMLINKS+=libncurses.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ - libtermlib.so.${SHLIB_MAJOR}.${SHLIB_MINOR} -SYMLINKS+=libncurses.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ - libmytinfo.so.${SHLIB_MAJOR}.${SHLIB_MINOR} -SYMLINKS+=libncurses.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ - libtinfo.so.${SHLIB_MAJOR}.${SHLIB_MINOR} -.else # no need for major at all, it's an ld-time redirection only SYMLINKS+=libncurses.so ${SHLIBDIR}/libcurses.so SYMLINKS+=libncurses.so ${SHLIBDIR}/libtermcap.so @@ -252,7 +240,6 @@ SYMLINKS+=libncurses.so ${SHLIBDIR}/libtermlib.so SYMLINKS+=libncurses.so ${SHLIBDIR}/libmytinfo.so SYMLINKS+=libncurses.so ${SHLIBDIR}/libtinfo.so .endif -.endif .if !defined(NOPROFILE) SYMLINKS+=libncurses_p.a ${LIBDIR}/libcurses_p.a SYMLINKS+=libncurses_p.a ${LIBDIR}/libtermcap_p.a diff --git a/libexec/Makefile b/libexec/Makefile index a9ede3e0f1c2..75c768bd9b34 100644 --- a/libexec/Makefile +++ b/libexec/Makefile @@ -23,6 +23,7 @@ SUBDIR= atrun \ rpc.rwalld \ rpc.sprayd \ rshd \ + rtld-elf \ save-entropy \ talkd \ tcpd \ @@ -38,13 +39,6 @@ SUBDIR+=named-xfer SUBDIR+=mail.local smrsh .endif -.if ${OBJFORMAT} == aout -SUBDIR+=rtld-aout -.endif - -.if ${OBJFORMAT} == elf -SUBDIR+=rtld-elf -.endif .if defined(RELEASEDIR) || \ (!exists(${.CURDIR}/../secure) && !exists(${.CURDIR}/../kerberosIV)) || \ diff --git a/libexec/rtld-aout/shlib.c b/libexec/rtld-aout/shlib.c index 989cf45d8ab1..9fd2c66d5bf8 100644 --- a/libexec/rtld-aout/shlib.c +++ b/libexec/rtld-aout/shlib.c @@ -44,7 +44,7 @@ #include #include -#include +#include #include "shlib.h" #include "support.h" diff --git a/release/Makefile b/release/Makefile index d345cb329976..04125d54ce5e 100644 --- a/release/Makefile +++ b/release/Makefile @@ -70,9 +70,6 @@ RELEASESRCMODULE?= src RELEASEDOCMODULE?= doc RELEASEPORTSMODULE?= ports -# Unless set elsewhere, indicate the object format we'll be using. -OBJFORMAT?= elf - # Uncomment this to disable the doc.1 target. Docs normally require # the ports tree, so NOPORTS can be set together with NODOC in order # to have neither ports or docs. If only NOPORTS is set to YES, but @@ -347,7 +344,6 @@ rerelease release: ( cd ${CHROOTDIR}/usr/src/sys/conf && \ mv newvers.sh foo && \ sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh && rm foo ) - echo OBJFORMAT=${OBJFORMAT} > ${CHROOTDIR}/etc/objformat -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release echo "#!/bin/sh" > ${CHROOTDIR}/mk echo "set -ex" >> ${CHROOTDIR}/mk @@ -357,7 +353,7 @@ rerelease release: CD_EXTRA_BITS DISTRIBUTIONS DOMINIMALDOCPORTS \ EXTRA_SRC FIXCRYPTO KERNELS KERNEL_FLAGS \ MAKE_ISOS NODOC NOKERBEROS NOPORTS NOSHARED \ - NOSRC NO_SENDMAIL OBJFORMAT RELEASETAG \ + NOSRC NO_SENDMAIL RELEASETAG \ RELNOTES_LANG TARGET TARGET_ARCH WORLD_FLAGS .if defined(${var}) echo "export ${var}=\"${${var}}\"" >> ${CHROOTDIR}/mk @@ -487,7 +483,7 @@ release.6: @for i in ${DISTRIBUTIONS}; do \ if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \ echo -n "Running $$i dist creation script... "; \ - env OBJFORMAT=${OBJFORMAT} RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \ + env RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \ echo "Done."; \ fi \ done \ diff --git a/sbin/ldconfig/ldconfig.c b/sbin/ldconfig/ldconfig.c index eab4797f164c..284ec0bc7f52 100644 --- a/sbin/ldconfig/ldconfig.c +++ b/sbin/ldconfig/ldconfig.c @@ -44,7 +44,7 @@ static const char rcsid[] = #include #include #include -#include +#include #include #include #include @@ -102,17 +102,18 @@ char *argv[]; { int i, c; int rval = 0; - char objformat[32]; int is_aout; - if (getobjformat(objformat, sizeof objformat, &argc, argv) == -1) - errx(1, "getobjformat failed: name too long"); - if (strcmp(objformat, "aout") == 0) + is_aout = 0; + if (argc > 1 && strcmp(argv[1], "-aout") == 0) { is_aout = 1; - else if (strcmp(objformat, "elf") == 0) - is_aout = 0; - else - errx(1, "unknown object format \"%s\"", objformat); + argc--; + argv++; + } else if (argc > 1 && strcmp(argv[1], "-elf") == 0) { + /* skip over legacy -elf arg */ + argc--; + argv++; + } hints_file = is_aout ? _PATH_LD_HINTS : _PATH_ELF_HINTS; if (argc == 1) diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk index bf996d52fafd..fc6ed716f09e 100644 --- a/share/mk/bsd.dep.mk +++ b/share/mk/bsd.dep.mk @@ -153,7 +153,6 @@ cleandepend: .if !target(checkdpadd) && (defined(DPADD) || defined(LDADD)) checkdpadd: -.if ${OBJFORMAT} != aout @ldadd=`echo \`for lib in ${DPADD} ; do \ echo $$lib | sed 's;^/usr/lib/lib\(.*\)\.a;-l\1;' ; \ done \`` ; \ @@ -163,12 +162,4 @@ checkdpadd: echo "DPADD -> $$ldadd" ; \ echo "LDADD -> $$ldadd1" ; \ fi -.else - @dpadd=`echo \`ld -Bstatic -f ${LDADD}\`` ; \ - if [ "$$dpadd" != "${DPADD}" ] ; then \ - echo ${.CURDIR} ; \ - echo "LDADD -> $$dpadd" ; \ - echo "DPADD = ${DPADD}" ; \ - fi -.endif .endif diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 6ff36d92fcf8..1e701652974c 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -12,7 +12,6 @@ .undef SHLIB_NAME .undef INSTALL_PIC_ARCHIVE .else -.if ${OBJFORMAT} == elf .if !defined(SHLIB_NAME) && defined(LIB) && defined(SHLIB_MAJOR) SHLIB_NAME= lib${LIB}.so.${SHLIB_MAJOR} .endif @@ -20,11 +19,6 @@ SHLIB_NAME= lib${LIB}.so.${SHLIB_MAJOR} SHLIB_LINK?= ${SHLIB_NAME:R} .endif SONAME?= ${SHLIB_NAME} -.else -.if defined(SHLIB_MAJOR) && defined(SHLIB_MINOR) -SHLIB_NAME?= lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} -.endif -.endif .endif .if defined(DEBUG_FLAGS) @@ -35,9 +29,7 @@ CFLAGS+= ${DEBUG_FLAGS} STRIP?= -s .endif -.if ${OBJFORMAT} != aout || make(checkdpadd) || defined(NEED_LIBNAMES) .include -.endif # prefer .s to a .c, add .po, remove stuff not used in the BSD libraries # .So used for PIC object files @@ -197,16 +189,10 @@ ${SHLIB_NAME}: ${SOBJS} .if defined(SHLIB_LINK) @ln -fs ${.TARGET} ${SHLIB_LINK} .endif -.if ${OBJFORMAT} == aout - @${CC} -shared -Wl,-x,-assert,pure-text \ - -o ${.TARGET} \ - `lorder ${SOBJS} | tsort -q` ${LDADD} -.else @${CC} ${LDFLAGS} -shared -Wl,-x \ -o ${.TARGET} -Wl,-soname,${SONAME} \ `lorder ${SOBJS} | tsort -q` ${LDADD} .endif -.endif .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) _LIBS+= lib${LIB}_pic.a @@ -243,16 +229,10 @@ _EXTRADEPEND: > $$TMP; \ mv $$TMP ${DEPENDFILE} .if !defined(NOEXTRADEPEND) && defined(SHLIB_NAME) -.if ${OBJFORMAT} == aout - echo ${SHLIB_NAME}: \ - `${CC} -shared -Wl,-f ${LDADD}` \ - >> ${DEPENDFILE} -.else .if defined(DPADD) && !empty(DPADD) echo ${SHLIB_NAME}: ${DPADD} >> ${DEPENDFILE} .endif .endif -.endif .if !target(install) diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index bab9a517cab2..7793cd538f0f 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -21,9 +21,6 @@ # own install script so that the entire system can be made # stripped/not-stripped using a single knob. [-s] # -# OBJFORMAT Default object format that selects which set of tools to run. -# [elf] -# # BINOWN Binary owner. [root] # # BINGRP Binary group. [wheel] @@ -123,11 +120,7 @@ KMODOWN?= ${BINOWN} KMODGRP?= ${BINGRP} KMODMODE?= ${BINMODE} -.if ${OBJFORMAT} == aout -LIBDIR?= /usr/lib/aout -.else LIBDIR?= /usr/lib -.endif LIBCOMPATDIR?= /usr/lib/compat LIBDATADIR?= /usr/libdata LINTLIBDIR?= /usr/libdata/lint diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 5cfc87775a65..15f9e37625bf 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -82,16 +82,11 @@ CLEANFILES+= ${PROG} ${OBJS} .if defined(PROG) _EXTRADEPEND: -.if ${OBJFORMAT} == aout - echo ${PROG}: `${CC} -Wl,-f ${CFLAGS} ${LDFLAGS} \ - ${LDADD:S/^/-Wl,/}` >> ${DEPENDFILE} -.else echo ${PROG}: ${LIBC} ${DPADD} >> ${DEPENDFILE} .if defined(PROG_CXX) echo ${PROG}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE} .endif .endif -.endif .if !target(install) @@ -186,9 +181,7 @@ tags: ${SRCS} .include .endif -.if ${OBJFORMAT} != aout || make(checkdpadd) || defined(NEED_LIBNAMES) .include -.endif .include diff --git a/share/mk/sys.mk b/share/mk/sys.mk index dcd42083dcb9..c24a34efd50e 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -259,14 +259,6 @@ __MAKE_CONF?=/etc/make.conf .include .endif -# -# The build tools are indirected by /usr/bin/objformat which determines the -# object format from the OBJFORMAT environment variable and if this is not -# defined, it reads /etc/objformat. -# -.if exists(/etc/objformat) && !defined(OBJFORMAT) -.include "/etc/objformat" -.endif - # Default executable format +# XXX hint for bsd.port.mk OBJFORMAT?= elf diff --git a/sys/alpha/include/asm.h b/sys/alpha/include/asm.h index d4129aba050b..84601f3f509c 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 444b8b79817c..5a286f43df0b 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 94a3a103ac03..5d5b39ed5fd9 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 94a3a103ac03..5d5b39ed5fd9 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 cf5f767b33bd..685b583efe83 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 a6ab20c17fd7..b166a1a61bb3 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 0c0744416974..043d2ba9ee90 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 1fd9b604a05f..eb3ae342a6c3 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 9de7dcf46414..434691e798ae 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 1d03cfdf5bd8..c2a33a60b9d8 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 0d6188982729..bd69850cb0e1 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 737d5ec97fc7..0eba8f91616d 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 18ca69f7b75c..9e8e8136933c 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 607b68644899..9ed9114c1866 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 ac26a20409ed..cfb479fd2d84 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 1441a4b4a01c..000000000000 --- 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 86b8ccd1d1a4..79ea8a666b1a 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 ff43c77b3f2e..550fa526d946 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 3986eca07906..5ccffee5345d 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 ed77dba881c2..50add6321ab5 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 e7988247a0ef..6ba21a37c337 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 de14daade2a1..3b8408d80b12 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 35964cee3aa2..f88004bf588a 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 0c2998bd1ef4..22f0cb4d8dfc 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 ec3b588d0cf3..caa127b03c31 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 0c5aeb4ab2f2..52f833da04be 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 693de333e58a..2a58b292bc8e 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 c27762c5162c..709ac346dc2c 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 59600a66e4d3..3af198adb5e9 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 94a3a103ac03..5d5b39ed5fd9 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 cf5f767b33bd..685b583efe83 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 bdc1057f5e9f..cf9cfe40d87c 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 0c0744416974..043d2ba9ee90 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 80488681ae68..75c708ad2345 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 2eb825464888..f0a1ec2ff004 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 1d6fcb8795f9..1813d339c672 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 fb1e73d4fe44..998000551076 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,19 +174,16 @@ 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; char *modname; #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 fb1e73d4fe44..998000551076 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,19 +174,16 @@ 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; char *modname; #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 aac495b2da42..19adc98c9ab9 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 f652cd4882d3..2d21f9e31bad 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 52580b41ace2..4f311c07b634 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 7969e4fb6721..a0ae3db35d57 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 953267144b04..8b7cb39d8744 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 7bba1d383600..2d584f885c67 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 7f6438ba8f9c..ee60ffd4b1e2 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. * diff --git a/tools/tools/kernxref/kernxref.sh b/tools/tools/kernxref/kernxref.sh index 21acbf4a1586..1c0581a299b2 100644 --- a/tools/tools/kernxref/kernxref.sh +++ b/tools/tools/kernxref/kernxref.sh @@ -25,15 +25,10 @@ if [ ! -d ${COMPILEDIR}/${KERNELNAME} ]; then fi cd ${COMPILEDIR}/${KERNELNAME} -if file vers.o | grep -q ELF; then - OBJFORMAT=elf; -else - OBJFORMAT=aout; -fi MOD_OBJS=`find modules -name \*.ko` -OBJFORMAT=${OBJFORMAT} nm -gon `echo *.o $MOD_OBJS \ +nm -gon `echo *.o $MOD_OBJS \ | tr ' ' '\012' \ | egrep -v '(aicasm|genassym)'` \ | tr : ' ' | awk ' diff --git a/usr.bin/Makefile b/usr.bin/Makefile index 644d0b075505..3947fb7a79d1 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -227,17 +227,11 @@ SUBDIR+=vacation .if ${MACHINE_ARCH} == "i386" # Things that don't compile on alpha or are aout specific: -SUBDIR+=ar \ - doscmd \ +SUBDIR+=doscmd \ ncplist \ ncplogin \ - nm \ - ranlib \ sasc \ - size \ - smbutil \ - strings \ - strip + smbutil .endif .if ${MACHINE_ARCH} == "alpha" diff --git a/usr.bin/doscmd/Makefile b/usr.bin/doscmd/Makefile index 5a46a8317c82..4f5591d8d07f 100644 --- a/usr.bin/doscmd/Makefile +++ b/usr.bin/doscmd/Makefile @@ -14,14 +14,7 @@ FONTHDRS= font8x8.h font8x14.h font8x16.h CLEANFILES= ${FONTFILES} ${FONTHDRS} emsdriv.sys redir.com XINCDIR= ${DESTDIR}${X11BASE}/include -.if ${OBJFORMAT} == "aout" -CLEANFILES+= doscmd.kernel crt0.o doscmd_loader.o -XLIBDIR= ${DESTDIR}${X11BASE}/lib/aout -LDADD= -L${DESTDIR}${LIBDIR} -lgcc -lc -DPADD= ${LIBGCC} ${LIBC} -.else XLIBDIR= ${DESTDIR}${X11BASE}/lib -.endif EXEGRP:= ${BINGRP} EXEMODE= ${NOBINMODE} @@ -37,10 +30,6 @@ CFLAGS+= -DNO_X .endif beforeinstall: -.if ${OBJFORMAT} == "aout" - ${INSTALL} -o ${BINOWN} -g ${EXEGRP} -m ${EXEMODE} \ - doscmd.kernel ${DESTDIR}/usr/libexec/ -.endif ${INSTALL} -o ${BINOWN} -g ${EXEGRP} -m ${EXEMODE} \ emsdriv.sys redir.com ${DESTDIR}/usr/libdata/doscmd/ ${INSTALL} -o ${BINOWN} -g ${EXEGRP} -m ${SHAREMODE} \ @@ -49,19 +38,7 @@ beforeinstall: ${INSTALL} -o ${BINOWN} -g ${EXEGRP} -m ${SHAREMODE} \ fonts.dir ${DESTDIR}/usr/libdata/doscmd/fonts -.if ${OBJFORMAT} == "aout" -doscmd: ${LIBCRT0} doscmd_loader.o ${LIBGCC} ${LIBC} - ${CC} ${CFLAGS} ${LDFLAGS} -nostdlib -Wl,-e,start,-dc,-dp \ - -o doscmd ${LIBCRT0} doscmd_loader.o -lgcc -lc - -# Bogusly generated dependency to get doscmd_loader.c looked at by mkdep. -.depend: doscmd_loader.c - -# Bogus dependencies to get more than one binary created by `make all'. -doscmd: ${FONTFILES} ${FONTHDRS} doscmd.kernel emsdriv.sys redir.com -.else doscmd: ${FONTFILES} ${FONTHDRS} emsdriv.sys redir.com -.endif cp437-8x8.pcf.gz: cp437-8x8.pcf.gz.uu uudecode ${.CURDIR}/cp437-8x8.pcf.gz.uu @@ -96,11 +73,3 @@ redir.com: redir.com.uu NEED_LIBNAMES= yes .include - -.if ${OBJFORMAT} == "aout" -# This must be after bsd.prog.mk is included so that ${OBJS} in the -# dependency gets expanded. -doscmd.kernel: crt0.o ${OBJS} ${DPADD} - ${CC} ${CFLAGS} ${LDFLAGS} -static -nostdlib -Wl,-N,-T,110000 \ - -o doscmd.kernel crt0.o ${OBJS} ${LDADD} -.endif diff --git a/usr.bin/ldd/sods.c b/usr.bin/ldd/sods.c index ab8affafea77..195651e27060 100644 --- a/usr.bin/ldd/sods.c +++ b/usr.bin/ldd/sods.c @@ -34,14 +34,12 @@ __FBSDID("$FreeBSD$"); #include -#define FREEBSD_AOUT - #include #include #include #include #include -#include +#include #include #include #include diff --git a/usr.bin/objformat/Makefile b/usr.bin/objformat/Makefile index 9c47abeef1ec..714cb48240c7 100644 --- a/usr.bin/objformat/Makefile +++ b/usr.bin/objformat/Makefile @@ -1,21 +1,5 @@ # $FreeBSD$ PROG= objformat -NOSHARED?= YES - -LINKS+= ${BINDIR}/objformat ${BINDIR}/addr2line -LINKS+= ${BINDIR}/objformat ${BINDIR}/ar -LINKS+= ${BINDIR}/objformat ${BINDIR}/as -LINKS+= ${BINDIR}/objformat ${BINDIR}/c++filt -LINKS+= ${BINDIR}/objformat ${BINDIR}/gasp -LINKS+= ${BINDIR}/objformat ${BINDIR}/gdb -LINKS+= ${BINDIR}/objformat ${BINDIR}/ld -LINKS+= ${BINDIR}/objformat ${BINDIR}/nm -LINKS+= ${BINDIR}/objformat ${BINDIR}/objcopy -LINKS+= ${BINDIR}/objformat ${BINDIR}/objdump -LINKS+= ${BINDIR}/objformat ${BINDIR}/ranlib -LINKS+= ${BINDIR}/objformat ${BINDIR}/size -LINKS+= ${BINDIR}/objformat ${BINDIR}/strings -LINKS+= ${BINDIR}/objformat ${BINDIR}/strip .include diff --git a/usr.bin/objformat/objformat.1 b/usr.bin/objformat/objformat.1 index c5575b481d43..84ac346fc21b 100644 --- a/usr.bin/objformat/objformat.1 +++ b/usr.bin/objformat/objformat.1 @@ -30,62 +30,26 @@ .Dt OBJFORMAT 1 .Sh NAME .Nm objformat -.Nd reports default binary format and program deflector +.Nd reports default binary format .Sh SYNOPSIS .Nm -.Nm prog .Sh DESCRIPTION -If run as -.Nm -the default object file format is reported. The two different object file -formats are -.Ar aout -and +This program os obsolete and is now just a compatability stub. +It reports the object file format as .Ar elf . -.Pp -If invoked by any other name, -.Nm prog -is expanded to -.Pa /usr/libexec//prog -and executed. -.Sh DIAGNOSTICS -The -.Nm -utility returns with exit code 1 -if called with an improper number of arguments, or if -.Nm prog -could not be executed. -.Sh ENVIRONMENT -.Bl -tag -width OBJFORMAT_PATH -.It Ev OBJFORMAT -If the environment variable -.Ev OBJFORMAT -is set, it overrides the default object file format. -.Ev OBJFORMAT takes precedence over -.Pa /etc/objformat . -.It Ev OBJFORMAT_PATH -If the environment variable -.Ev OBJFORMAT_PATH -is set, its value is used as the base path to -.Nm prog . -The default is -.Pa /usr/libexec . -.El -.Sh FILES -.Bl -tag -width /etc/objformat -compact -.It Pa /etc/objformat -If present, specifies the object file format to use. Syntax is -.Ql OBJFORMAT=xxx . -.El -.Sh SEE ALSO -.Xr file 1 , -.Xr getobjformat 3 -.\" .Sh STANDARDS .Sh HISTORY The .Nm command appeared in .Fx 3.0 . +.Pp +The +.Nm +program was deprecated in +.Fx 4.0 +and reduced to a compatability stub in +.Fx 5.0 . +It will be completely removed before the next release. .Sh AUTHORS .An -nosplit The @@ -94,4 +58,3 @@ utility was written by .An Peter Wemm Aq peter@netplex.com.au . This manual page was written by .An David O'Brien Aq obrien@NUXI.com . -.\" .Sh BUGS diff --git a/usr.bin/objformat/objformat.c b/usr.bin/objformat/objformat.c index 1b3e35d7f285..f2e9595ddba8 100644 --- a/usr.bin/objformat/objformat.c +++ b/usr.bin/objformat/objformat.c @@ -26,58 +26,13 @@ * $FreeBSD$ */ -#include -#include -#include -#include -#include #include +#include int main(int argc, char **argv) { - char objformat[32]; - char *path, *chunk; - char *cmd, *newcmd = NULL; - const char *objformat_path; - - if (getobjformat(objformat, sizeof objformat, &argc, argv) == -1) - errx(1, "Invalid object format"); - - cmd = strrchr(argv[0], '/'); - if (cmd != NULL) - cmd++; - else - cmd = argv[0]; - - if (strcmp(cmd, "objformat") == 0) { - if (argc != 1) { - fprintf(stderr, "usage: objformat\n"); - exit(1); - } - printf("%s\n", objformat); - exit(0); - } - - /* 'make world' glue */ - objformat_path = getenv("OBJFORMAT_PATH"); - if (objformat_path == NULL) - objformat_path = "/usr/libexec"; - path = strdup(objformat_path); - - setenv("OBJFORMAT", objformat, 1); - - while ((chunk = strsep(&path, ":")) != NULL) { - if (newcmd != NULL) { - free(newcmd); - newcmd = NULL; - } - asprintf(&newcmd, "%s/%s/%s", chunk, objformat, cmd); - if (newcmd == NULL) - err(1, "cannot allocate memory for new command"); - argv[0] = newcmd; - execv(newcmd, argv); - } - err(1, "could not exec %s/%s in %s", objformat, cmd, objformat_path); + write(1, "elf\n", 4); + return (0); } diff --git a/usr.bin/xlint/lint1/Makefile b/usr.bin/xlint/lint1/Makefile index 6371c9413017..709c04502534 100644 --- a/usr.bin/xlint/lint1/Makefile +++ b/usr.bin/xlint/lint1/Makefile @@ -13,11 +13,10 @@ CFLAGS+= -I. -I${.CURDIR} LINTFLAGS=-aehpz BINDIR= /usr/libexec -OBJFORMAT_PATH?= ${BINDIR} # src/Makefile.inc1 sets this .PATH: ${.CURDIR}/../common lint.7: makeman - sh ${.CURDIR}/makeman ${OBJFORMAT_PATH}/${PROG} -m >${.TARGET} + sh ${.CURDIR}/makeman ${BINDIR}/${PROG} -m >${.TARGET} .include diff --git a/usr.sbin/keyserv/Makefile b/usr.sbin/keyserv/Makefile index 170fa640422b..54075da67638 100644 --- a/usr.sbin/keyserv/Makefile +++ b/usr.sbin/keyserv/Makefile @@ -5,9 +5,6 @@ MAN= keyserv.8 SRCS= keyserv.c setkey.c crypt_svc.c crypt_server.c crypt.h CFLAGS+= -DKEYSERV_RANDOM -DBROKEN_DES -I. -.if $(OBJFORMAT) == elf -CFLAGS+= -DOBJFORMAT_ELF -.endif DPADD= ${LIBMP} ${LIBCRYPTO} ${LIBRPCSVC} LDADD= -lmp -lcrypto -lrpcsvc diff --git a/usr.sbin/keyserv/crypt_server.c b/usr.sbin/keyserv/crypt_server.c index edbdbc6f3029..45f6f6e9de78 100644 --- a/usr.sbin/keyserv/crypt_server.c +++ b/usr.sbin/keyserv/crypt_server.c @@ -171,11 +171,7 @@ static void *dlhandle; #endif #ifndef LIBCRYPTO -#ifdef OBJFORMAT_ELF #define LIBCRYPTO "libcrypto.so.2" -#else -#define LIBCRYPTO "libcrypto.so.2." -#endif /* OBJFORMAT_ELF */ #endif void load_des(warn, libpath) @@ -185,37 +181,12 @@ void load_des(warn, libpath) char dlpath[MAXPATHLEN]; if (libpath == NULL) { -#ifdef OBJFORMAT_ELF snprintf(dlpath, sizeof(dlpath), "%s/%s", _PATH_USRLIB, LIBCRYPTO); -#else - len = strlen(LIBCRYPTO); - if ((dird = opendir(_PATH_USRLIB)) == NULL) - err(1, "opendir(/usr/lib) failed"); - - while ((dirp = readdir(dird)) != NULL) { - /* must have a minor number */ - if (strlen(dirp->d_name) <= len) - continue; - if (!strncmp(dirp->d_name, LIBCRYPTO, len)) { - if (atoi((dirp->d_name + len + 1)) > minor) { - minor = atoi((dirp->d_name + len + 1)); - snprintf(dlpath,sizeof(dlpath),"%s/%s", - _PATH_USRLIB, dirp->d_name); - } - } - } - - closedir(dird); -#endif /* OBJFORMAT_ELF */ } else snprintf(dlpath, sizeof(dlpath), "%s", libpath); if (dlpath != NULL && (dlhandle = dlopen(dlpath, 0444)) != NULL) -#ifdef OBJFORMAT_ELF _my_crypt = (int (*)())dlsym(dlhandle, "_des_crypt"); -#else - _my_crypt = (int (*)())dlsym(dlhandle, "__des_crypt"); -#endif /* OBJFORMAT_ELF */ if (_my_crypt == NULL) { if (dlhandle != NULL) -- cgit v1.2.3