OSDN Git Service

linker: add -Wl,--exclude-libs,ALL to LDFLAGS
authorNick Kralevich <nnk@google.com>
Thu, 17 Jan 2013 00:43:15 +0000 (16:43 -0800)
committerNick Kralevich <nnk@google.com>
Thu, 17 Jan 2013 00:43:58 +0000 (16:43 -0800)
commitd89ce40d8e6b4a6a8074a6fddca9570abbfa4b9d
treeb1c1dbd1e99229de5539d76a599a6fe33714faac
parent1271cdc1c91c6ae688917bc8f4ae59d2a97b3e99
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
linker/Android.mk