summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2013-01-16 16:43:15 -0800
committerNick Kralevich <nnk@google.com>2013-01-16 16:43:58 -0800
commitd89ce40d8e6b4a6a8074a6fddca9570abbfa4b9d (patch)
treeb1c1dbd1e99229de5539d76a599a6fe33714faac
parent1271cdc1c91c6ae688917bc8f4ae59d2a97b3e99 (diff)
downloadbionic-d89ce40d8e6b4a6a8074a6fddca9570abbfa4b9d.zip
bionic-d89ce40d8e6b4a6a8074a6fddca9570abbfa4b9d.tar.gz
bionic-d89ce40d8e6b4a6a8074a6fddca9570abbfa4b9d.tar.bz2
linker: add -Wl,--exclude-libs,ALL to LDFLAGS
The linker is essentially a shared library, and incorporates it's own copy of libc. Even though it's unnecessary, currently /system/bin/linker is exporting various libc symbols (only to apps which explicitly dlopen /system/bin/linker) Add --exclude-libs,ALL, which tells the static linker to mark all of the imported libc symbols as hidden. This reduces the size of /system/bin/linker from 92K to 67K with no obvious loss in functionality. $ adb shell ls -l /system/bin/linker -rwxrwxrwx root root 92260 2013-01-16 16:52 linker $ adb shell ls -l /system/bin/linker -rwxrwxrwx root root 67660 2013-01-16 16:49 linker Documentation on exclude-libs can be found at http://sourceware.org/binutils/docs-2.21/ld/Options.html Change-Id: I4508287770e4b7a845def2e6b4af969f9c866c6a
-rw-r--r--linker/Android.mk2
1 files changed, 1 insertions, 1 deletions
diff --git a/linker/Android.mk b/linker/Android.mk
index 5fccf9b..c85b09e 100644
--- a/linker/Android.mk
+++ b/linker/Android.mk
@@ -17,7 +17,7 @@ LOCAL_SRC_FILES:= \
linker_phdr.cpp \
rt.cpp
-LOCAL_LDFLAGS := -shared
+LOCAL_LDFLAGS := -shared -Wl,--exclude-libs,ALL
LOCAL_CFLAGS += -fno-stack-protector \
-Wstrict-overflow=5 \