11 enum elf_section_type_t
21 enum elf_section_type_t type
;
26 struct elf_section_t
*next
;
27 /* Internal to elf_write_file */
35 struct elf_section_t
*first_section
;
36 struct elf_section_t
*last_section
;
39 typedef bool (*elf_read_fn_t
)(void *user
, uint32_t addr
, void *buf
, size_t count
);
40 /* write function manages it's own error state */
41 typedef void (*elf_write_fn_t
)(void *user
, uint32_t addr
, const void *buf
, size_t count
);
42 typedef void (*elf_printf_fn_t
)(void *user
, bool error
, const char *fmt
, ...);
44 void elf_init(struct elf_params_t
*params
);
45 void elf_add_load_section(struct elf_params_t
*params
,
46 uint32_t load_addr
, uint32_t size
, const void *section
);
47 void elf_add_fill_section(struct elf_params_t
*params
,
48 uint32_t fill_addr
, uint32_t size
, uint32_t pattern
);
49 void elf_write_file(struct elf_params_t
*params
, elf_write_fn_t write
, void *user
);
50 bool elf_read_file(struct elf_params_t
*params
, elf_read_fn_t read
, elf_printf_fn_t printf
,
52 bool elf_is_empty(struct elf_params_t
*params
);
53 void elf_set_start_addr(struct elf_params_t
*params
, uint32_t addr
);
54 bool elf_get_start_addr(struct elf_params_t
*params
, uint32_t *addr
);
55 int elf_get_nr_sections(struct elf_params_t
*params
);
56 void elf_release(struct elf_params_t
*params
);