#include <elf.h>
#include <errno.h>
#include <fcntl.h>
+#include <inttypes.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
if (ehdr_field(e_type) != ET_EXEC) {
fprintf(stderr, "Input ELF is not an executable\n");
- printf("type 0x%lx\n", ehdr_field(e_type));
+ printf("type 0x%" PRIx64 "\n", ehdr_field(e_type));
err = -EINVAL;
goto out_free_relocs;
}
rel_size = shdr_field(i_rel_shdr, sh_size);
rel_actual_size = buf - buf_start;
if (rel_actual_size > rel_size) {
- fprintf(stderr, "Relocations overflow available space of 0x%lx (required 0x%lx)!\n",
+ fprintf(stderr, "Relocations overflow available space of 0x%zx (required 0x%zx)!\n",
rel_size, rel_actual_size);
- fprintf(stderr, "Please adjust CONFIG_MIPS_RELOCATION_TABLE_SIZE to at least 0x%lx\n",
+ fprintf(stderr, "Please adjust CONFIG_MIPS_RELOCATION_TABLE_SIZE to at least 0x%zx\n",
(rel_actual_size + 0x100) & ~0xFF);
err = -ENOMEM;
goto out_free_relocs;