Allow loading from ELF32 files with incorrect machine types.
This commit is contained in:
parent
7703c34664
commit
6ad23b49f5
8
devcmd.c
8
devcmd.c
|
@ -306,8 +306,8 @@ static int cmd_dis(cproc_t cp, char **arg)
|
||||||
|
|
||||||
struct hexout_data {
|
struct hexout_data {
|
||||||
FILE *file;
|
FILE *file;
|
||||||
uint16_t addr;
|
uint16_t addr;
|
||||||
uint8_t buf[16];
|
uint8_t buf[16];
|
||||||
int len;
|
int len;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -447,8 +447,8 @@ fail:
|
||||||
struct prog_data {
|
struct prog_data {
|
||||||
device_t dev;
|
device_t dev;
|
||||||
|
|
||||||
uint8_t buf[128];
|
uint8_t buf[128];
|
||||||
uint16_t addr;
|
uint16_t addr;
|
||||||
int len;
|
int len;
|
||||||
int have_erased;
|
int have_erased;
|
||||||
};
|
};
|
||||||
|
|
8
elf32.c
8
elf32.c
|
@ -173,10 +173,10 @@ static int read_all(struct elf32_info *info, FILE *in)
|
||||||
|
|
||||||
if (read_ehdr(info, in) < 0)
|
if (read_ehdr(info, in) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (info->file_ehdr.e_machine != EM_MSP430) {
|
|
||||||
fprintf(stderr, "elf32: this is not an MSP430 ELF32\n");
|
if (info->file_ehdr.e_machine != EM_MSP430)
|
||||||
return -1;
|
fprintf(stderr, "elf32: warning: unknown machine type: 0x%x\n",
|
||||||
}
|
info->file_ehdr.e_machine);
|
||||||
|
|
||||||
if (read_phdr(info, in) < 0)
|
if (read_phdr(info, in) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in New Issue