Makefile: Add --exclude-libs ALL to avoid .dynsym
authorVivian Wang <dramforever@live.com>
Sun, 17 Sep 2023 17:52:51 +0000 (01:52 +0800)
committerAnup Patel <anup@brainfault.org>
Fri, 6 Oct 2023 03:51:24 +0000 (09:21 +0530)
Since everything is statically linked, we don't need to expose symbols
for dynamic linking.

For a default build this saves about 2 KiB of useless read only data in
.dynsym, .dynstr, .hash, .gnu.hash sections.

Signed-off-by: Vivian Wang <dramforever@live.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Makefile

index ca70949df48011fd0728212d0af4ec90f30aff6e..de4e73a0e3d830d235fc59f0a5e5afb9a5d4503f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -375,6 +375,7 @@ ASFLAGS             +=      $(firmware-asflags-y)
 ARFLAGS                =       rcs
 
 ELFFLAGS       +=      $(USE_LD_FLAG)
+ELFFLAGS       +=      -Wl,--exclude-libs,ALL
 ELFFLAGS       +=      -Wl,--build-id=none
 ELFFLAGS       +=      $(platform-ldflags-y)
 ELFFLAGS       +=      $(firmware-ldflags-y)