From nobody Tue Feb 10 15:29:32 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1523028044971172.6951596185437; Fri, 6 Apr 2018 08:20:44 -0700 (PDT) Received: from localhost ([::1]:33937 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4TAS-0005Lz-37 for importer@patchew.org; Fri, 06 Apr 2018 11:20:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60768) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4T8C-0003mj-Ah for qemu-devel@nongnu.org; Fri, 06 Apr 2018 11:18:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f4T89-0004V2-3R for qemu-devel@nongnu.org; Fri, 06 Apr 2018 11:18:24 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:43962) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f4T88-0004Ua-PW for qemu-devel@nongnu.org; Fri, 06 Apr 2018 11:18:21 -0400 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w36FE8aN020618; Fri, 6 Apr 2018 17:18:19 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2h1ysxp456-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 06 Apr 2018 17:18:19 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id CCB2B3D; Fri, 6 Apr 2018 15:18:18 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 9410CA6DF; Fri, 6 Apr 2018 15:18:18 +0000 (GMT) Received: from gnx2104.gnb.st.com (10.75.127.51) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 6 Apr 2018 17:18:18 +0200 From: Christophe Lyon To: , , Date: Fri, 6 Apr 2018 17:17:29 +0200 Message-ID: <20180406151752.10854-2-christophe.lyon@st.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180406151752.10854-1-christophe.lyon@st.com> References: <20180406151752.10854-1-christophe.lyon@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.51] X-ClientProxiedBy: SFHDAG6NODE1.st.com (10.75.127.16) To SFHDAG5NODE1.st.com (10.75.127.13) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-04-06_08:, , signatures=0 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx07-.pphosted.com id w36FE8aN020618 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 62.209.51.94 Subject: [Qemu-devel] [ARM/FDPIC 1/4] linux-user: ARM-FDPIC: Add configure option to support loading of FDPIC binaries X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Adds --enable-fdpic and --disable-fdpic configure options. This feature is disabled by default, that's why it is not described in the "Optional features" help section (which are enabled by default if possible). FDPIC ELF objects are identified with e_ident[EI_OSABI] =3D=3D ELFOSABI_ARM_FDPIC. Co-Authored-By: Micka=C3=ABl Gu=C3=AAn=C3=A9 Signed-off-by: Christophe Lyon diff --git a/configure b/configure index 4d0e92c..af4c14b 100755 --- a/configure +++ b/configure @@ -451,6 +451,7 @@ jemalloc=3D"no" replication=3D"yes" vxhs=3D"" libxml2=3D"" +fdpic=3D"no" =20 supported_cpu=3D"no" supported_os=3D"no" @@ -1374,6 +1375,10 @@ for opt do ;; --disable-git-update) git_update=3Dno ;; + --disable-fdpic) fdpic=3D"no" + ;; + --enable-fdpic) fdpic=3D"yes" + ;; *) echo "ERROR: unknown option $opt" echo "Try '$0 --help' for more information" @@ -1544,6 +1549,8 @@ Advanced options (experts only): xen pv domain builder --enable-debug-stack-usage track the maximum stack usage of stacks created= by qemu_alloc_stack + --disable-fdpic disable loading of FDPIC binary (default) + --enable-fdpic enable loading of FDPIC binary =20 Optional features, enabled with --enable-FEATURE and disabled with --disable-FEATURE, default is enabled if available: @@ -7085,6 +7092,9 @@ fi =20 echo "LDFLAGS+=3D$ldflags" >> $config_target_mak echo "QEMU_CFLAGS+=3D$cflags" >> $config_target_mak +if [ "$fdpic" =3D "yes" ]; then + echo "CONFIG_USE_FDPIC=3Dy" >> $config_target_mak +fi =20 done # for target in $targets =20 diff --git a/include/elf.h b/include/elf.h index c0dc9bb..934dbbd 100644 --- a/include/elf.h +++ b/include/elf.h @@ -1483,6 +1483,7 @@ typedef struct elf64_shdr { #define ELFOSABI_TRU64 10 /* Compaq TRU64 UNIX. */ #define ELFOSABI_MODESTO 11 /* Novell Modesto. */ #define ELFOSABI_OPENBSD 12 /* OpenBSD. */ +#define ELFOSABI_ARM_FDPIC 65 /* ARM FDPIC */ #define ELFOSABI_ARM 97 /* ARM */ #define ELFOSABI_STANDALONE 255 /* Standalone (embedded) applicati= on */ =20 diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 23e3495..7ba3795 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -1658,6 +1658,14 @@ static void zero_bss(abi_ulong elf_bss, abi_ulong la= st_bss, int prot) } =20 #ifdef CONFIG_USE_FDPIC + +#ifdef TARGET_ARM +static int elf_is_fdpic(struct elfhdr *exec) +{ + return exec->e_ident[EI_OSABI] =3D=3D ELFOSABI_ARM_FDPIC; +} +#endif + static abi_ulong loader_build_fdpic_loadmap(struct image_info *info, abi_u= long sp) { uint16_t n; --=20 2.6.3