- fix cross endian ELF loading

git-svn-id: svn://svn.berlios.de/openocd/trunk@473 b42882b7-edfa-0310-969c-e2dbd0fdcd60
__archive__
vpalatin 2008-03-07 16:51:37 +00:00
parent 984e9f0e44
commit a3f35e348e
1 changed files with 1 additions and 3 deletions

View File

@ -381,14 +381,12 @@ int image_elf_read_headers(image_t *image)
return ERROR_IMAGE_FORMAT_ERROR; return ERROR_IMAGE_FORMAT_ERROR;
} }
if ((retval = fileio_seek(&elf->fileio, field32(elf,elf->header->e_phoff))) != ERROR_OK)
if ((retval = fileio_seek(&elf->fileio, elf->header->e_phoff)) != ERROR_OK)
{ {
ERROR("cannot seek to ELF program header table, read failed"); ERROR("cannot seek to ELF program header table, read failed");
return retval; return retval;
} }
elf->segments = malloc(elf->segment_count*sizeof(Elf32_Phdr)); elf->segments = malloc(elf->segment_count*sizeof(Elf32_Phdr));
if ((retval = fileio_read(&elf->fileio, elf->segment_count*sizeof(Elf32_Phdr), (u8*)elf->segments, &read_bytes)) != ERROR_OK) if ((retval = fileio_read(&elf->fileio, elf->segment_count*sizeof(Elf32_Phdr), (u8*)elf->segments, &read_bytes)) != ERROR_OK)