Skip to content

Commit b164ae0

Browse files
committed
Fix elf_parser tool
1 parent d006202 commit b164ae0

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/elf.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ int elf_hdr_size(const unsigned char *ehdr)
181181
}
182182
return sz;
183183
}
184-
184+
#if !defined(MMU) && !defined(WOLFBOOT_FSP)
185185
int elf_store_image_scattered(const unsigned char *hdr, unsigned long *entry_out, int ext_flash) {
186186
const unsigned char *image;
187187
int is_elf32;
@@ -274,6 +274,7 @@ int elf_store_image_scattered(const unsigned char *hdr, unsigned long *entry_out
274274
}
275275
return 0;
276276
}
277+
#endif
277278

278279

279280
int elf_load_image(uint8_t *image, uintptr_t *entry, int ext_flash)

tools/elf-parser/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
CC=gcc
66
CFLAGS=-Wall -g -ggdb
7-
CFLAGS+=-I../../include -DWOLFBOOT_ELF -DELF_PARSER -DPRINTF_ENABLED
7+
CFLAGS+=-I../../include -DWOLFBOOT_ELF -DELF_PARSER -DPRINTF_ENABLED -DMMU -DARCH_FLASH_OFFSET=0
88
EXE=elf-parser
99

1010
LIBS=

tools/elf-parser/elf-parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ int main(int argc, char *argv[])
7070
fclose(f);
7171

7272
if (ret == 0) {
73-
ret = elf_load_image(image, &entry);
73+
ret = elf_load_image_mmu(image, &entry, NULL);
7474
}
7575

7676
printf("Return %d, Load %p\n", ret, (void*)entry);

0 commit comments

Comments
 (0)