From 7087b66f19a7d60025f7315baa26d682804f3640 Mon Sep 17 00:00:00 2001 From: drath Date: Thu, 31 May 2007 11:17:54 +0000 Subject: - add support for ELF images (thanks to Vincent Palatin for this patch) git-svn-id: svn://svn.berlios.de/openocd/trunk@161 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/target/image.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/target/image.h') diff --git a/src/target/image.h b/src/target/image.h index 75288791..38a2b772 100644 --- a/src/target/image.h +++ b/src/target/image.h @@ -20,6 +20,7 @@ #ifndef IMAGE_H #define IMAGE_H +#include #include "fileio.h" #include "target.h" @@ -31,9 +32,9 @@ typedef enum image_type IMAGE_BINARY, /* plain binary */ IMAGE_IHEX, /* intel hex-record format */ IMAGE_MEMORY, /* target-memory pseudo-image */ + IMAGE_ELF, /* ELF binary */ /* * Possible future enhancements: - * IMAGE_ELF, * IMAGE_SRECORD, */ } image_type_t; @@ -43,6 +44,7 @@ typedef struct image_section_s u32 base_address; u32 size; int flags; + void *private; /* private data */ } image_section_t; typedef struct image_s @@ -75,6 +77,15 @@ typedef struct image_memory_s target_t *target; } image_memory_t; +typedef struct fileio_elf_s +{ + fileio_t fileio; + Elf32_Ehdr *header; + Elf32_Phdr *segments; + u32 segment_count; + u8 endianness; +} image_elf_t; + extern int image_open(image_t *image, void *source, enum fileio_access access); extern int image_read_section(image_t *image, int section, u32 offset, u32 size, u8 *buffer, u32 *size_read); extern int image_close(image_t *image); -- cgit v1.2.3