aboutsummaryrefslogtreecommitdiffstats
path: root/arch/alpha
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2023-01-11 20:43:59 +0000
committerMatt Turner <mattst88@gmail.com>2023-02-24 23:14:22 -0500
commita4c082f26718f7b2af6d62f5fd8b9759941c71c5 (patch)
tree42ce39a32fcf0a05249dc41616137b6fc95417b7 /arch/alpha
parent56efd34f8205ce24a97445184d819713dd3ce31e (diff)
downloadlinux-a4c082f26718f7b2af6d62f5fd8b9759941c71c5.tar.gz
alpha/boot/tools/objstrip: fix the check for ELF header
Just memcmp() with ELFMAG - that's the normal way to do it in userland code, which that thing is. Besides, that has the benefit of actually building - str_has_prefix() is *NOT* present in <string.h>. Fixes: 5f14596e55de "alpha: Replace strncmp with str_has_prefix" Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'arch/alpha')
-rw-r--r--arch/alpha/boot/tools/objstrip.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/alpha/boot/tools/objstrip.c b/arch/alpha/boot/tools/objstrip.c
index 08b430d25a315..7cf92d172dce9 100644
--- a/arch/alpha/boot/tools/objstrip.c
+++ b/arch/alpha/boot/tools/objstrip.c
@@ -148,7 +148,7 @@ main (int argc, char *argv[])
#ifdef __ELF__
elf = (struct elfhdr *) buf;
- if (elf->e_ident[0] == 0x7f && str_has_prefix((char *)elf->e_ident + 1, "ELF")) {
+ if (memcmp(&elf->e_ident[EI_MAG0], ELFMAG, SELFMAG) == 0) {
if (elf->e_type != ET_EXEC) {
fprintf(stderr, "%s: %s is not an ELF executable\n",
prog_name, inname);