forked from len0rd/rockbox
rknanoutils: fix crash with no prefix, remove debug code
Change-Id: I73e277a8dc2fbd5790b1d7173e449d883710f27a
This commit is contained in:
parent
906963ae76
commit
f62009303a
1 changed files with 2 additions and 13 deletions
|
|
@ -321,6 +321,8 @@ static void elf_write(void *user, uint32_t addr, const void *buf, size_t count)
|
|||
|
||||
static void extract_elf_section(struct elf_params_t *elf, int count)
|
||||
{
|
||||
if(g_out_prefix == NULL)
|
||||
return;
|
||||
char *filename = xmalloc(strlen(g_out_prefix) + 32);
|
||||
sprintf(filename, "%s%d.elf", g_out_prefix, count);
|
||||
if(g_debug)
|
||||
|
|
@ -341,19 +343,6 @@ static int do_nanostage_image(uint8_t *buf, unsigned long size)
|
|||
return 1;
|
||||
struct rknano_stage_header_t *hdr = (void *)buf;
|
||||
|
||||
uint32_t *buf32 = (void *)buf;
|
||||
cprintf(BLUE, "Dump\n");
|
||||
for(int j = 0; j < 2; j++)
|
||||
cprintf(YELLOW, "%8x ", buf32[j]);
|
||||
printf("\n");
|
||||
for(unsigned i = 0; i < hdr->count; i++)
|
||||
{
|
||||
for(int j = 0; j < 8; j++)
|
||||
cprintf(YELLOW, "%8x ", buf32[i * 8 + j + 2]);
|
||||
printf("\n");
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
cprintf(BLUE, "Header\n");
|
||||
cprintf(GREEN, " Base Address: ");
|
||||
cprintf(YELLOW, "%#08x\n", hdr->addr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue