svn commit: r291020 - head/sys/kern

Nathan Whitehorn nwhitehorn at FreeBSD.org
Wed Nov 18 17:03:23 UTC 2015


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 */


More information about the svn-src-head mailing list