From: Christophe Lyon <christophe.lyon@st.com>
To: qemu-devel@nongnu.org, christophe.lyon@linaro.org,
peter.maydell@linaro.org, riku.voipio@iki.fi, laurent@vivier.eu
Subject: [Qemu-devel] [ARM/FDPIC v4 2/4] linux-user: ARM-FDPIC: Identify ARM FDPIC binaries
Date: Mon, 30 Apr 2018 10:03:42 +0200 [thread overview]
Message-ID: <20180430080404.7323-3-christophe.lyon@st.com> (raw)
In-Reply-To: <20180430080404.7323-1-christophe.lyon@st.com>
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>
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) application */
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index bbe93b0..76d7718 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -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)
{
--
2.6.3
next prev parent reply other threads:[~2018-04-30 8:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-30 8:03 [Qemu-devel] [ARM/FDPIC v4 0/4] FDPIC ABI for ARM Christophe Lyon
2018-04-30 8:03 ` [Qemu-devel] [ARM/FDPIC v4 1/4] Remove CONFIG_USE_FDPIC Christophe Lyon
2018-04-30 8:03 ` Christophe Lyon [this message]
2018-04-30 8:03 ` [Qemu-devel] [ARM/FDPIC v4 3/4] linux-user: ARM-FDPIC: Add support of FDPIC for ARM Christophe Lyon
2018-04-30 8:03 ` [Qemu-devel] [ARM/FDPIC v4 4/4] linux-user: ARM-FDPIC: Add support for signals for FDPIC targets Christophe Lyon
2018-04-30 8:11 ` [Qemu-devel] [ARM/FDPIC v4 0/4] FDPIC ABI for ARM Peter Maydell
2018-04-30 8:40 ` Christophe Lyon
2018-04-30 8:59 ` Peter Maydell
2018-04-30 9:08 ` Christophe Lyon
2018-04-30 9:12 ` Peter Maydell
2018-04-30 9:28 ` Laurent Vivier
2018-04-30 9:46 ` Peter Maydell
2018-04-30 9:47 ` Laurent Vivier
2018-04-30 12:03 ` Laurent Vivier
2018-05-02 8:38 ` Christophe Lyon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180430080404.7323-3-christophe.lyon@st.com \
--to=christophe.lyon@st.com \
--cc=christophe.lyon@linaro.org \
--cc=laurent@vivier.eu \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).