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 <heinrich.schuchardt@canonical.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
diff --git a/arch/sandbox/cpu/u-boot.lds b/arch/sandbox/cpu/u-boot.lds
index ba8dee5..52f13af 100644
--- a/arch/sandbox/cpu/u-boot.lds
+++ b/arch/sandbox/cpu/u-boot.lds
@@ -15,7 +15,7 @@
_u_boot_sandbox_getopt : {
*(_u_boot_sandbox_getopt_start)
- *(_u_boot_sandbox_getopt)
+ KEEP(*(_u_boot_sandbox_getopt))
*(_u_boot_sandbox_getopt_end)
}