]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
image-fit: Fix FIT_CIPHER linking
authorJoel Stanley <joel@jms.id.au>
Tue, 8 Dec 2020 04:12:14 +0000 (14:42 +1030)
committerTom Rini <trini@konsulko.com>
Fri, 22 Jan 2021 21:17:52 +0000 (16:17 -0500)
When CONFIG_FIT_CIPHER=y and CONFIG_FIT_SIGNATURE=n is there is no
implementation of image_get_host_blob for mkimage/dumpimage:

 /usr/bin/ld: tools/common/image-cipher.o: in function `fit_image_decrypt_data':
 image-cipher.c:(.text+0x9a): undefined reference to `image_get_host_blob'

Move the implementation to a common file so it can be shaed between
image-cipher.c and image-fit-sig.c.

Signed-off-by: Joel Stanley <joel@jms.id.au>
common/image-fit-sig.c
common/image-fit.c

index 5401d9411b986a34ae3328b1b25dc8def7c50310..d39741e9058f5fb153fd1385e30508564227859e 100644 (file)
@@ -19,20 +19,6 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define IMAGE_MAX_HASHED_NODES         100
 
-#ifdef USE_HOSTCC
-void *host_blob;
-
-void image_set_host_blob(void *blob)
-{
-       host_blob = blob;
-}
-
-void *image_get_host_blob(void)
-{
-       return host_blob;
-}
-#endif
-
 /**
  * fit_region_make_list() - Make a list of image regions
  *
index 21c44bdf691d8f3320fa501cc9248142828b34cc..8660c3fd819a03bc7caa50eca7dcb46cfbfe71d3 100644 (file)
@@ -112,6 +112,21 @@ int fit_parse_subimage(const char *spec, ulong addr_curr,
 }
 #endif /* !USE_HOSTCC */
 
+#ifdef USE_HOSTCC
+/* Host tools use these implementations for Cipher and Signature support */
+static void *host_blob;
+
+void image_set_host_blob(void *blob)
+{
+       host_blob = blob;
+}
+
+void *image_get_host_blob(void)
+{
+       return host_blob;
+}
+#endif /* USE_HOSTCC */
+
 static void fit_get_debug(const void *fit, int noffset,
                char *prop_name, int err)
 {