diff options
-rw-r--r-- | utils/sbtools/elf.c | 7 | ||||
-rw-r--r-- | utils/sbtools/elftosb.c | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/utils/sbtools/elf.c b/utils/sbtools/elf.c index 0590a24692..0acaf8dcd8 100644 --- a/utils/sbtools/elf.c +++ b/utils/sbtools/elf.c | |||
@@ -360,7 +360,7 @@ bool elf_read_file(struct elf_params_t *params, elf_read_fn_t read, | |||
360 | if(ehdr.e_ident[EI_DATA] != ELFDATA2LSB) | 360 | if(ehdr.e_ident[EI_DATA] != ELFDATA2LSB) |
361 | error_printf("invalid elf data encoding: must be 32-bit lsb\n"); | 361 | error_printf("invalid elf data encoding: must be 32-bit lsb\n"); |
362 | if(ehdr.e_ident[EI_VERSION] != EV_CURRENT) | 362 | if(ehdr.e_ident[EI_VERSION] != EV_CURRENT) |
363 | error_printf("invalid elf version"); | 363 | error_printf("invalid elf version\n"); |
364 | if(ehdr.e_type != ET_EXEC) | 364 | if(ehdr.e_type != ET_EXEC) |
365 | error_printf("invalid elf file: must be an executable file\n"); | 365 | error_printf("invalid elf file: must be an executable file\n"); |
366 | if(ehdr.e_machine != EM_ARM) | 366 | if(ehdr.e_machine != EM_ARM) |
@@ -371,8 +371,7 @@ bool elf_read_file(struct elf_params_t *params, elf_read_fn_t read, | |||
371 | error_printf("invalid elf file: program header size mismatch\n"); | 371 | error_printf("invalid elf file: program header size mismatch\n"); |
372 | if(ehdr.e_shnum > 0 && ehdr.e_shentsize != sizeof(Elf32_Shdr)) | 372 | if(ehdr.e_shnum > 0 && ehdr.e_shentsize != sizeof(Elf32_Shdr)) |
373 | error_printf("invalid elf file: section header size mismatch\n"); | 373 | error_printf("invalid elf file: section header size mismatch\n"); |
374 | if(ehdr.e_flags & EF_ARM_HASENTRY) | 374 | elf_set_start_addr(params, ehdr.e_entry); |
375 | elf_set_start_addr(params, ehdr.e_entry); | ||
376 | 375 | ||
377 | char *strtab = NULL; | 376 | char *strtab = NULL; |
378 | if(ehdr.e_shstrndx != SHN_UNDEF) | 377 | if(ehdr.e_shstrndx != SHN_UNDEF) |
@@ -403,7 +402,7 @@ bool elf_read_file(struct elf_params_t *params, elf_read_fn_t read, | |||
403 | { | 402 | { |
404 | void *data = xmalloc(shdr.sh_size); | 403 | void *data = xmalloc(shdr.sh_size); |
405 | if(!read(user, shdr.sh_offset, data, shdr.sh_size)) | 404 | if(!read(user, shdr.sh_offset, data, shdr.sh_size)) |
406 | error_printf("error read self section data"); | 405 | error_printf("error read self section data\n"); |
407 | elf_add_load_section(params, shdr.sh_addr, shdr.sh_size, data); | 406 | elf_add_load_section(params, shdr.sh_addr, shdr.sh_size, data); |
408 | 407 | ||
409 | if(strtab) | 408 | if(strtab) |
diff --git a/utils/sbtools/elftosb.c b/utils/sbtools/elftosb.c index de041f9207..88c784734a 100644 --- a/utils/sbtools/elftosb.c +++ b/utils/sbtools/elftosb.c | |||
@@ -601,7 +601,7 @@ static struct sb_file_t *apply_cmd_file(struct cmd_file_t *cmd_file) | |||
601 | else if(cinst->type == CMD_JUMP || cinst->type == CMD_CALL) | 601 | else if(cinst->type == CMD_JUMP || cinst->type == CMD_CALL) |
602 | { | 602 | { |
603 | if(!elf_get_start_addr(elf, NULL)) | 603 | if(!elf_get_start_addr(elf, NULL)) |
604 | bug("cannot jump/call '%s' because it has no starting point !", cinst->identifier); | 604 | bug("cannot jump/call '%s' because it has no starting point !\n", cinst->identifier); |
605 | sec->nr_insts++; | 605 | sec->nr_insts++; |
606 | } | 606 | } |
607 | 607 | ||