]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
linux-user: ARM-FDPIC: Identify ARM FDPIC binaries
authorChristophe Lyon <christophe.lyon@st.com>
Mon, 30 Apr 2018 08:03:42 +0000 (10:03 +0200)
committerLaurent Vivier <laurent@vivier.eu>
Thu, 3 May 2018 16:25:29 +0000 (18:25 +0200)
Define an ARM-specific version of elf_is_fdpic:
FDPIC ELF objects are identified with e_ident[EI_OSABI] ==
ELFOSABI_ARM_FDPIC.

Co-Authored-By: Mickaël Guêné <mickael.guene@st.com>
Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20180430080404.7323-3-christophe.lyon@st.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
include/elf.h
linux-user/elfload.c

index c0dc9bb5fd493e905b8b1d0e18cf50688e50a5d4..934dbbd6b3ae4e3bf7df4c47466904eb1ce29b39 100644 (file)
@@ -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) application */
 
index bbe93b03b65d530c37c207993915cf66b26b2d8d..76d7718b3d4bd13d25ae4d97842c77e5b5192933 100644 (file)
@@ -1681,11 +1681,18 @@ static void zero_bss(abi_ulong elf_bss, abi_ulong last_bss, int prot)
     }
 }
 
+#ifdef TARGET_ARM
+static int elf_is_fdpic(struct elfhdr *exec)
+{
+    return exec->e_ident[EI_OSABI] == ELFOSABI_ARM_FDPIC;
+}
+#else
 /* Default implementation, always false.  */
 static int elf_is_fdpic(struct elfhdr *exec)
 {
     return 0;
 }
+#endif
 
 static abi_ulong loader_build_fdpic_loadmap(struct image_info *info, abi_ulong sp)
 {