forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-02-19 151fecfb72a0d602dfe79790602ef64b4e241574
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);