/* we can't determine the number of sections that we'll have to create ahead of time,
* so we locally hold them until parsing is finished */
/* we can't determine the number of sections that we'll have to create ahead of time,
* so we locally hold them until parsing is finished */
if ((field32(elf, elf->segments[i].p_type) == PT_LOAD) && (field32(elf, elf->segments[i].p_filesz) != 0))
image->num_sections++;
/* alloc and fill sections array with loadable segments */
if ((field32(elf, elf->segments[i].p_type) == PT_LOAD) && (field32(elf, elf->segments[i].p_filesz) != 0))
image->num_sections++;
/* alloc and fill sections array with loadable segments */
for (i = 0,j = 0;i < elf->segment_count;i++)
{
if ((field32(elf, elf->segments[i].p_type) == PT_LOAD) && (field32(elf, elf->segments[i].p_filesz) != 0))
for (i = 0,j = 0;i < elf->segment_count;i++)
{
if ((field32(elf, elf->segments[i].p_type) == PT_LOAD) && (field32(elf, elf->segments[i].p_filesz) != 0))
-static int image_elf_read_section(image_t *image, int section, uint32_t offset, uint32_t size, uint8_t *buffer, uint32_t *size_read)
+static int image_elf_read_section(struct image *image, int section, uint32_t offset, uint32_t size, uint8_t *buffer, uint32_t *size_read)
Elf32_Phdr *segment = (Elf32_Phdr *)image->sections[section].private;
uint32_t read_size,really_read;
int retval;
Elf32_Phdr *segment = (Elf32_Phdr *)image->sections[section].private;
uint32_t read_size,really_read;
int retval;
/* we can't determine the number of sections that we'll have to create ahead of time,
* so we locally hold them until parsing is finished */
/* we can't determine the number of sections that we'll have to create ahead of time,
* so we locally hold them until parsing is finished */
image->sections[0].base_address = 0x0;
image->sections[0].size = image_binary->fileio.size;
image->sections[0].flags = 0;
image->sections[0].base_address = 0x0;
image->sections[0].size = image_binary->fileio.size;
image->sections[0].flags = 0;
if ((retval = fileio_open(&image_elf->fileio, url, FILEIO_READ, FILEIO_BINARY)) != ERROR_OK)
{
if ((retval = fileio_open(&image_elf->fileio, url, FILEIO_READ, FILEIO_BINARY)) != ERROR_OK)
{
image->sections[0].base_address = 0x0;
image->sections[0].size = 0xffffffff;
image->sections[0].flags = 0;
image->sections[0].base_address = 0x0;
image->sections[0].size = 0xffffffff;
image->sections[0].flags = 0;
if ((retval = fileio_open(&image_mot->fileio, url, FILEIO_READ, FILEIO_TEXT)) != ERROR_OK)
{
if ((retval = fileio_open(&image_mot->fileio, url, FILEIO_READ, FILEIO_TEXT)) != ERROR_OK)
{
-int image_read_section(image_t *image, int section, uint32_t offset, uint32_t size, uint8_t *buffer, uint32_t *size_read)
+int image_read_section(struct image *image, int section, uint32_t offset, uint32_t size, uint8_t *buffer, uint32_t *size_read)
-int image_add_section(image_t *image, uint32_t base, uint32_t size, int flags, uint8_t *data)
+int image_add_section(struct image *image, uint32_t base, uint32_t size, int flags, uint8_t *data)