diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2020-05-19 16:13:51 +0900 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-05-25 08:51:37 +0200 |
commit | 0a78b33954a911cf59fa8b6eaa2e987405875569 (patch) | |
tree | d8c224d8bdd59bef9bf41a8de99403d6a07e9f72 /arch/sandbox | |
parent | dc4cff0209ba243c5438fb278c46cbdb7889f44c (diff) | |
download | barebox-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 'arch/sandbox')
-rw-r--r-- | arch/sandbox/Makefile | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile index 3d2eb5bc11..3917cade94 100644 --- a/arch/sandbox/Makefile +++ b/arch/sandbox/Makefile @@ -53,7 +53,7 @@ SANITIZER_LIBS += -fsanitize=undefined endif cmd_barebox__ = $(CC) -o $@ -Wl,-T,$(BAREBOX_LDS) \ - -Wl,--start-group $(BAREBOX_OBJS) -Wl,--end-group \ + -Wl,--whole-archive $(BAREBOX_OBJS) -Wl,--no-whole-archive \ -lrt -lpthread $(SDL_LIBS) $(FTDI1_LIBS) \ $(SANITIZER_LIBS) |