6 Commits

5 changed files with 8 additions and 14 deletions

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.5...3.18)
project(patchelfcrc LANGUAGES C)

View File

@@ -61,7 +61,7 @@
: Export the calculated files to an XML file *XMLFILE*.
**--import**=*XMLFILE*
: Import the CRCs from an XML file *XMLFILE* and do not caclulate anything in the given *ELF*
: Import the CRCs from an XML file *XMLFILE* and do not calculate anything in the given *ELF*
**--help**, **-h**, **-?**
: Print help.
@@ -134,7 +134,7 @@
**patchelfcrc** -l -g word --start-magic=0x12345678 --end-magic=0x8754321 -p crc-32-mpeg -f bare -O .outputsection -S .text executable.elf
: Calculate the CRC over *.text* section and place the result in the *.outputsection* section.
The output sections start and end are checked for the given magic numbers in order to assure correct memory layout.
The output sections start and end are checked for the given magic numbers in order to ensure correct memory layout.
*CRC-32-MPEG* is used as CRC algorithm.
The memory is interpreted as *little endian* and the CRC calculation granularity is a 32 bit *word*.

View File

@@ -239,12 +239,11 @@ static void prepare_default_opts(struct command_line_options *opts)
opts->output_section = NULL;
opts->export_xml = NULL;
opts->import_xml = NULL;
opts->force_nocolor = false;
}
static void print_verbose_start_info(const struct command_line_options *cmd_opts)
{
int i;
SlList *list_iter;
const struct named_crc *predef_crc;
print_debug("Start CRC patching\n");
@@ -278,11 +277,6 @@ static void print_verbose_start_info(const struct command_line_options *cmd_opts
if (cmd_opts->import_xml)
print_debug("Import CRCs from '%s'\n", cmd_opts->import_xml);
if (cmd_opts->section_list) {
for (list_iter = cmd_opts->section_list, i = 1; list_iter; list_iter = sl_list_next(list_iter), i++)
print_debug("Input section [%d]: \"%s\"\n", i, (const char *)list_iter->data);
}
}
static void free_cmd_args(struct command_line_options *opts)
@@ -459,7 +453,7 @@ int main(int argc, char **argv)
print_warn("--use-vma option only has an effect when exporting as struct output.\n");
if (!cmd_opts.output_section && cmd_opts.export_xml == NULL)
print_warn("No output section / XML export specified. Will continue but not create any output\n");
print_warn("No output section or XML export specified. Will continue but not create any output.\n");
/* Prepare libelf for use with the latest ELF version */
elf_version(EV_CURRENT);
@@ -501,7 +495,7 @@ int main(int argc, char **argv)
if (cmd_opts.export_xml) {
if (xml_write_crcs_to_file(cmd_opts.export_xml, crc_data)) {
print_err("Error during XML generation\n");
print_err("Error during XML generation.\n");
ret = -3;
}
}