hc
2024-05-10 10ebd8556b7990499c896a550e3d416b444211e6
kernel/arch/alpha/boot/tools/objstrip.c
....@@ -148,7 +148,7 @@
148148 #ifdef __ELF__
149149 elf = (struct elfhdr *) buf;
150150
151
- if (elf->e_ident[0] == 0x7f && strncmp((char *)elf->e_ident + 1, "ELF", 3) == 0) {
151
+ if (memcmp(&elf->e_ident[EI_MAG0], ELFMAG, SELFMAG) == 0) {
152152 if (elf->e_type != ET_EXEC) {
153153 fprintf(stderr, "%s: %s is not an ELF executable\n",
154154 prog_name, inname);