From be6a249b417fb159db6fc3f4b7d72eb2fd036554 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 24 Oct 2023 08:30:47 +0200 Subject: sandbox: eliminate unused functions from binaries The sandbox should closely mimic other architectures. Place each function or data in a separate section and let the linker eliminate unused ones. This will reduce the binary size. In the linker script mark that u_boot_sandbox_getopt are to be kept. Signed-off-by: Heinrich Schuchardt Reviewed-by: Tom Rini --- arch/sandbox/cpu/u-boot.lds | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/sandbox/cpu') diff --git a/arch/sandbox/cpu/u-boot.lds b/arch/sandbox/cpu/u-boot.lds index ba8dee50c7b..52f13af3742 100644 --- a/arch/sandbox/cpu/u-boot.lds +++ b/arch/sandbox/cpu/u-boot.lds @@ -15,7 +15,7 @@ SECTIONS _u_boot_sandbox_getopt : { *(_u_boot_sandbox_getopt_start) - *(_u_boot_sandbox_getopt) + KEEP(*(_u_boot_sandbox_getopt)) *(_u_boot_sandbox_getopt_end) } -- cgit v1.3.1