Start XML export functiionality

This commit is contained in:
2022-12-17 19:15:45 +01:00
parent 320b0ce650
commit 681a66e127
6 changed files with 177 additions and 7 deletions

View File

@@ -50,6 +50,19 @@ elfpatch_handle_t *elf_patch_open(const char *path, bool readonly);
*/
int elf_patch_check_for_section(elfpatch_handle_t *ep, const char *section);
/**
* @brief Get VMA, LMA and size of section
* @param ep Elfpatch handle
* @param[in] section section name
* @param[out] vma Virtual Memory Address. May be NULL.
* @param[out] len Size of section in bytes. May be NULL.
* @return 0 if successful
* @return -1 if section is not found
* @return -1000 and below: Parameter error.
*/
int elf_patch_get_section_address(elfpatch_handle_t *ep, const char *section,
uint64_t *vma, uint64_t *len);
/**
* @brief Compute CRC over a section in an ELF file
* @param ep Elf patch object

14
include/patchelfcrc/xml.h Normal file
View File

@@ -0,0 +1,14 @@
#ifndef _ELFPATCHCRC_XML_H_
#define _ELFPATCHCRC_XML_H_
#include <stdint.h>
#include <linklist-lib/singly-linked-list.h>
#include <patchelfcrc/crc.h>
#include <patchelfcrc/elfpatch.h>
void xml_init(void);
int xml_write_crcs_to_file(const char *path, const uint32_t *crcs, SlList *section_names,
const struct crc_settings *crc_params, elfpatch_handle_t *ep);
#endif /* _ELFPATCHCRC_XML_H_ */