mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-11-28 22:21:49 +01:00
image: Add support for relocating crypto_algos in linker lists
Function pointers from crypto_algos array are relocated, when NEEDS_MANUAL_RELOC is set. This relocation doesn't happen if the algo is placed in a linker list. Implement this relocation. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Michal Simek <michal.simek@xilinx.com>
This commit is contained in:
parent
8387dba471
commit
b9826bf0c1
@ -97,6 +97,19 @@ struct crypto_algo *image_get_crypto_algo(const char *full_name)
|
|||||||
struct crypto_algo *crypto, *end;
|
struct crypto_algo *crypto, *end;
|
||||||
const char *name;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Move name to after the comma */
|
/* Move name to after the comma */
|
||||||
name = strchr(full_name, ',');
|
name = strchr(full_name, ',');
|
||||||
if (!name)
|
if (!name)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user