Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Mar 2017 01:00:26 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Ed Schouten <ed@nuxi.nl>
Cc:        Ed Schouten <ed@freebsd.org>, src-committers <src-committers@freebsd.org>,  svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r315701 - in head/sys: amd64/cloudabi32 amd64/cloudabi64 arm/cloudabi32 arm64/cloudabi64 i386/cloudabi32
Message-ID:  <20170322230026.GV43712@kib.kiev.ua>
In-Reply-To: <CABh_MKmEMidUHFXw1fpwb8TP7qEktnFPgXH4UUvmu2bmhdgiqA@mail.gmail.com>
References:  <201703220705.v2M75RHE066483@repo.freebsd.org> <20170322090258.GR43712@kib.kiev.ua> <CABh_MKmEMidUHFXw1fpwb8TP7qEktnFPgXH4UUvmu2bmhdgiqA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Mar 22, 2017 at 03:16:24PM +0100, Ed Schouten wrote:
> Similarly, I seem to remember CloudABI's brandinfos set compat_3_brand
> for a similar reason: it seems to be required by imgact_elf.c. Would
> we also want to change that?

Could you please try this ?

diff --git a/sys/amd64/cloudabi32/cloudabi32_sysvec.c b/sys/amd64/cloudabi32/cloudabi32_sysvec.c
index 9306dbc5dfb..abede1ac4ce 100644
--- a/sys/amd64/cloudabi32/cloudabi32_sysvec.c
+++ b/sys/amd64/cloudabi32/cloudabi32_sysvec.c
@@ -227,6 +227,5 @@ Elf32_Brandinfo cloudabi32_brand = {
 	.brand		= ELFOSABI_CLOUDABI,
 	.machine	= EM_386,
 	.sysvec		= &cloudabi32_elf_sysvec,
-	.compat_3_brand	= "CloudABI",
 	.flags		= BI_BRAND_ONLY_STATIC,
 };
diff --git a/sys/amd64/cloudabi64/cloudabi64_sysvec.c b/sys/amd64/cloudabi64/cloudabi64_sysvec.c
index 3428bbf4909..84f0cb387de 100644
--- a/sys/amd64/cloudabi64/cloudabi64_sysvec.c
+++ b/sys/amd64/cloudabi64/cloudabi64_sysvec.c
@@ -213,5 +213,4 @@ Elf64_Brandinfo cloudabi64_brand = {
 	.machine	= EM_X86_64,
 	.sysvec		= &cloudabi64_elf_sysvec,
 	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_ONLY_STATIC,
-	.compat_3_brand	= "CloudABI",
 };
diff --git a/sys/arm/cloudabi32/cloudabi32_sysvec.c b/sys/arm/cloudabi32/cloudabi32_sysvec.c
index d14129ec4c9..100fa479acd 100644
--- a/sys/arm/cloudabi32/cloudabi32_sysvec.c
+++ b/sys/arm/cloudabi32/cloudabi32_sysvec.c
@@ -189,6 +189,5 @@ Elf32_Brandinfo cloudabi32_brand = {
 	.brand		= ELFOSABI_CLOUDABI,
 	.machine	= EM_ARM,
 	.sysvec		= &cloudabi32_elf_sysvec,
-	.compat_3_brand	= "CloudABI",
 	.flags		= BI_BRAND_ONLY_STATIC,
 };
diff --git a/sys/arm64/cloudabi64/cloudabi64_sysvec.c b/sys/arm64/cloudabi64/cloudabi64_sysvec.c
index 7f339fe3910..fbad0ba70db 100644
--- a/sys/arm64/cloudabi64/cloudabi64_sysvec.c
+++ b/sys/arm64/cloudabi64/cloudabi64_sysvec.c
@@ -182,5 +182,4 @@ Elf64_Brandinfo cloudabi64_brand = {
 	.machine	= EM_AARCH64,
 	.sysvec		= &cloudabi64_elf_sysvec,
 	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_ONLY_STATIC,
-	.compat_3_brand	= "CloudABI",
 };
diff --git a/sys/i386/cloudabi32/cloudabi32_sysvec.c b/sys/i386/cloudabi32/cloudabi32_sysvec.c
index 1bd46cb99aa..c2a21fa9046 100644
--- a/sys/i386/cloudabi32/cloudabi32_sysvec.c
+++ b/sys/i386/cloudabi32/cloudabi32_sysvec.c
@@ -200,6 +200,5 @@ Elf32_Brandinfo cloudabi32_brand = {
 	.brand		= ELFOSABI_CLOUDABI,
 	.machine	= EM_386,
 	.sysvec		= &cloudabi32_elf_sysvec,
-	.compat_3_brand	= "CloudABI",
 	.flags		= BI_BRAND_ONLY_STATIC,
 };
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index 42b02c1bd9e..7058a77854b 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -307,7 +307,8 @@ __elfN(get_brandinfo)(struct image_params *imgp, const char *interp,
 	/* If the executable has a brand, search for it in the brand list. */
 	for (i = 0; i < MAX_BRANDS; i++) {
 		bi = elf_brand_list[i];
-		if (bi == NULL || (bi->flags & BI_BRAND_NOTE_MANDATORY) != 0 ||
+		if (bi == NULL || bi->compat_3_brand == NULL ||
+		    (bi->flags & BI_BRAND_NOTE_MANDATORY) != 0 ||
 		    (interp != NULL && (bi->flags & BI_BRAND_ONLY_STATIC) != 0))
 			continue;
 		if (hdr->e_machine == bi->machine &&



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170322230026.GV43712>