From patchwork Mon Oct 14 12:56:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1176348 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.b="pgUJgMQ7"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46sJZb4Plxz9sPT for ; Tue, 15 Oct 2019 00:00:39 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 122D1C21E56; Mon, 14 Oct 2019 12:59:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id CD883C21EFD; Mon, 14 Oct 2019 12:59:09 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 57504C21F06; Mon, 14 Oct 2019 12:56:43 +0000 (UTC) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by lists.denx.de (Postfix) with ESMTPS id 37480C21EA8 for ; Mon, 14 Oct 2019 12:56:42 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id h4so19642503wrv.7 for ; Mon, 14 Oct 2019 05:56:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=76yJ1RJUsM9ZonubT71pXKvpQCku81mbIaig6UWjTs8=; b=pgUJgMQ7ut9mhiIdfsMjv1oUd8zzUhti7fiBz6yiGolfF8rfDtrtS5lModxl1UmWrL X+vQuwGNVcFf6OCQhTAq+lwygkyn56XhUxJG07Rnj+GftWWnH6vpuxQopvZJBKgRsLYR OEcVt4f7cwUVg/qkTb7PDY+Zg/i0CQXAdvQyIXmkdm6io5uYYfLnShNeKhcV5IA+spL6 y7sW2Oq/yeYzTUsM0q4zbypXQzPL5ZoA8H6WGnQ9G5tQaXvAhhwoQO2j+y2OeQEIne7n ba+/0nKP+m+dkjV1YwI07Uev2igB5mt8/G6E9LPCpNouzgV7MiW70XO1COmugd0X7VTr 4MHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references; bh=76yJ1RJUsM9ZonubT71pXKvpQCku81mbIaig6UWjTs8=; b=hkZ/Lka8/PgE4ZXvSp8LiugZU99TLqYtWBpQaabOKcWg/NeET+puZXJeaeDO7iKDrO usmvgKGuzwcQkwFvUFs501BACheRp6lwHAxzYAw0V3y4HtlsTKKG+eGY81rosEVRXl/t Wlm2yQccf5aCO8KEjieFtvsLWZHVKYd38EuHfQd7Ov3JBWS4VQ7HotfsxbAzJcmerkSr IykEQ90f1jAtVHqsdRGxNUHZk/htmwM986v7SoO/aswDRYEC+z2ovfoC52A3sNP4akxB ZM+4i+qtc5XIYa3vjJbmVBM4ajoZ+1eezTD5K6C68PyTxmXwNcO8snDGSt5FvGO2oW9p qWgw== X-Gm-Message-State: APjAAAU1hVEsxyFsEAmrRHRTkDSzrZvsd3uOsSqxAkwVNoMG76X5WAGk pVcUGmMYPjnhBzitjzsII1LQzit7Gqvu1Q== X-Google-Smtp-Source: APXvYqzD2yVK6jUrivq/zQLNXa72IUlWi+JTIwqquD8DJfwl91l52ta1Nd0iqwfu3DkbWpPA6pYYwQ== X-Received: by 2002:adf:f18a:: with SMTP id h10mr1448017wro.145.1571057801609; Mon, 14 Oct 2019 05:56:41 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id i11sm20558872wrw.57.2019.10.14.05.56.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Oct 2019 05:56:40 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Date: Mon, 14 Oct 2019 14:56:35 +0200 Message-Id: <2538531aba93f7bef01450e0c3640d99ad7c22aa.1571057794.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Cc: Joe Hershberger , T Karthik Reddy Subject: [U-Boot] [PATCH 1/3] common: hash: Manually relocate struct hash_algo X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: T Karthik Reddy This patch adds manual relocation for struct hash_algo if CONFIG_NEEDS_MANUAL_RELOC is enabled. Signed-off-by: T Karthik Reddy Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- common/hash.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/common/hash.c b/common/hash.c index d33e329897e1..d0d825e38986 100644 --- a/common/hash.c +++ b/common/hash.c @@ -30,6 +30,12 @@ #include #include +#if !defined(USE_HOSTCC) && defined(CONFIG_NEEDS_MANUAL_RELOC) +DECLARE_GLOBAL_DATA_PTR; +#endif + +static void reloc_update(void); + #if defined(CONFIG_SHA1) && !defined(CONFIG_SHA_PROG_HW_ACCEL) static int hash_init_sha1(struct hash_algo *algo, void **ctxp) { @@ -215,10 +221,31 @@ static struct hash_algo hash_algo[] = { #define multi_hash() 0 #endif +static void reloc_update(void) +{ +#if !defined(USE_HOSTCC) && defined(CONFIG_NEEDS_MANUAL_RELOC) + int i; + static bool done; + + if (!done) { + done = true; + for (i = 0; i < ARRAY_SIZE(hash_algo); i++) { + hash_algo[i].name += gd->reloc_off; + hash_algo[i].hash_func_ws += gd->reloc_off; + hash_algo[i].hash_init += gd->reloc_off; + hash_algo[i].hash_update += gd->reloc_off; + hash_algo[i].hash_finish += gd->reloc_off; + } + } +#endif +} + int hash_lookup_algo(const char *algo_name, struct hash_algo **algop) { int i; + reloc_update(); + for (i = 0; i < ARRAY_SIZE(hash_algo); i++) { if (!strcmp(algo_name, hash_algo[i].name)) { *algop = &hash_algo[i]; @@ -235,6 +262,8 @@ int hash_progressive_lookup_algo(const char *algo_name, { int i; + reloc_update(); + for (i = 0; i < ARRAY_SIZE(hash_algo); i++) { if (!strcmp(algo_name, hash_algo[i].name)) { if (hash_algo[i].hash_init) { From patchwork Mon Oct 14 12:56:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1176346 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.b="yxqy6f81"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46sJYf5xDlz9sPT for ; Mon, 14 Oct 2019 23:59:50 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 12A76C21EDE; Mon, 14 Oct 2019 12:57:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 50D32C21EA8; Mon, 14 Oct 2019 12:57:23 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 512A2C21EE0; Mon, 14 Oct 2019 12:56:44 +0000 (UTC) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by lists.denx.de (Postfix) with ESMTPS id 29677C21E52 for ; Mon, 14 Oct 2019 12:56:44 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id r17so14446288wme.0 for ; Mon, 14 Oct 2019 05:56:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=weTKsI7jFDcplDCQAKqzEZlSuzZk4Q5CaOtBEY/4LBM=; b=yxqy6f81tOQ5KaNXy3xd7Grr4McaMyIegWJpp+IchZgsB1fQVsg0oil+BH8/BHjeT5 h2dBDUcp0HoCHzgxwimnSuWBqvh9OcAFT3JM+8g6DSBlcr7o9vKsI54ZApbaWTvta0lB Wavyt5hgbfUY1xxbbUwMnD5d+Gop4+qRuhCvvfNmVZS1etKAhKmzoWXZHl07QvCCg6Hx l6IkouCExof++HiL2CjYDw2To+GyvyUf9SOeuJInxhPVGNlill35UuRL824J0vtf6uiv sEdERHy8vGbeCdllyM61qqySW+2NeuGCK0ROji6Z93uUU33oTweY6ZzVK0k045y6tt6Z UEmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references; bh=weTKsI7jFDcplDCQAKqzEZlSuzZk4Q5CaOtBEY/4LBM=; b=qZF2pCabCU2utUqfh3iAoFiuM8KhqE235Ck011boEEXxMErze5n6LAcaTPBTxU7eDR WSoUMtdidyf1IwNut3glr4+E/aDvZc+nItjodRCne+0a00UaTATd4lqbljR2KsN9OzBX PFcTVEbdnWi4I+Dz+BDUhT0qShszsEOrY444xLLbyqNYhea/9ui4n/28BcoTDQct02mq ewrw4IrN05oo1NshIl7ggnfX3Gxk25HDOy8nRG7j5EvMa8ctp39+LpgrA67jaSugTNNw AH9MVt7V+rQqocaho1xgO/PtufubJT4BUGNyFaf1c0xw16+5n+bbBx/ftaKTTHnYnfT5 iprQ== X-Gm-Message-State: APjAAAWtBhV7n/hha/0C/V91EKYmyzvMODBUzUmwTDrz9n6e4IIaSzgA FzZ1Mtb4Dv/Pnb0hE7gUrk5ZYc6N/1GxsQ== X-Google-Smtp-Source: APXvYqxK9ObmYkJuiEM4aGmJie0Uekjfy4kmnlDBP/sp8urDwFGrImI9Itp3B+hKua72Sqx24uZRJA== X-Received: by 2002:a05:600c:490:: with SMTP id d16mr14977400wme.131.1571057803566; Mon, 14 Oct 2019 05:56:43 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id t13sm40859032wra.70.2019.10.14.05.56.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Oct 2019 05:56:42 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Date: Mon, 14 Oct 2019 14:56:36 +0200 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Cc: T Karthik Reddy Subject: [U-Boot] [PATCH 2/3] drivers: crypto: rsa_mod_exp: Add manual relocation for ops->mod_exp() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: T Karthik Reddy This patch adds manual relocation for Modular Exponentiation if CONFIG_NEEDS_MANUAL_RELOC is enabled. Signed-off-by: T Karthik Reddy Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- drivers/crypto/rsa_mod_exp/mod_exp_uclass.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/rsa_mod_exp/mod_exp_uclass.c b/drivers/crypto/rsa_mod_exp/mod_exp_uclass.c index 93deaa7f51e6..e91fe644580b 100644 --- a/drivers/crypto/rsa_mod_exp/mod_exp_uclass.c +++ b/drivers/crypto/rsa_mod_exp/mod_exp_uclass.c @@ -13,10 +13,23 @@ #include #include +#if !defined(USE_HOSTCC) && defined(CONFIG_NEEDS_MANUAL_RELOC) +DECLARE_GLOBAL_DATA_PTR; +#endif + int rsa_mod_exp(struct udevice *dev, const uint8_t *sig, uint32_t sig_len, struct key_prop *node, uint8_t *out) { - const struct mod_exp_ops *ops = device_get_ops(dev); + struct mod_exp_ops *ops = (struct mod_exp_ops *)device_get_ops(dev); + +#if !defined(USE_HOSTCC) && defined(CONFIG_NEEDS_MANUAL_RELOC) + static bool done; + + if (!done) { + done = true; + ops->mod_exp += gd->reloc_off; + } +#endif if (!ops->mod_exp) return -ENOSYS; From patchwork Mon Oct 14 12:56:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1176345 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.b="rstziKu9"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46sJYZ6P5Dz9sPT for ; Mon, 14 Oct 2019 23:59:46 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 67E26C21D83; Mon, 14 Oct 2019 12:58:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id B667EC21DD4; Mon, 14 Oct 2019 12:58:01 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 64035C21DD4; Mon, 14 Oct 2019 12:56:46 +0000 (UTC) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by lists.denx.de (Postfix) with ESMTPS id 2A073C21EA1 for ; Mon, 14 Oct 2019 12:56:46 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id p14so19618559wro.4 for ; Mon, 14 Oct 2019 05:56:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=P5dwNxp1/klix3KQOik/DmrIJfwjCU5eWpdzyR+bq/4=; b=rstziKu9+sS8w41VIq14WDxMRHyyjRhx5VxAnV5sFqx5+6Z6EbbrP+UhLlTHrW3sAA 1Q4Yz4acDCzrPDbQGAp6D6Kop6sLdpPiMS2Bz4CZFPo0nS5vrOL/HsV3vQNFQX3mq45K HTEh/ErLeh3YXyzSuhgUoKGKFcsivjsZ0A3qz9MeeTy4PfG/5WPGCumUQMEI6p7o8sjQ cSEeMo+zBb7VtlmBHup0dv82R4v9Yje4cCQranq0opmImIVsJzYe8XRfx7EQIlhauKQS 8DQ9iyBzeAn/ZwhKs2CQiBGm1oECFZRdOUk8SJNpv3ZDAGZCBIFjxBBlccCYG6PWi9a/ XqZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references; bh=P5dwNxp1/klix3KQOik/DmrIJfwjCU5eWpdzyR+bq/4=; b=NP9GKXBzRaZ5kW8Y4yeIUrgxGtqzt01PAvn29MpsXo/Dq+zcelWpHnOLiRDCCqgha/ tcyJfXIo+EFg2KGoBRuC4ra8FPqornrB4wK67qRG8gEEa6sCqpn2OCHzl8IbmrdHAM3u VK53xFgLD37Lid4AOzxEC1zJpmTQJXK4GDLqJ+rqSANzvRkebMkK8ha+cuNnhRtvBJ7T vKlaoozsjctquQG/DXh54LYJiMkuVcBGMJfea7bIPpSSFf+CWiHlQnraWmYP8Clsuv/3 EhKYLanbYeob9l2KHM/6Szph6I8yAP/2SuP/AmcRlm+OQchzgvAsq2O2LXU/3xb3zW7l wzWw== X-Gm-Message-State: APjAAAWhuACnzVih8Ms89F5FA9buOaGBuPobY3H4G6Xsc5h6tXEosiR9 vlI098GcSNclE6TzQAYrkLeDunNTsWV06A== X-Google-Smtp-Source: APXvYqzusB32ZuhCAGZ19cc/7sHf7+36pU1xWaf/si+r5Ir/HlfEtUeebBMjO4t02r9QusF8bb7tHg== X-Received: by 2002:adf:e38a:: with SMTP id e10mr14889493wrm.348.1571057805429; Mon, 14 Oct 2019 05:56:45 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id b5sm14525092wmj.18.2019.10.14.05.56.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Oct 2019 05:56:44 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Date: Mon, 14 Oct 2019 14:56:37 +0200 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Cc: Konrad Beckmann , T Karthik Reddy Subject: [U-Boot] [PATCH 3/3] common: image-sig.c: Add manual relocation X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: T Karthik Reddy This patch adds manual relocation for struct checksum_algo & struct crypto_algo structures. Signed-off-by: T Karthik Reddy Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- common/image-sig.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/common/image-sig.c b/common/image-sig.c index 004fbc525b5c..639a1124504f 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)