]> git.sur5r.net Git - openocd/commitdiff
- fix cross endian ELF loading
authorvpalatin <vpalatin@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Fri, 7 Mar 2008 16:51:37 +0000 (16:51 +0000)
committervpalatin <vpalatin@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Fri, 7 Mar 2008 16:51:37 +0000 (16:51 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@473 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/target/image.c

index 39df4aef163e9ab63257c3a0b7403090cfecb673..df69f3a80a6397bd70f914a81b0b3d8ef41e855c 100644 (file)
@@ -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)