forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
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 && str_has_prefix((char *)elf->e_ident + 1, "ELF")) {
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);