summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2023-09-13 14:57:15 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2023-09-21 10:53:04 +0200
commit3268f5175e566bf19c30a787f4e7e5a47c49eb10 (patch)
tree893078a262e9d690f527ced3f1110a62f07c0d09 /Makefile
parentde3da79362d036899e607571618db34c10c2f279 (diff)
downloadbarebox-3268f5175e566bf19c30a787f4e7e5a47c49eb10.tar.gz
barebox-3268f5175e566bf19c30a787f4e7e5a47c49eb10.tar.xz
kbuild: support generating stripped ELF files for PBL
For testing remoteproc and ELF loading mechanisms, it can be useful to have the consumed ELF files result from the barebox build itself. The *.pblb intermediate artifacts can be used for this purpose, but they are at least 64K larger than need be, because of generous alignment in addition to debug and symbol information. Let's add a separate %.elf target, that behaves like %.pblb with the difference that the result is stripped and alignment of sections on-disk is disabled. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230913125715.2142524-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index fb05e5ee7b..6ed9b2ed5b 100644
--- a/Makefile
+++ b/Makefile
@@ -470,6 +470,7 @@ LDFLAGS_common += $(call ld-option,--no-warn-rwx-segments)
LDFLAGS_barebox += $(LDFLAGS_common)
LDFLAGS_pbl += $(LDFLAGS_common)
+LDFLAGS_elf += $(LDFLAGS_common) --nmagic -s
export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC
export CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL PYTHON3 UTS_MACHINE
@@ -483,8 +484,7 @@ export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE
export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL
-export LDFLAGS_barebox
-export LDFLAGS_pbl
+export LDFLAGS_barebox LDFLAGS_pbl LDFLAGS_elf
export CFLAGS_UBSAN
export CFLAGS_KASAN CFLAGS_KASAN_NOSANITIZE