summaryrefslogtreecommitdiffstats
path: root/images
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2020-05-19 16:13:51 +0900
committerSascha Hauer <s.hauer@pengutronix.de>2020-05-25 08:51:37 +0200
commit0a78b33954a911cf59fa8b6eaa2e987405875569 (patch)
treed8c224d8bdd59bef9bf41a8de99403d6a07e9f72 /images
parentdc4cff0209ba243c5438fb278c46cbdb7889f44c (diff)
downloadbarebox-0a78b33954a911cf59fa8b6eaa2e987405875569.tar.gz
barebox-0a78b33954a911cf59fa8b6eaa2e987405875569.tar.xz
kbuild: switch over to thin archive
Starting v4.13, Linux always uses thin archive instead of relocatable ELF to combine builtin objects. The thin archive is basically a text file that only contains paths to object files. As Linux commit 98ced886dd79 mentioned, this has a lot of benefits: - save disk space for builds - speed-up building a little - fix some issues when liking a giant executable (for example, allyesconfig on ARM Linux) - work better with dead code elimination The last one is important for barebox because pbl highly relies on the dead code elimination (-f{function,data}-sections and --gc-sections) dropping symbols that are unreachable from the linker's entry point. The dead code elimination does not work if the same symbol names are used in the pevious incremental link mechanism because the same name symbols all go into the same section. Commit a83c97f2a406 ("ARM: socfpga: generate smaller images when multiple boards are selected") worked around it by giving a dedicate section to each of the same name symbols. This workaround can go away. built-in.o was renamed to built-in.a since it is now an archive. built-in-pbl.o was renamed to built-in.pbl.a for consistency. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'images')
-rw-r--r--images/Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/images/Makefile b/images/Makefile
index 0aa4676aea..b8899dcd2a 100644
--- a/images/Makefile
+++ b/images/Makefile
@@ -57,8 +57,8 @@ quiet_cmd_elf__ ?= LD $@
cmd_elf__ ?= $(LD) $(LDFLAGS_pbl) --gc-sections \
-e $(2) -Map $@.map $(LDFLAGS_$(@F)) -o $@ \
-T $(pbl-lds) \
- --start-group $(BAREBOX_PBL_OBJS) $(obj)/piggy.o \
- $(obj)/sha_sum.o --end-group
+ --whole-archive $(BAREBOX_PBL_OBJS) $(obj)/piggy.o \
+ $(obj)/sha_sum.o
PBL_CPPFLAGS += -fdata-sections -ffunction-sections