aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorT Karthik Reddy <t.karthik.reddy@xilinx.com>2019-03-16 15:23:03 +0530
committerMichal Simek <michal.simek@xilinx.com>2019-10-24 13:37:02 +0200
commit1ed8c137304c8bd19eeadc98a376dfec9575ebe0 (patch)
treef43e4a0cc48ec6c176aca17a04b8ba14cd69e150
parentef92ed26a5a301e802a6d16fd2fd9d68570bf17f (diff)
downloadu-boot-1ed8c137304c8bd19eeadc98a376dfec9575ebe0.zip
u-boot-1ed8c137304c8bd19eeadc98a376dfec9575ebe0.tar.gz
u-boot-1ed8c137304c8bd19eeadc98a376dfec9575ebe0.tar.bz2
common: image-sig.c: Add manual relocation
This patch adds manual relocation for struct checksum_algo & struct crypto_algo structures. Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com> Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
-rw-r--r--common/image-sig.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/common/image-sig.c b/common/image-sig.c
index 004fbc5..639a112 100644
--- a/common/image-sig.c
+++ b/common/image-sig.c
@@ -89,6 +89,21 @@ struct checksum_algo *image_get_checksum_algo(const char *full_name)
int i;
const char *name;
+#if !defined(USE_HOSTCC) && defined(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;
+#if IMAGE_ENABLE_SIGN
+ checksum_algos[i].calculate_sign += gd->reloc_off;
+#endif
+ checksum_algos[i].calculate += gd->reloc_off;
+ }
+ }
+#endif
+
for (i = 0; i < ARRAY_SIZE(checksum_algos); i++) {
name = checksum_algos[i].name;
/* Make sure names match and next char is a comma */
@@ -105,6 +120,20 @@ struct crypto_algo *image_get_crypto_algo(const char *full_name)
int i;
const char *name;
+#if !defined(USE_HOSTCC) && defined(CONFIG_NEEDS_MANUAL_RELOC)
+ static bool done;
+
+ if (!done) {
+ done = true;
+ for (i = 0; i < ARRAY_SIZE(crypto_algos); i++) {
+ crypto_algos[i].name += gd->reloc_off;
+ crypto_algos[i].sign += gd->reloc_off;
+ crypto_algos[i].add_verify_data += gd->reloc_off;
+ crypto_algos[i].verify += gd->reloc_off;
+ }
+ }
+#endif
+
/* Move name to after the comma */
name = strchr(full_name, ',');
if (!name)