Allow loading from ELF32 files with incorrect machine types.

This commit is contained in:
Daniel Beer 2010-05-27 13:58:00 +12:00
parent 7703c34664
commit 6ad23b49f5
2 changed files with 8 additions and 8 deletions

View File

@ -306,8 +306,8 @@ static int cmd_dis(cproc_t cp, char **arg)
struct hexout_data {
FILE *file;
uint16_t addr;
uint8_t buf[16];
uint16_t addr;
uint8_t buf[16];
int len;
};
@ -447,8 +447,8 @@ fail:
struct prog_data {
device_t dev;
uint8_t buf[128];
uint16_t addr;
uint8_t buf[128];
uint16_t addr;
int len;
int have_erased;
};

View File

@ -173,10 +173,10 @@ static int read_all(struct elf32_info *info, FILE *in)
if (read_ehdr(info, in) < 0)
return -1;
if (info->file_ehdr.e_machine != EM_MSP430) {
fprintf(stderr, "elf32: this is not an MSP430 ELF32\n");
return -1;
}
if (info->file_ehdr.e_machine != EM_MSP430)
fprintf(stderr, "elf32: warning: unknown machine type: 0x%x\n",
info->file_ehdr.e_machine);
if (read_phdr(info, in) < 0)
return -1;