From c7952a9539c18f5290e31b7d10b2758ef9134996 Mon Sep 17 00:00:00 2001 From: Ian Leonard Date: Sat, 2 Jun 2018 06:32:33 +0000 Subject: [PATCH] build: set hash-style to gnu via gcc default Builds use a mix of styles for the hash table in the ELF header. Only one style of table is necessary, and the GNU one is more performant for lookups. Eliminating the SysV style hash table trims ~450kb. This is done via setting the default linker in gcc instead of LDFLAGS as some packages ignore LDFLAGS. Note that if MIPS is ever added as a supported architecture, it does not support hash-style=gnu at this time. Signed-off-by: Ian Leonard --- config/optimize | 1 + packages/lang/gcc/package.mk | 1 + 2 files changed, 2 insertions(+) diff --git a/config/optimize b/config/optimize index 5d0b8efab0..d828dc688b 100644 --- a/config/optimize +++ b/config/optimize @@ -1,4 +1,5 @@ GCC_OPTIM="-Os" +# Linker hash-style is set to gnu via gcc default LD_OPTIM="-Wl,--as-needed" if [ "${BUILD_WITH_DEBUG}" = "yes" ]; then diff --git a/packages/lang/gcc/package.mk b/packages/lang/gcc/package.mk index fd052f604c..bb61b1a7b0 100644 --- a/packages/lang/gcc/package.mk +++ b/packages/lang/gcc/package.mk @@ -41,6 +41,7 @@ GCC_COMMON_CONFIGURE_OPTS="--target=$TARGET_NAME \ --enable-lto \ --enable-gold \ --enable-ld=default \ + --with-linker-hash-style=gnu \ --disable-multilib \ --disable-nls \ --enable-checking=release \