diff --git a/ChangeLog b/ChangeLog index 7a273c8..7bbe122 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2023-08-01 André Colomb + + * Fix exit code when writing to the output image file was + successful. The number of bytes written was returned and used as + exit code, when it should be zero on success and non-zero only on + error. + * Fix building without the custom post-processor module. An + undefined reference regarding the demo --skip-checksum error would + otherwise fail the build. + + * Release version 1.2 + 2023-07-03 André Colomb * Extend the --print option to accept a "defines" format diff --git a/configure.ac b/configure.ac index aded967..99b3623 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# Copyright (C) 2014, 2015, 2016, 2019, 2022 Andre Colomb +# Copyright (C) 2014, 2015, 2016, 2019, 2022, 2023 Andre Colomb # # This file is part of elf-mangle. # @@ -17,7 +17,7 @@ # . -AC_INIT([elf-mangle],[1.1],[src@andre.colomb.de]) +AC_INIT([elf-mangle],[1.2],[src@andre.colomb.de]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([src/elf-mangle.c]) AC_CONFIG_AUX_DIR([.]) @@ -147,7 +147,9 @@ AC_ARG_ENABLE([custom-options], [AS_HELP_STRING([--enable-custom-options], [Build extension module with custom options])], [AS_CASE([$enableval], - [yes], [custom_options=yes], + [yes], [custom_options=yes + AC_DEFINE([WITH_CUSTOM_OPTIONS], [1], + [Building extension module with custom options])], [no], [custom_options=no], [AC_MSG_ERROR([bad value ${enableval} for --enable-custom-options])]) ], @@ -161,7 +163,9 @@ AC_ARG_ENABLE([custom-fields], [AS_HELP_STRING([--enable-custom-fields], [Build extension module with custom known fields])], [AS_CASE([$enableval], - [yes], [custom_fields=yes], + [yes], [custom_fields=yes + AC_DEFINE([WITH_CUSTOM_FIELDS], [1], + [Building extension module with custom known fields])], [no], [custom_fields=no], [AC_MSG_ERROR([bad value ${enableval} for --enable-custom-fields])]) ], @@ -175,7 +179,9 @@ AC_ARG_ENABLE([custom-post-process], [AS_HELP_STRING([--enable-custom-post-process], [Build extension module with custom post-processors])], [AS_CASE([$enableval], - [yes], [custom_post_process=yes], + [yes], [custom_post_process=yes + AC_DEFINE([WITH_CUSTOM_POST_PROCESS], [1], + [Building extension module with custom post-processors])], [no], [custom_post_process=no], [AC_MSG_ERROR([bad value ${enableval} for --enable-custom-post-process])]) ], diff --git a/po/de.po b/po/de.po index 13dc320..fc8b8c3 100644 --- a/po/de.po +++ b/po/de.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: elf-mangle 0.7\n" "Report-Msgid-Bugs-To: src@andre.colomb.de\n" -"POT-Creation-Date: 2023-07-03 01:23+0200\n" +"POT-Creation-Date: 2023-08-01 11:24+0200\n" "PO-Revision-Date: 2023-07-03 01:25+0200\n" "Last-Translator: André Colomb \n" "Language-Team: German\n" @@ -88,16 +88,16 @@ msgstr "NUMMER" msgid "Override system serial number in output" msgstr "System-Seriennummer in Ausgabe überschreiben" -#: src/custom_options.c:72 +#: src/custom_options.c:73 msgid "Skip CRC update post-processor" msgstr "Anpassung der Prüfsumme in Post-Prozessor überspringen" -#: src/custom_options.c:113 +#: src/custom_options.c:115 #, c-format msgid "Invalid serial number `%s' specified." msgstr "Ungültige Seriennummer '%s' angegeben." -#: src/custom_options.c:138 +#: src/custom_options.c:142 msgid "Example-specific options:" msgstr "Optionen spezifisch für Beispiel:" diff --git a/src/custom_options.c b/src/custom_options.c index eff1566..2d89d74 100644 --- a/src/custom_options.c +++ b/src/custom_options.c @@ -68,8 +68,10 @@ static const struct argp_option dummy_options[] = { { "set-serial", OPT_SET_SERIAL, N_("NUMBER"), 0, N_("Override system serial number in output"), 0 }, +#if WITH_CUSTOM_POST_PROCESS { "skip-checksum", OPT_SKIP_CHECKSUM, 0, 0, N_("Skip CRC update post-processor"), 0 }, +#endif { 0 } }; @@ -114,9 +116,11 @@ dummy_parse_opt( } break; +#if WITH_CUSTOM_POST_PROCESS case OPT_SKIP_CHECKSUM: post_process_disable_checksum_update(); break; +#endif default: return ARGP_ERR_UNKNOWN; diff --git a/src/elf-mangle.c b/src/elf-mangle.c index 6151062..3828876 100644 --- a/src/elf-mangle.c +++ b/src/elf-mangle.c @@ -73,8 +73,9 @@ process_final_map(const tool_config* restrict config, if (config->image_out) r = image_write_file( config->image_out, symbol_map_blob_address(map), symbol_map_blob_size(map), config->format_out); + if (r < 0) return r; - return r; + return 0; }