diff options
author | Tom Rini <trini@konsulko.com> | 2021-10-08 16:02:55 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-10-08 16:02:55 -0400 |
commit | 94e922c76a0e1fcdead3359e340f53fd0709a963 (patch) | |
tree | 667372191c3a70cd9343180c8d7f6273afbb9ab9 /common/image-sig.c | |
parent | 0caf37e973015255a3c5b9439ddb8c6aef1b5001 (diff) | |
parent | 4cb35b7a1fdf060a0839b71f6dbf8d08b1ae62e0 (diff) |
Merge branch '2021-10-08-image-cleanups'
- A large number of image file and tooling related cleanups
Diffstat (limited to 'common/image-sig.c')
-rw-r--r-- | common/image-sig.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/common/image-sig.c b/common/image-sig.c index fa9407bb30..1aa0b58645 100644 --- a/common/image-sig.c +++ b/common/image-sig.c @@ -9,6 +9,7 @@ #include <asm/global_data.h> DECLARE_GLOBAL_DATA_PTR; #include <image.h> +#include <relocate.h> #include <u-boot/ecdsa.h> #include <u-boot/rsa.h> #include <u-boot/hash-checksum.h> @@ -56,17 +57,19 @@ struct checksum_algo *image_get_checksum_algo(const char *full_name) int i; const char *name; -#if defined(CONFIG_NEEDS_MANUAL_RELOC) - static bool done; + if (IS_ENABLED(CONFIG_NEEDS_MANUAL_RELOC)) { + static bool done; - if (!done) { - done = true; - for (i = 0; i < ARRAY_SIZE(checksum_algos); i++) { - checksum_algos[i].name += gd->reloc_off; - checksum_algos[i].calculate += gd->reloc_off; + if (!done) { + done = true; + for (i = 0; i < ARRAY_SIZE(checksum_algos); i++) { + struct checksum_algo *algo = &checksum_algos[i]; + + MANUAL_RELOC(algo->name); + MANUAL_RELOC(algo->calculate); + } } } -#endif for (i = 0; i < ARRAY_SIZE(checksum_algos); i++) { name = checksum_algos[i].name; @@ -84,18 +87,19 @@ struct crypto_algo *image_get_crypto_algo(const char *full_name) struct crypto_algo *crypto, *end; const char *name; -#if defined(CONFIG_NEEDS_MANUAL_RELOC) - static bool done; - - if (!done) { - crypto = ll_entry_start(struct crypto_algo, cryptos); - end = ll_entry_end(struct crypto_algo, cryptos); - for (; crypto < end; crypto++) { - crypto->name += gd->reloc_off; - crypto->verify += gd->reloc_off; + if (IS_ENABLED(CONFIG_NEEDS_MANUAL_RELOC)) { + static bool done; + + if (!done) { + done = true; + crypto = ll_entry_start(struct crypto_algo, cryptos); + end = ll_entry_end(struct crypto_algo, cryptos); + for (; crypto < end; crypto++) { + MANUAL_RELOC(crypto->name); + MANUAL_RELOC(crypto->verify); + } } } -#endif /* Move name to after the comma */ name = strchr(full_name, ','); |