From c1157860c5e9ca45e41859e013ed83919e7397f0 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 11 Jan 2023 16:10:17 -0700 Subject: binman: Provide general support for updating ELF symbols The current support for updating variables in a binary is hard-coded to work with U-Boot: - It assumes the image starts at __image_copy_start - It uses the existing U-Boot-specific entry types It is useful for other projects to use these feature. Add properties to enable writing symbols for any blob, a way of specifying the base symbol and a way of providing the ELF filename to allow symbol lookup to take place. With this it is possible to update a Zephyr image, such as zephyr.bin after it has been built. Signed-off-by: Simon Glass --- tools/binman/test/blob_syms.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tools/binman/test/blob_syms.c (limited to 'tools/binman/test/blob_syms.c') diff --git a/tools/binman/test/blob_syms.c b/tools/binman/test/blob_syms.c new file mode 100644 index 0000000000..d652c79aa9 --- /dev/null +++ b/tools/binman/test/blob_syms.c @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) 2017 Google, Inc + * + * Simple program to create some binman symbols. This is used by binman tests. + */ + +typedef unsigned long ulong; + +#include +#include + +DECLARE_BINMAN_MAGIC_SYM; + +unsigned long val1 = 123; +unsigned long val2 = 456; +binman_sym_declare(unsigned long, inset, offset); +unsigned long val3 = 789; +unsigned long val4 = 999; +binman_sym_declare(unsigned long, inset, size); -- cgit v1.2.3