From ac79475654f82303a9a18d0c26671403c88c3d30 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Wed, 1 Jun 2005 18:07:10 +0000 Subject: [PATCH] Stop branding DragonFly binaries with the FreeBSD ABI. Increment __DragonFly_version to get this into programs, we can do sanity checks on it later. --- Makefile.inc1 | 4 +- gnu/usr.bin/binutils215/libbfd/Makefile.i386 | 26 ++-------- .../binutils215/libbfd/elf-fbsd-brand.c | 51 ------------------- lib/csu/common/crtbrand.c | 4 +- sys/sys/param.h | 4 +- 5 files changed, 9 insertions(+), 80 deletions(-) delete mode 100644 gnu/usr.bin/binutils215/libbfd/elf-fbsd-brand.c diff --git a/Makefile.inc1 b/Makefile.inc1 index a4918fa792..e98693265b 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1,6 +1,6 @@ # # $FreeBSD: src/Makefile.inc1,v 1.141.2.62 2003/04/06 19:54:00 dwmalone Exp $ -# $DragonFly: src/Makefile.inc1,v 1.68 2005/05/09 17:36:59 dillon Exp $ +# $DragonFly: src/Makefile.inc1,v 1.69 2005/06/01 18:07:09 joerg Exp $ # # Make command line options: # -DMAKE_KERBEROS5 to build Kerberos5 @@ -407,7 +407,7 @@ installcheck: @pw groupshow authpf || (echo "You may need to run 'make preupgrade' first"; exit 1) @pw groupshow _pflogd || (echo "You may need to run 'make preupgrade' first"; exit 1) @pw groupshow _ntp || (echo "You may need to run 'make preupgrade' first"; exit 1) - @case `uname -r` in 1.2.0|1.2.1|1.3-*) echo "You must upgrade your kernel to at least 1.2.2 or 1.3.1 and reboot before you can safely installworld, due to a TLS bug in fork" ; exit 1;; esac + @case `uname -r` in 1.2*|1.3.1-*) echo "You must upgrade your kernel to at least 1.3.2 and reboot before you can safely installworld, due to the unsupported ELF ABI tagging" ; exit 1;; esac # distributeworld # diff --git a/gnu/usr.bin/binutils215/libbfd/Makefile.i386 b/gnu/usr.bin/binutils215/libbfd/Makefile.i386 index 71355177f9..7b6cb697cd 100644 --- a/gnu/usr.bin/binutils215/libbfd/Makefile.i386 +++ b/gnu/usr.bin/binutils215/libbfd/Makefile.i386 @@ -1,9 +1,9 @@ -# $DragonFly: src/gnu/usr.bin/binutils215/libbfd/Attic/Makefile.i386,v 1.1 2004/12/20 13:14:45 asmodai Exp $ +# $DragonFly: src/gnu/usr.bin/binutils215/libbfd/Attic/Makefile.i386,v 1.2 2005/06/01 18:07:10 joerg Exp $ # see main Makefile SRCS+= cpu-i386.c -SRCS+= elf32-i386-fbsd.c elf32-target.h elf32.c elflink.c -SRCS+= elf64-amd64-fbsd.c elf64-target.h elf64-gen.c elf64.c +SRCS+= elf32-i386.c elf32-target.h elf32.c elflink.c +SRCS+= elf64-x86-64.c elf64-target.h elf64-gen.c elf64.c VECS+= bfd_elf32_i386_vec VECS+= bfd_elf64_x86_64_vec .if ${TARGET_ARCH} == "i386" @@ -26,23 +26,3 @@ CLEANFILES+= elf64-target.h elf64-target.h: elfxx-target.h sed -e s/NN/64/g ${.ALLSRC} > ${.TARGET} - -CLEANFILES+= elf64-amd64-fbsd.c - -# Make sure generated binaries are properly branded. This is kind of a -# hack but it's more dependable to override whatever binutils thought it -# was going to do then figure out whether binutils supports us natively. -# -elf32-i386-fbsd.c: ${.CURDIR}/elf-fbsd-brand.c ${SRCDIR}/bfd/elf32-i386.c - cat ${.ALLSRC:M*elf-fbsd-brand.c} > ${.TARGET}.new - echo "#define elf_backend_post_process_headers elf_fbsd_post_process_headers" \ - >> ${.TARGET}.new - cat ${.ALLSRC:M*elf32-i386.c} >> ${.TARGET}.new - mv -f ${.TARGET}.new ${.TARGET} - -elf64-amd64-fbsd.c: ${.CURDIR}/elf-fbsd-brand.c ${SRCDIR}/bfd/elf64-x86-64.c - cat ${.ALLSRC:M*elf-fbsd-brand.c} > ${.TARGET}.new - echo "#define elf_backend_post_process_headers elf_fbsd_post_process_headers" \ - >> ${.TARGET}.new - cat ${.ALLSRC:M*elf64-x86-64.c} >> ${.TARGET}.new - mv -f ${.TARGET}.new ${.TARGET} diff --git a/gnu/usr.bin/binutils215/libbfd/elf-fbsd-brand.c b/gnu/usr.bin/binutils215/libbfd/elf-fbsd-brand.c deleted file mode 100644 index 2ab5e63028..0000000000 --- a/gnu/usr.bin/binutils215/libbfd/elf-fbsd-brand.c +++ /dev/null @@ -1,51 +0,0 @@ -/*- - * Copyright (c) 2002, 2003 David E. O'Brien - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $DragonFly: src/gnu/usr.bin/binutils215/libbfd/Attic/elf-fbsd-brand.c,v 1.1 2004/12/20 13:14:45 asmodai Exp $ - */ - -#include "bfd.h" -#include "sysdep.h" -#include "elf-bfd.h" - -/* The kernel recognizes executables as valid only if they carry a - "FreeBSD" label in the ELF header. So we put this label on all - executables and (for simplicity) also all other object files. */ - -static void elf_fbsd_post_process_headers - PARAMS ((bfd *, struct bfd_link_info *)); - -static void -elf_fbsd_post_process_headers (abfd, link_info) - bfd * abfd; - struct bfd_link_info * link_info ATTRIBUTE_UNUSED; -{ - Elf_Internal_Ehdr * i_ehdrp; /* ELF file header, internal form. */ - - i_ehdrp = elf_elfheader (abfd); - - /* Put an ABI label supported by FreeBSD >= 4.1. */ - i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; -} diff --git a/lib/csu/common/crtbrand.c b/lib/csu/common/crtbrand.c index 3d5a84940a..2a0fc71f74 100644 --- a/lib/csu/common/crtbrand.c +++ b/lib/csu/common/crtbrand.c @@ -23,12 +23,12 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/lib/csu/common/crtbrand.c,v 1.1.2.1 2000/10/30 20:32:24 obrien Exp $ - * $DragonFly: src/lib/csu/common/crtbrand.c,v 1.3 2004/02/03 07:34:06 dillon Exp $ + * $DragonFly: src/lib/csu/common/crtbrand.c,v 1.4 2005/06/01 18:07:10 joerg Exp $ */ #include -#define ABI_VENDOR "FreeBSD" +#define ABI_VENDOR "DragonFly" #define ABI_SECTION ".note.ABI-tag" #define ABI_NOTETYPE 1 diff --git a/sys/sys/param.h b/sys/sys/param.h index 3555abed83..3002b1c03b 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -37,7 +37,7 @@ * * @(#)param.h 8.3 (Berkeley) 4/4/95 * $FreeBSD: src/sys/sys/param.h,v 1.61.2.38 2003/05/22 17:12:01 fjoe Exp $ - * $DragonFly: src/sys/sys/param.h,v 1.22 2005/04/30 23:04:21 swildner Exp $ + * $DragonFly: src/sys/sys/param.h,v 1.23 2005/06/01 18:07:09 joerg Exp $ */ #ifndef _SYS_PARAM_H_ @@ -55,7 +55,7 @@ * doc/en_US.ISO8859-1/books/porters-handbook/book.sgml */ #undef __DragonFly_version -#define __DragonFly_version 130000 /* Master, propagated to newvers */ +#define __DragonFly_version 130002 /* Master, propagated to newvers */ #ifdef __FreeBSD__ /* -- 2.41.0