1 // SPDX-License-Identifier: GPL-2.0
8 main(int argc
, char **argv
)
10 unsigned char ei
[EI_NIDENT
];
12 if (fread(ei
, 1, EI_NIDENT
, stdin
) != EI_NIDENT
) {
13 fprintf(stderr
, "Error: input truncated\n");
16 if (memcmp(ei
, ELFMAG
, SELFMAG
) != 0) {
17 fprintf(stderr
, "Error: not ELF\n");
20 switch (ei
[EI_CLASS
]) {
22 printf("#define KERNEL_ELFCLASS ELFCLASS32\n");
25 printf("#define KERNEL_ELFCLASS ELFCLASS64\n");