forked from len0rd/rockbox
sbtools: various fixes
Change-Id: I82c4642aea325cf22d66e9b49fc2d47319cd70eb
This commit is contained in:
parent
e69293ecdb
commit
8e69c37b5a
2 changed files with 5 additions and 2 deletions
|
|
@ -733,7 +733,10 @@ bool elf_read_file(struct elf_params_t *params, elf_read_fn_t read,
|
|||
sym->name = strdup(&symstrtab[symdata[j].st_name]);
|
||||
sym->addr = symdata[j].st_value;
|
||||
sym->size = symdata[j].st_size;
|
||||
sym->section = strdup(&strtab[shdr[symdata[j].st_shndx].sh_name]);
|
||||
if(symdata[j].st_shndx == SHN_ABS)
|
||||
sym->section = NULL;
|
||||
else
|
||||
sym->section = strdup(&strtab[shdr[symdata[j].st_shndx].sh_name]);
|
||||
switch(type)
|
||||
{
|
||||
case STT_FUNC: sym->type = ESYT_FUNC; break;
|
||||
|
|
|
|||
|
|
@ -308,7 +308,7 @@ void color(color_t c)
|
|||
|
||||
enum sb_version_guess_t guess_sb_version(const char *filename)
|
||||
{
|
||||
#define ret(x) do { fclose(f); return x; } while(0)
|
||||
#define ret(x) do { if(f) fclose(f); return x; } while(0)
|
||||
FILE *f = fopen(filename, "rb");
|
||||
if(f == NULL)
|
||||
ret(SB_VERSION_ERR);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue