[PATCH RFC 2/3] add support for symbol lookups
Tom Rini
trini at konsulko.com
Fri Jul 12 18:48:00 CEST 2024
On Wed, Jul 10, 2024 at 06:26:19PM +0200, Caleb Connolly wrote:
> This is mostly a port of the Xen hypervisor implementation. The U-Boot
> binary is built as normal, then its symbol table is fed into
> tools/symbols to generate an optimised lookup table. U-Boot is rebuilt
> with the symbol table and handling code in lib/symbols.c.
>
> Based on code from Xen at
> c20850540ad6("x86/altcall: always use a temporary parameter stashing variable")
>
> Signed-off-by: Caleb Connolly <caleb.connolly at linaro.org>
[snip]
> diff --git a/lib/Kconfig b/lib/Kconfig
> index b3baa4b85b07..06a78f83b7d6 100644
> --- a/lib/Kconfig
> +++ b/lib/Kconfig
> @@ -977,8 +977,14 @@ config VPL_OF_LIBFDT_ASSUME_MASK
> are made, and libfdt is able to deal with malicious data. A value of
> 0xff means all assumptions are made and any invalid data may cause
> unsafe execution. See FDT_ASSUME_PERFECT, etc. in libfdt_internal.h
>
> +config SYMBOL_LOOKUP
> + bool "Enable symbol lookup"
> + help
> + This enables support for looking up symbol names from addresses. The
> + primary usecase for this is improved debugging support.
This only works on aarch64 for now so please add a depends on.
> diff --git a/lib/Makefile b/lib/Makefile
> index e389ad014f89..a4ccda76f438 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -121,8 +121,9 @@ obj-y += linux_string.o
> obj-$(CONFIG_LMB) += lmb.o
> obj-y += membuff.o
> obj-$(CONFIG_REGEX) += slre.o
> obj-y += string.o
> +#obj-y += symbols.o
> obj-y += tables_csum.o
> obj-y += time.o
> obj-y += hexdump.o
> obj-$(CONFIG_GETOPT) += getopt.o
Drop this hunk.
> diff --git a/lib/symbols.c b/lib/symbols.c
> new file mode 100644
> index 000000000000..e881d5603425
> --- /dev/null
> +++ b/lib/symbols.c
> @@ -0,0 +1,126 @@
[snip]
> +DECLARE_GLOBAL_DATA_PTR;
You can drop this since there's no references to 'gd'.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20240712/ae75c843/attachment.sig>
More information about the U-Boot
mailing list