summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvpalatin <vpalatin@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-03-07 16:51:37 +0000
committervpalatin <vpalatin@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-03-07 16:51:37 +0000
commita3f35e348e535c2610e67390d466f49c3f0d9f42 (patch)
tree908ccf8fa6109253627bcf6eed43ebb388baee43
parent984e9f0e4435afdd24edd3d83dff0145a2613821 (diff)
downloadopenocd_libswd-a3f35e348e535c2610e67390d466f49c3f0d9f42.tar.gz
openocd_libswd-a3f35e348e535c2610e67390d466f49c3f0d9f42.tar.bz2
openocd_libswd-a3f35e348e535c2610e67390d466f49c3f0d9f42.tar.xz
openocd_libswd-a3f35e348e535c2610e67390d466f49c3f0d9f42.zip
- fix cross endian ELF loading
git-svn-id: svn://svn.berlios.de/openocd/trunk@473 b42882b7-edfa-0310-969c-e2dbd0fdcd60
-rw-r--r--src/target/image.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/target/image.c b/src/target/image.c
index 39df4aef..df69f3a8 100644
--- a/src/target/image.c
+++ b/src/target/image.c
@@ -381,14 +381,12 @@ int image_elf_read_headers(image_t *image)
return ERROR_IMAGE_FORMAT_ERROR;
}
-
- if ((retval = fileio_seek(&elf->fileio, elf->header->e_phoff)) != ERROR_OK)
+ if ((retval = fileio_seek(&elf->fileio, field32(elf,elf->header->e_phoff))) != ERROR_OK)
{
ERROR("cannot seek to ELF program header table, read failed");
return retval;
}
-
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)