From owner-svn-src-all@freebsd.org Fri Dec 18 03:06:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A1E5A4BEF1; Fri, 18 Dec 2015 03:06:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FD531950; Fri, 18 Dec 2015 03:06:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI36dvh006699; Fri, 18 Dec 2015 03:06:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI36d84006697; Fri, 18 Dec 2015 03:06:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512180306.tBI36d84006697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 18 Dec 2015 03:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292423 - stable/10/usr.sbin/crunch/crunchide X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2015 03:06:40 -0000 Author: emaste Date: Fri Dec 18 03:06:39 2015 New Revision: 292423 URL: https://svnweb.freebsd.org/changeset/base/292423 Log: MFC r281674: crunchide: always include both 32- and 64-bit ELF support This avoids the need to build a target-specific crunchide for cross- builds. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/crunch/crunchide/Makefile stable/10/usr.sbin/crunch/crunchide/exec_elf32.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/crunch/crunchide/Makefile ============================================================================== --- stable/10/usr.sbin/crunch/crunchide/Makefile Fri Dec 18 02:34:01 2015 (r292422) +++ stable/10/usr.sbin/crunch/crunchide/Makefile Fri Dec 18 03:06:39 2015 (r292423) @@ -1,19 +1,9 @@ # $FreeBSD$ PROG= crunchide -SRCS= crunchide.c +SRCS= crunchide.c exec_elf32.c exec_elf64.c -TARGET_ARCH?= ${MACHINE_ARCH} - -.if ${TARGET_ARCH} == ia64 || ${TARGET_ARCH} == powerpc64 || \ - ${TARGET_ARCH} == sparc64 || ${TARGET_ARCH} == amd64 || \ - ${TARGET_ARCH:Mmips64*} -CFLAGS+=-DNLIST_ELF64 -SRCS+= exec_elf64.c +CFLAGS+=-DNLIST_ELF32 -DNLIST_ELF64 exec_elf64.o: exec_elf32.c -.else -CFLAGS+=-DNLIST_ELF32 -SRCS+= exec_elf32.c -.endif .include Modified: stable/10/usr.sbin/crunch/crunchide/exec_elf32.c ============================================================================== --- stable/10/usr.sbin/crunch/crunchide/exec_elf32.c Fri Dec 18 02:34:01 2015 (r292422) +++ stable/10/usr.sbin/crunch/crunchide/exec_elf32.c Fri Dec 18 03:06:39 2015 (r292423) @@ -79,6 +79,9 @@ __FBSDID("$FreeBSD$"); #define ELFNAME2(x,y) CONCAT(x,CONCAT(_elf,CONCAT(ELFSIZE,CONCAT(_,y)))) #define ELFNAMEEND(x) CONCAT(x,CONCAT(_elf,ELFSIZE)) #define ELFDEFNNAME(x) CONCAT(ELF,CONCAT(ELFSIZE,CONCAT(_,x))) +#ifndef ELFCLASS +#define ELFCLASS CONCAT(ELFCLASS,ELFSIZE) +#endif #define xe16toh(x) ((data == ELFDATA2MSB) ? be16toh(x) : le16toh(x)) #define xe32toh(x) ((data == ELFDATA2MSB) ? be32toh(x) : le32toh(x)) @@ -167,7 +170,7 @@ ELFNAMEEND(check)(int fd, const char *fn if (read(fd, &eh, sizeof eh) != sizeof eh) return 0; - if (IS_ELF(eh) == 0) + if (IS_ELF(eh) == 0 || eh.e_ident[EI_CLASS] != ELFCLASS) return 0; data = eh.e_ident[EI_DATA];