From patchwork Thu Mar 7 10:06:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 159823 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp7251103jad; Thu, 7 Mar 2019 02:13:33 -0800 (PST) X-Google-Smtp-Source: APXvYqzgqgQkvhEy6a0B4n7TTvTyL1DHv3/TbPqCsoWqDT4WUbqx2oT6MqI9grEgoBjrZ8LjhK0s X-Received: by 2002:a81:834d:: with SMTP id t74mr9036958ywf.204.1551953613486; Thu, 07 Mar 2019 02:13:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551953613; cv=none; d=google.com; s=arc-20160816; b=qNt7fRygXF0bfewRaPIU99Lu3po/znMLaj0eHXnDSj4Qe7DfLr71UgojxR9qSDcsxc FuNasRiCLvBNuR+H6AC7kHsp5LJibpqEKu0SaV2SyHcqYlwoeROfUaR4feZDOvYX/67H Gxk+QQQrgNBCleMKwEJuIM0g+IBamxOFjMJvpKkCYkb32m7UGMva7YmDLOH+NZgshg1N j5Bo47kDKHze3Wh+WzyT+uhBDHdjImNvgZzqJLsmGBpmfHKlZ8E4u+HN+Sg0r56j8MRJ /4B9zR7lDkkyZSb20fWMW9FvXweYd1Gp4bScRplni2yC3JLnU3am1QybsshGfYqH5N+L LS7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from; bh=QGtodLq/JB00Uk0HY6lgbwSp+vDsij+PJCdgbxWURCE=; b=ahqRnh0A/KlzhjzHqJCKGk82t4gQP/8Uxam0XbDRfQbzlWnzWS2LdBwbiVuFoe8m6X C0roJybp88Ixo2iECRrRPy+Vpumf9Ab1tCjPP+MS8ckoHesVXl4SyWDt7MhLNa1hbPqx IdSoDSHXo+nlqXpk03pbKnyHDu+MG2hCzXSq78gllP2/uCj0jJ1+667Otzh7Z78P3qx9 4ChZ60Szul319pjat2aObF3eyHhBHHpf0lfcsshBVaie+AnvBxy4AVY3sHxn1s/oM++O 4/8VO5p0OK1GwCJ1E6X4dNE0+6titSsib1UsiAFEVdJHb/CNJgkoV/RyVIzd42gQVlXE U54g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y13si2458077ywg.153.2019.03.07.02.13.33 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 07 Mar 2019 02:13:33 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([127.0.0.1]:48538 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1q1t-0000Du-0P for patch@linaro.org; Thu, 07 Mar 2019 05:13:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1pvn-00042G-HA for qemu-devel@nongnu.org; Thu, 07 Mar 2019 05:07:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1pvm-0007TI-FI for qemu-devel@nongnu.org; Thu, 07 Mar 2019 05:07:15 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:35715) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1pvm-0007Sg-1J for qemu-devel@nongnu.org; Thu, 07 Mar 2019 05:07:14 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M2fHt-1h5wvg00jf-0049Q9; Thu, 07 Mar 2019 11:07:03 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Thu, 7 Mar 2019 11:06:49 +0100 Message-Id: <20190307100656.14044-3-laurent@vivier.eu> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190307100656.14044-1-laurent@vivier.eu> References: <20190307100656.14044-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:3i/30+LDH/usUlUQpYcrD+AGwJLl6Jhz/TFt0xKXr5voG0bBCsR 6MWgrgXz3HBKQbGM3ET/yaIqEivCu55yXX0oewVEl0Z73JpB29RM6itZocj5U7F50+SqLHB nFs/oFbySH9U1pUEq+ihUVgxzo1USwJDZYUQGLY+uMWGZdEbUfIUwksfD2B8537uEDrgfEA mwMiTnmPPRr+m0Hz8rztg== X-UI-Out-Filterresults: notjunk:1; V03:K0:+AF4BrFprm4=:UZm80pjJYKdKx8KoPnRG70 TcxAlP6CbFbwcF8zVXQrcVKzXAn2yHnOds6++xcoJxUiiUcmDHUIEC0mrrqn1Ek4Eh2cL7tlF X6y6cxmArR3yEXzE+OaqteMbTmT8yd34perl+G6Si4o37xuE/Ui+LF8Y+v6z+HGjLPu0SV2vm yUxWJUPlCFgz2D5qnbiHn89cEOvYSopcwdQ1EqQ2S2GJuDvZUnNCgpG6eDnWl3p6V6JTvgdT6 kSPOwURXVogxH8+/4g9WndKZelSjzfCU2LuBjIVdfSeacO3/wJoNj2HU1++oevmSRLZbdKoUW 5/BMKarOz1vN/JNuDR/M04aw44jH48YLHEwuGRHHB/IAMDyLnzvEmuKPFlYI+PUG5bgV21A4e lDLpkl1crBbErIVCz1CAboSnzyVl8L19zkeqChApgNUUcc2Gemfy4KDs279tSrc3/YPZkwcFE wkBm/tsMuooScfCAQqP/bMqsWX2RSx23AMQMUeygstWIwnBBpf3vNdkSRukUlK/yYDCpDUK9a EG80HQIY62d0fZ+3gQhmsqBwKwyJi76PSPbmkRU31Yan7lT9JmvmhisllsURFIo+wdvCfUlsA /jy0tU1iWblsBBu2/vkOZnk0h6HzsyOm55GNWv1geZHUWkryiTHh82ntHE8UZHIHQlw0XuXGW sTRQQBYqpKcOPMiXbYcTkE5ZDQFAC9tjAJnMWAJNdhV2CFR3Q77borLoEeGdRxDeuB1AQfp78 W97kMzzTFzur4lgQJn9ZswXvDMxH82gdgu38xg== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.72.192.73 Subject: [Qemu-devel] [PULL 2/9] linux-user: Add ELF_PLATFORM for arm 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: , Cc: Riku Voipio , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson The 32-bit kernel has strings for v4, v5, v6, v7, v7m. The 64-bit kernel, in compat mode, has strings for v8. Fixes: https://bugs.launchpad.net/bugs/1813034 Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier Message-Id: <20190212074840.13542-2-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/elfload.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) -- 2.20.1 diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 6e8762b40dea..940a97a2f2e9 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -500,6 +500,37 @@ static uint32_t get_elf_hwcap2(void) #undef GET_FEATURE #undef GET_FEATURE_ID +#define ELF_PLATFORM get_elf_platform() + +static const char *get_elf_platform(void) +{ + CPUARMState *env = thread_cpu->env_ptr; + +#ifdef TARGET_WORDS_BIGENDIAN +# define END "b" +#else +# define END "l" +#endif + + if (arm_feature(env, ARM_FEATURE_V8)) { + return "v8" END; + } else if (arm_feature(env, ARM_FEATURE_V7)) { + if (arm_feature(env, ARM_FEATURE_M)) { + return "v7m" END; + } else { + return "v7" END; + } + } else if (arm_feature(env, ARM_FEATURE_V6)) { + return "v6" END; + } else if (arm_feature(env, ARM_FEATURE_V5)) { + return "v5" END; + } else { + return "v4" END; + } + +#undef END +} + #else /* 64 bit ARM definitions */ #define ELF_START_MMAP 0x80000000 From patchwork Thu Mar 7 10:06:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 159817 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp7248699jad; Thu, 7 Mar 2019 02:10:22 -0800 (PST) X-Google-Smtp-Source: APXvYqz/1eq/0OpW4VrlvDKb2A971Li7P5sFuZSZvLYWQxmWqzM+ZcHXL5s8ARN9qWVVmeHP1lsF X-Received: by 2002:a0d:c6c5:: with SMTP id i188mr9128220ywd.320.1551953421966; Thu, 07 Mar 2019 02:10:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551953421; cv=none; d=google.com; s=arc-20160816; b=GlScUb7S2y1/fm3zQlb+DI3iNn7qPZjzrLEywCO6cxLthj9RuuWbPOgKouWHwVEwxw kMN3NiK76oAHdqoqWJhdq/kUA0RbDC49WoLK9ru68x3D/yBRGa+oKK6wCSMcxgVNgHAr nSQeHb6s5G1LDvU6kzOzr7cXV+azDJOZ6EWKH+FmzpM2yLpeGcH6d9IBMjbY1bdBohKJ zT3Wcn5t9o1fXZKjCv40OpXIzt3kjcg/TzcGMCY1h54Oh9x8640Hl6nJfVPN1Gljs77R GZT6SkdynAUgSPzmWW37ZsfxqXzw+aRHONyiejXLVAnM8DVUvIRCJODDPd61G89pUx1s Mq0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from; bh=28kaq0i14y511XFQ1Pouh/FW3y0yYhxHP2zGmecEIbA=; b=kTuC8SsGoTy/MyxbGnN+6jcuVT/El+Mww8lLdAWhTZxgZKueskIeiC6ivg1G3t9bK0 oo7QxUW686EDvaPpAwbLhfp+is42uTFVainbk2I3IvqXAU8YxAvF2KHGd+zR/HkjHPq1 mJoe0Eld63rfAgdmpz4DW3fPY/FvEvI1IUz7MV+xTxy17qgYILFPAzzQ3osxJPRWD+Yl hq+e0NZPVzSLk+Ow5c5i9XNy0OnuEH3u4gDYTfaM2yXk15S2Ux2hgKMCWGugA9sC/2c2 A09sXaB9jWZLQ6DqT/Ni10GKKSPtZJQjpG2ft1qyqdv8z2IjUUY7jxoOUMjlh4X8RLvx +bvQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c200si868302ybf.355.2019.03.07.02.10.21 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 07 Mar 2019 02:10:21 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([127.0.0.1]:48488 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1pyn-0006RW-DM for patch@linaro.org; Thu, 07 Mar 2019 05:10:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1pvq-00044u-2m for qemu-devel@nongnu.org; Thu, 07 Mar 2019 05:07:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1pvo-0007Uj-JN for qemu-devel@nongnu.org; Thu, 07 Mar 2019 05:07:17 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:53559) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1pvo-0007Tr-2Y for qemu-devel@nongnu.org; Thu, 07 Mar 2019 05:07:16 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MqJyX-1ggVgS1yFf-00nOnl; Thu, 07 Mar 2019 11:07:03 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Thu, 7 Mar 2019 11:06:50 +0100 Message-Id: <20190307100656.14044-4-laurent@vivier.eu> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190307100656.14044-1-laurent@vivier.eu> References: <20190307100656.14044-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:8R4sioWsjeSQoQBolvdH0WYJpxsKiToch9EhROvgEUxNuhWb/b6 3apstc/848r8PPYLO7nOlaywVqOAzkvVNGuGucxJfx+9q8uHCuttbFCGwArmC8d6/MAfLOC 2BLEhbCUMJZGjuXCLjRFSqYnsm9CVEupH3sSW57BtthG8fJVek7CyIvq6gQmFopIGdQLIl8 mjf+9NBF0DgUbv74EBx1g== X-UI-Out-Filterresults: notjunk:1; V03:K0:ckyG3+OTvRQ=:KmTWP3abWlCf8KGyYiA97+ 0eVT6OPxmzNMED2C17MDZ6Q0mz3azHGNBV84C4fOtvbcT4h5NNcZYUB2KdL1gxxmYwjRBWp5G YTbWrohQDU70ZdD9fhsKh6JdoohYp2ovrTJ3dGnbn+2nK7kNvhdWKUklETcQQ8iqA9DacUCDc DM2pFGn2FeW2PvEVQPyNOAr0V3ZwNMFssoSEcUeNOtvFsQMX5McJujOcghdmNfe6Evv9FviEq QwtY5nydTmhhcBRMEUhz+zWPlYppJrg8+8bZ/KcE5WHgJcsSHe3vpamNBJ4o8uQ9zdneEGbID CPvqKXXEHbGQcn3GuxIsK3L2TJ34UmjuL5U+FmdsoroWAn/354PkytmWgaTRZ4NlSxlSdcq0g gzsJP+quIlUlyuX2wR23CwsnCOLig2LEDJRTI/A9GwBGfk1+MuT8cG6EnJCDlF8SPw4YfmghS doXnhIrhQLzu+PdnKuiqZvdQQz5sEsZDJuy6DXNH22flN67XJ6TAhDTfLDS7J9ku/ui6WJ8gt Jw7JBYgb48VPNucyQnLpM8OX0wj20vVyQepqdwl3pfI7yW0fRJOQb8FwzGo63j5VT7RxjoO2l i7OvJcvz9E8xAHGGiqZ6qmT8BEH2gMYwIThjvjR1Kc7xVf2rrT6e9rcOD+9F8Wm0YsJX53HXq 0QZS3l9lFJ2zUjk1pknw7RZu8d8NU+QehVV33GR1tZgqo9e/ufrL2yeTwC6FK4qtZCtzvLLD3 /h/qJu8Lg+TrvZ+tLYCe1eNcPnIXapBckktLXA== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.13 Subject: [Qemu-devel] [PULL 3/9] linux-user: Fix ELF_PLATFORM for aarch64_be-linux-user 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: , Cc: Riku Voipio , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier Message-Id: <20190212074840.13542-3-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/elfload.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 940a97a2f2e9..c1a26021f8d7 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -537,7 +537,11 @@ static const char *get_elf_platform(void) #define ELF_ARCH EM_AARCH64 #define ELF_CLASS ELFCLASS64 -#define ELF_PLATFORM "aarch64" +#ifdef TARGET_WORDS_BIGENDIAN +# define ELF_PLATFORM "aarch64_be" +#else +# define ELF_PLATFORM "aarch64" +#endif static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop)