From owner-svn-src-head@freebsd.org Wed Nov 18 17:03:23 2015 Return-Path: Delivered-To: svn-src-head@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 9C8ACA32C8C; Wed, 18 Nov 2015 17:03:23 +0000 (UTC) (envelope-from nwhitehorn@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 5E6C71305; Wed, 18 Nov 2015 17:03:23 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAIH3Mgn092090; Wed, 18 Nov 2015 17:03:22 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAIH3MBu092089; Wed, 18 Nov 2015 17:03:22 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201511181703.tAIH3MBu092089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Wed, 18 Nov 2015 17:03:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291020 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Nov 2015 17:03:23 -0000 Author: nwhitehorn Date: Wed Nov 18 17:03:22 2015 New Revision: 291020 URL: https://svnweb.freebsd.org/changeset/base/291020 Log: Extend r270123 to run the brand info's header_supported() routine for branded as well as unbranded binaries. This will be required to add support for the new ELFv2 ABI on powerpc64, which is distinguished from ELFv1 by the contents of the ELF header's flags field. Reviewed by: imp MFC after: 2 weeks Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Wed Nov 18 16:52:19 2015 (r291019) +++ head/sys/kern/imgact_elf.c Wed Nov 18 17:03:22 2015 (r291020) @@ -286,8 +286,11 @@ __elfN(get_brandinfo)(struct image_param if (hdr->e_machine == bi->machine && (hdr->e_ident[EI_OSABI] == bi->brand || strncmp((const char *)&hdr->e_ident[OLD_EI_BRAND], - bi->compat_3_brand, strlen(bi->compat_3_brand)) == 0)) - return (bi); + bi->compat_3_brand, strlen(bi->compat_3_brand)) == 0)) { + /* Looks good, but give brand a chance to veto */ + if (!bi->header_supported || bi->header_supported(imgp)) + return (bi); + } } /* No known brand, see if the header is recognized by any brand */