From patchwork Mon Jan 9 11:29:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 9504505 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CDCFE60710 for ; Mon, 9 Jan 2017 11:56:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE5CB284B6 for ; Mon, 9 Jan 2017 11:56:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A2A41284B9; Mon, 9 Jan 2017 11:56:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AA327284B6 for ; Mon, 9 Jan 2017 11:56:23 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cQYYl-0003pu-OW; Mon, 09 Jan 2017 11:56:19 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cQYXm-0001zn-Vm for linux-arm-kernel@bombadil.infradead.org; Mon, 09 Jan 2017 11:55:19 +0000 Received: from mail-co1nam03on0041.outbound.protection.outlook.com ([104.47.40.41] helo=NAM03-CO1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cQYCc-00076U-5e for linux-arm-kernel@lists.infradead.org; Mon, 09 Jan 2017 11:33:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-caviumnetworks-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=RFzpPgtm4LwNFe48KHNOd+JeHyT1/96jfWu26mz0i1w=; b=xfeh5wnvo/FYlqgz/4adSIDYRRaNoJNuf0bBmVCvTZn+ZSceQCF+AAxcOpJkkJiV6NASFXVp5Yx7zjjOrqBlDk7Xiu7ikW2xlJXcHSotGRRVv1z6FeS48F2WloRdTh4JFXHp6F0/8GA4eCXx8uGffh9K8/V4mG4UV4QYb6Xvwas= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; Received: from localhost (103.78.20.242) by DM3PR07MB2251.namprd07.prod.outlook.com (10.164.33.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.829.7; Mon, 9 Jan 2017 11:33:03 +0000 From: Yury Norov To: , , , "linux-arch @ vger . kernel . org Arnd Bergmann" , Catalin Marinas Subject: [PATCH 11/20] arm64: introduce binfmt_elf32.c Date: Mon, 9 Jan 2017 16:59:48 +0530 Message-ID: <1483961397-8599-12-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1483961397-8599-1-git-send-email-ynorov@caviumnetworks.com> References: <1483961397-8599-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [103.78.20.242] X-ClientProxiedBy: VI1PR07CA0080.eurprd07.prod.outlook.com (10.164.94.176) To DM3PR07MB2251.namprd07.prod.outlook.com (10.164.33.149) X-MS-Office365-Filtering-Correlation-Id: c267e030-50b2-4eac-6779-08d4388346b6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DM3PR07MB2251; X-Microsoft-Exchange-Diagnostics: 1; DM3PR07MB2251; 3:aR/RZXKkn5ovmwBadpakFk03b9UuUtUn/+a9od39QuR8GwGhz3j3JRzKeOgr/c/QR36JU9f2IJQmYFQA3pWYW1rdTtN5EtUylRLqyNciZTbOLwRMFoIeW5v8u8QSV4es3Cqu2yaVUoxBjuut8Q10f5J4m2goR4YUnrq0qMnEBlsPJum97hBJ41fduo6yY9XUwIEThnNPmgC4Qnm1wTMZJRUovG5hYCsHgWdUjOdZ/OOc/rG3o37RL0n1lybw8YXFccsrpQ9/QDTymzrkz49A5g==; 25:V4cwz1enrd3/5LV9ueCuP2EsDBq6widbuce10VnWnvHc1GxXG41hnV9R/lpTnz+41LtVScO1f3YeT8mzN1y7RO+7iNfRWbF48Cw66rA1y2yQnG1h+WfQWWelRaYRRoDPOurP34gdptKPnR2zYL7Z9DZDaG7HmtcmQbFXeovGZL/7liCwO7gGAA8i4DWqar+VsyXlXWQ5IPKe9HYotlNnaEPJAMIY0959hy+6DdPw9dZGxt8C+CLsSpctsO+FQdobWtYFTxhLrjSPN4n5m7icBI/qLkXr/vRevPr3R7t6A0GVQomyTqb+I+6dwhR/P5d2kwvcxIAi9KUIoTgis1v/0butWHRciAgcmK1j7RVRRb0KNF+TkPs713rtTtgZKpqxDXggSn2s4uiIUYydHL508mxS6WmHFV2TJ1md+awtbJGYi/8Aryz9LgeK8a2NoyevhCEF7bpBMpVZhcJRxhoV4g== X-Microsoft-Exchange-Diagnostics: 1; DM3PR07MB2251; 31:2a7R5nYJEFUWCwHh2AacsUKc8SblcTNI06i4J5xwbu6Hzo75zs33R0VoY9pBAS8JE2XLLjr4E6eJStmn1fsgJ429tb31+yGz2sb3raqsqXmXUMul2jPZPyUGzq8MPsK7+bg3dv6Y2Uu5lVJALZlaANb+1QoPo8tKg2Lx1ggg5CzML4nhSuZYyMGkdhwF7iRwMooaO05SN2kbyIccWMVKFAapiygJMg1dT/QG8aSj2wGeyDcxWHM1N+14SUa6Bcsj; 20:5/MneZW2YMoQHNrVH5pFkXA0swQyM1tMO6UKScub0/Ly4RyekBoy+rmL2aDDneHqg+KEVQOdgaaV85K4XNFY4+1pGhEO674SmKlMJupO6zTN+02agEw9sc9GBIGEvPgMhcYp05d+oQKitZH5YXBhVvKSj4nY2GtILAjFqyDZwvLn8laNunuKcsJ5NBt4GQrP1yqWj6FE02Ocg6ZhZV0GyVkpIcDLXTQ2/FEfj4jF27LZ12IgqUGkvthstkF55jEqG5jrmeT+olZCG9L4GO55gT2edmU/L7FqnDQtKyaq6LmggyyO6HlHNssmEjMWXuyeFFcdVfxskc6LUmG0BF4ITmybOyQ5QIjmcrMiLdmSXEVWQ07RJLQT06SjAyipMhz+zMnWt1TIMaKgpt3CfPGECOhmIoybeixIzz6O84qzJu4nRJ/F6crcwN1qE9W/2ogWh1U/1j4rpmovRNomp6Wj8uUBvPnLXEjbR/QIZ9Tu35/xKvlIUfKkKKJUTEuvHebT2aK2tjqJQFuhOtQjxJFIDaDomVJF1n53kFx8YiS3hVhnRiiUqpO6l1lRo49SCwrWSiOTqJwvShTO92XDYKshdcZe2XAZ92NAQlM0DSVTBxU= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123562025)(20161123555025)(20161123564025)(20161123560025)(6072148); SRVR:DM3PR07MB2251; BCL:0; PCL:0; RULEID:; SRVR:DM3PR07MB2251; X-Microsoft-Exchange-Diagnostics: 1; DM3PR07MB2251; 4:l2Yrj3naetHVYfES84axAeC1ROxEcLgEch/Qixdd2mvThOdI9UQdv+oBirgkOM7Y8KU2IuC8Ml5/PqW2+b9keLzeNAErVP0HbvS0UWD824vUEuq7SjtrwprlY845VlbKcISKsWAZDXOynR8RwXv2wXGHkSiPpzu9m/VJzIwEYxXJv4yci9OKUErvUY1DmhJEFxobJ2eO2toE7VHynUjHgal/Q8/IR1l/HcF3vR4NpEKM0hupnWelxKBFoyxLviqQvcQVP/rbUAu9u+egacVS3VQYbHoM/FGSDFF17iDA3CKrJvshvz0pRarQuo8LjLVuGZ6LhUZpGef+5OKJqQavf1DTSToA7mK+a8Gc5DTnSUxMnavGvwjf3R2PPH6hHV+Cb68iedFtCfcayArkGn+i1QmnERysUQUQAUSUG42nQP3KnResw3tlTr5PPUlV0xaHSQ/lYG0TFH8gwAYrXriqTIWLE1gKQC0LxR1ZxjLnpW0ZRvImyOBkA2jPYd2HHX88KUG9qmIFQhF+6Fo4GJFDFcnec/vuDL8Tttak1vRRyYJQKeT+g0qlN51JfAJtlAPVimWEIPPjM6MhXdhK/ful5g== X-Forefront-PRVS: 0182DBBB05 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(189002)(199003)(54906002)(48376002)(97736004)(5660300001)(7736002)(305945005)(50226002)(50466002)(4326007)(50986999)(66066001)(81156014)(81166006)(8676002)(76176999)(2950100002)(101416001)(6666003)(47776003)(42186005)(38730400001)(7416002)(2906002)(76506005)(106356001)(2201001)(575784001)(105586002)(5003940100001)(189998001)(68736007)(39060400001)(92566002)(36756003)(25786008)(5001770100001)(6116002)(3846002)(6486002)(6496003)(33646002)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM3PR07MB2251; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: caviumnetworks.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM3PR07MB2251; 23:GN6r/gayl5qw0Y3K6GW/L+s6FNEPA+F1rXMTHDUnM?= =?us-ascii?Q?zhcibmp7nzptyOaLiqWZCpASgL2dr81WNwg4lo1aD0Fa4/JMSFpQaVqx2Dup?= =?us-ascii?Q?K12O8g3toHgKK5CUQExyqVl9AiGDIGLKlJOO8HkEW7qjLbffp8gLyFw5TtHw?= =?us-ascii?Q?zAhUoieoqE/yU/07GgJyTzpd7wAgA/fLNXNfDkNvoHciBeemg+5wW42V50Ro?= =?us-ascii?Q?UXu0cEer9N2BNfRck6dR8l5asV4+yIWOZGmyb75xr5nvBNBBCc1PIg/caQf4?= =?us-ascii?Q?+75SzsuEZidV/ddS3i3Td1Vq7FVfo+Eef32ZaBPUP/vaPqd2Z22UImtrl/xL?= =?us-ascii?Q?DBZ+tWqJWigQ+nO5hFty7S0Bbaw+Ne5IGo1H2BT6VnViorFwuiZ3Y0VmTYus?= =?us-ascii?Q?uMVp2NGWG/YMKNr6uR88XX+T+zO5Kttq+4RGsxPrIOneX1DoGO/JBgLIqKVn?= =?us-ascii?Q?9Wl3Kb5hQlcVYXSTYkILeTDE8cFvBEZtWS/lvc6D/eKIHg+M+0k6rp+qfURx?= =?us-ascii?Q?nxDbdKjwR7KRJR4/9XjF8t7zVRruPOXKCi+gsim6GOy8VZF/Srzhpr9yXOmR?= =?us-ascii?Q?yKhDQy1jadQzTnCPEfxyTfn8uBKw6vo8fL1w5CElPxeXRoJQjH/UammMG24N?= =?us-ascii?Q?oIkA1JZt/kv1fFtPkwLCKU6/Tknd50+VW+pkAzFC0e0ubcz3WXGAzgqol2AG?= =?us-ascii?Q?MaPX03PrNaTXyDpxV+o/xcI5rXWSRUliExUK92zGS/WUbaG4rnMIz9Ps5vuA?= =?us-ascii?Q?6HG9Iq7bURbQFwotpmrCth03HNzOOdTuD5KjGXekMQcgOVGY/fAbmuWByQfj?= =?us-ascii?Q?1EpxDrLcM6dsZsDs8Dt3cp7ncd07t1e2y7nxUQBOzrdvpNSPgEzrxfOIiwSF?= =?us-ascii?Q?QMg2dNVx8yYEYv5lpPusVt2jDK/lp5Pm7Dz8f8ryi7GEBjJ/R9t+rtvGCurf?= =?us-ascii?Q?ByXbqXIcIeJHumz+o9Yjz4jDMOkSftXTlGVs6UAiv4P9KRzk4AmYCND9wnwD?= =?us-ascii?Q?9W7QhgQEgZCPABtn5ayA0fySTSlRkvxbIYUzLCMHuh+VHj6pA5PSmSoLWl3T?= =?us-ascii?Q?cpymvXwMJh3jlFQaPmGdug5k3l0E94hlx39Gp/DgO3ZG2lUDVwsqxI6bpHar?= =?us-ascii?Q?kXo3JW5JDDhaZImpi968bAv+2qOw5GGfxr/NUE5pQwTIg5Ue4067Rx52Tlxv?= =?us-ascii?Q?IxOdGDDeeA5zYEzBHRwcWAOXFbHRAPKS1VS?= X-Microsoft-Exchange-Diagnostics: 1; DM3PR07MB2251; 6:3uPQiiWMUhLDgivmelPXHAkhb4/76g8+/zR9RtEKN8k6nx/TTxyJYJzxy8f7K7JnGWtQMNySRAkM3h2zdoE1JcJ+7WvkBcfAA84b2FdmamrfnUVAUHqFu9rsGkimSWgeLO6mZvN26UoupHmwiF+mR2Gps4RyUJClCW8VrmkfYlNsv1s1U7kgTo040ReKw4hG3Ove6njOj0aiheFMhju6r07vKpiIiTQqeHvZxDFHLd/ryh+awFAfjSl5TqE60pz91avzIKkn4EUMCuW+MHN7t4xkN9PvIeVPn0VGsQIgJa6EY7piN2BC48uwWUExiT32n3xR+QOzZkh4T8BbfK4dbevwt6HXV2EB5StlGnn3zrLVh60C5tAgLD388Li0XxMm5Kx9aHPFd26t8di00VhrZ4XqdjTk0JYSkJhZRZHzB0Y=; 5:VEPyff4xPF417ItC4gG+r8auSYCpRL7GRPKeDTTIIMwAmRjI3SykSBgZ2lL+hsaf0oHDDcFqZY0yVwjVz07eNlwgFN4sUbIDfw8jHtil4lP/jLwfu2QLvKZWSXjVcSQ8alUbME3PJyrxREajGATxTw==; 24:3lGNgd5HpOcvU60i7UzBk6qwbWn6UNExsgpFXyTrEMmNreDoH1JVMWgDgWME3FNMCojXbQycR43NBGdZ1cEV7FXV4groCah3v3UTkUMb5P0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM3PR07MB2251; 7:/qeYiBGV+XA1RGpwVaRv6qbxk3fwIDvzSeQIonvI5FnmdA4ge9a9AbWrvxxtXuHerXjfL1U6/GXi6xMJxiI+3xoe6BKHkJKz70WDq9vsEDN9c+pYMSltf4pl3YGev2lBpF3Vh84cDYU7iU/JHrDxYZoWQaHoKHnDagUC1fp8edu5o8a8Y/f0/a9uC7uacDFdySmWAK8xDGkjig6YXJ/wSgTQzVCo2J/DQHUuBtaTk805q5HmCWW6u6GEC9ux0f3zT7/vXiZ/gkOHLkwkKe1EMgs9Uy4SoD4JIv2jOutO6LpxcdErn+SxhpRnWF/bkny6GA+3Xv++WY8AmQknO30RV9veTTlNZplmO4UzV3ydxR1ZN08xBzlfbXCjD/4uRSDEP6/np5pPlV13FTsU5RdUjBcu/P4TIx6Ws7FeQfQAEnR3TucJoRvnkHyNvBSHr+5udYOFRvfoj9XJwIX87+DDDQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2017 11:33:03.5055 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR07MB2251 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170109_063326_427598_FE4E79E5 X-CRM114-Status: GOOD ( 16.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Pinski , Heiko Carstens , Chris Metcalf , Yury Norov , philipp.tomsich@theobroma-systems.com, Joseph Myers , zhouchengming1@huawei.com, Steve Ellcey , Prasun.Kapoor@caviumnetworks.com, Andreas Schwab , agraf@suse.de, szabolcs.nagy@arm.com, geert@linux-m68k.org, Adam Borowski , manuel.montezelo@gmail.com, Chris Metcalf , Andrew Pinski , linyongting@huawei.com, klimov.linux@gmail.com, broonie@kernel.org, Bamvor Zhangjian , Maxim Kuvyrkov , Florian Weimer , Nathan_Lynch@mentor.com, Ramana Radhakrishnan , schwidefsky@de.ibm.com, davem@davemloft.net, christoph.muellner@theobroma-systems.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP As we support more than one compat formats, it looks more reasonable to not use fs/compat_binfmt.c. Custom binfmt_elf32.c allows to move aarch32 specific definitions there and make code more maintainable and readable. Signed-off-by: Yury Norov --- arch/arm64/Kconfig | 1 - arch/arm64/include/asm/elf.h | 22 ++-------------------- arch/arm64/include/asm/hwcap.h | 2 -- arch/arm64/kernel/Makefile | 2 +- arch/arm64/kernel/binfmt_elf32.c | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 35 insertions(+), 24 deletions(-) create mode 100644 arch/arm64/kernel/binfmt_elf32.c diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index bcb11dd..e668ace 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1016,7 +1016,6 @@ config AARCH32_EL0 def_bool y depends on ARM64_4K_PAGES || EXPERT select COMPAT - select COMPAT_BINFMT_ELF select HAVE_UID16 select OLD_SIGSUSPEND3 select COMPAT_OLD_SIGACTION diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h index a0188e2..453e0da 100644 --- a/arch/arm64/include/asm/elf.h +++ b/arch/arm64/include/asm/elf.h @@ -176,30 +176,12 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm, #define COMPAT_ELF_ET_DYN_BASE (2 * TASK_SIZE_32 / 3) +#ifdef CONFIG_AARCH32_EL0 /* AArch32 registers. */ #define COMPAT_ELF_NGREG 18 typedef unsigned int compat_elf_greg_t; typedef compat_elf_greg_t compat_elf_gregset_t[COMPAT_ELF_NGREG]; - -/* AArch32 EABI. */ -#define EF_ARM_EABI_MASK 0xff000000 -#define compat_elf_check_arch(x) (system_supports_32bit_el0() && \ - ((x)->e_machine == EM_ARM) && \ - ((x)->e_flags & EF_ARM_EABI_MASK)) - -#define compat_start_thread compat_start_thread -#define COMPAT_SET_PERSONALITY(ex) \ -({ \ - set_bit(TIF_32BIT, ¤t->mm->context.flags); \ - clear_thread_flag(TIF_32BIT_AARCH64); \ - set_thread_flag(TIF_32BIT); \ - }) -#define COMPAT_ARCH_DLINFO -extern int aarch32_setup_vectors_page(struct linux_binprm *bprm, - int uses_interp); -#define compat_arch_setup_additional_pages \ - aarch32_setup_vectors_page - +#endif /* CONFIG_AARCH32_EL0 */ #endif /* CONFIG_COMPAT */ #endif /* !__ASSEMBLY__ */ diff --git a/arch/arm64/include/asm/hwcap.h b/arch/arm64/include/asm/hwcap.h index 2c7fc5d..99dfd92 100644 --- a/arch/arm64/include/asm/hwcap.h +++ b/arch/arm64/include/asm/hwcap.h @@ -47,8 +47,6 @@ #define ELF_HWCAP (elf_hwcap) #ifdef CONFIG_AARCH32_EL0 -#define COMPAT_ELF_HWCAP (compat_elf_hwcap) -#define COMPAT_ELF_HWCAP2 (compat_elf_hwcap2) extern unsigned int compat_elf_hwcap, compat_elf_hwcap2; #endif diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 8a19fda..abe5040 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -28,7 +28,7 @@ $(obj)/%.stub.o: $(obj)/%.o FORCE $(call if_changed,objcopy) arm64-obj-$(CONFIG_AARCH32_EL0) += sys32.o kuser32.o signal32.o \ - sys_compat.o entry32.o + sys_compat.o entry32.o binfmt_elf32.o arm64-obj-$(CONFIG_FUNCTION_TRACER) += ftrace.o entry-ftrace.o arm64-obj-$(CONFIG_MODULES) += arm64ksyms.o module.o arm64-obj-$(CONFIG_ARM64_MODULE_PLTS) += module-plts.o diff --git a/arch/arm64/kernel/binfmt_elf32.c b/arch/arm64/kernel/binfmt_elf32.c new file mode 100644 index 0000000..7c38a22 --- /dev/null +++ b/arch/arm64/kernel/binfmt_elf32.c @@ -0,0 +1,32 @@ +/* + * Support for AArch32 Linux ELF binaries. + */ + +/* AArch32 EABI. */ +#define EF_ARM_EABI_MASK 0xff000000 + +#define compat_start_thread compat_start_thread +#define COMPAT_SET_PERSONALITY(ex) \ +({ \ + set_bit(TIF_32BIT, ¤t->mm->context.flags); \ + clear_thread_flag(TIF_32BIT_AARCH64); \ + set_thread_flag(TIF_32BIT); \ + }) + +#define COMPAT_ARCH_DLINFO +#define COMPAT_ELF_HWCAP (compat_elf_hwcap) +#define COMPAT_ELF_HWCAP2 (compat_elf_hwcap2) + +#define compat_arch_setup_additional_pages \ + aarch32_setup_vectors_page +struct linux_binprm; +extern int aarch32_setup_vectors_page(struct linux_binprm *bprm, + int uses_interp); + +/* AArch32 EABI. */ +#define compat_elf_check_arch(x) (system_supports_32bit_el0() && \ + ((x)->e_machine == EM_ARM) && \ + ((x)->e_flags & EF_ARM_EABI_MASK)) + + +#include "../../../fs/compat_binfmt_elf.c"