From: Antony Pavlov <antonynpavlov@gmail.com>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] MIPS: fix elf_check_arch(x)
Date: Mon, 9 Sep 2024 23:51:30 +0300 [thread overview]
Message-ID: <20240909205130.46062-1-antonynpavlov@gmail.com> (raw)
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
arch/mips/include/asm/elf.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/mips/include/asm/elf.h b/arch/mips/include/asm/elf.h
index 3dd6b82357e..ca0fb55069e 100644
--- a/arch/mips/include/asm/elf.h
+++ b/arch/mips/include/asm/elf.h
@@ -14,12 +14,14 @@
#ifndef ELF_ARCH
-#ifdef CONFIG_32BIT
+#define EM_MIPS 8 /* MIPS R3000 (officially, big-endian only) */
/*
* This is used to ensure we don't load something for the wrong architecture.
*/
-#define elf_check_arch(hdr) \
+#define elf_check_arch(x) ((x)->e_machine == EM_MIPS)
+
+#ifdef CONFIG_32BIT
/*
* These are used to set parameters in the core dumps.
*/
--
2.45.2
next reply other threads:[~2024-09-09 20:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-09 20:51 Antony Pavlov [this message]
2024-09-11 8:40 ` Sascha Hauer
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=20240909205130.46062-1-antonynpavlov@gmail.com \
--to=antonynpavlov@gmail.com \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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