History log of /bionic/linker/Android.mk
Revision Date Author Comments
3a7ea52f17b68f62fa088d57f96ff24a76f50ea2 04-Apr-2012 Nick Kralevich <nnk@google.com> linker: enable -fvisibility=hidden

Compile the linker with -fvisibility=hidden. This reduces the number
of symbols that show up in the .dynsym section of the linker.
These symbols are never exported to other applications.

In particular, this fixes a problem with setting -DLINKER_DEBUG=1
introduced in 468319ce4f3f7383d788b76c09cda2a405311f36.
Because the symbols "debug_verbosity" and "format_log" have not been
resolved before the linker links itself, any attempt to call
PRINT / INFO / TRACE / WARN / ERROR will result in a segfault.
This change allows the static linker to produce a relative reference
to these symbols rather than relying on relocation.

This also has a nice side effect of making the linker slightly smaller
and slightly more optimized.

The following symbols no longer in the .dynsym section of the linker
after this change:

-addr_to_name
-call_constructors_recursi
-calloc
-debugger_init
-debugger_signal_handler
-debug_verbosity
-dladdr
-dlclose
-dlerror
-dl_lock
-dlopen
-dlsym
-dl_unwind_find_exidx
-find_containing_library
-find_containing_symbol
-find_library
-format_buffer
-free
-libdl_info
-linker_env_get
-linker_env_init
-linker_env_secure
-linker_env_unset
-linker_get_error
-__linker_init
-lookup
-lookup_in_library
-malloc
-notify_gdb_of_libraries
-notify_gdb_of_load
-notify_gdb_of_unload
-realloc
-rtld_db_dlactivity
-unload_library
-vsnprintf

Bug: 5827809
Change-Id: I5e8cd7dcf48c1d6831a970a67f63f24916c5e437
9ec0f03a0d0b17bbb94ac0b9fef6add28a133c3a 28-Feb-2012 Nick Kralevich <nnk@google.com> Add relro support

Add support for PT_GNU_RELRO. This allows the static linker to
indicate that certain regions of memory should be marked as
"read-only" after dynamic linking is complete.

See:
* http://www.akkadia.org/drepper/nonselsec.pdf (section 6)
* http://tk-blog.blogspot.com/2009/02/relro-not-so-well-known-memory.html

Note that this change has no effect on Android right now, because
we don't compile our code with relro enabled.

Change-Id: I6541f8775367e8558b4388f7d105b1ae6e8f046b
70b1668a76d3b719ae690903ea790fda964a5458 30-Jan-2012 David 'Digit' Turner <digit@google.com> remove obsolete SuperH support

We don't have a toolchain anymore, we don't have working original
kernel headers, and nobody is maintaining this so there is really
no point in keeping this here. Details of the patch:

- removed code paths from Android.mk files related to the SuperH
architecture ("sh")

- removed libc/arch-sh, linker/arch-sh, libc/kernel/arch-sh

- simplified libc/SYSCALLS.TXT

- simplified the scripts in libc/tools/ and libc/kernel/tools

Change-Id: I26b0e1422bdc347489e4573e2fbec0e402f75560

Signed-off-by: David 'Digit' Turner <digit@android.com>
468319ce4f3f7383d788b76c09cda2a405311f36 12-Nov-2011 Nick Kralevich <nnk@google.com> Make the linker relocatable.

Previously, the linker always loaded itself into the same
location in memory, which inhibited the effectiveness of Android's
ASLR implementation. Modify the linker code so it can be relocatable
and link itself at runtime.

Change-Id: Ia80273d7a00ff648b4da545f4b69debee6343968
7939908c8310342c8e1b717c4599273a782b3c2b 04-Nov-2011 Nick Kralevich <nnk@google.com> linker: set LOCAL_NO_CRT := true

Use LOCAL_NO_CRT to prevent linking against crtbegin.o, rather than
messing with build rules. This also prevents linking against crtend.o,
which isn't needed for the linker.

Change-Id: I0c5b9999be7e8676560fe145c1c033ffce8db4d1
8e8a7b1f0fb9daf8d4434e18a9fff5c28f849cb8 03-Nov-2011 Nick Kralevich <nnk@google.com> Revert "Make the linker relocatable."

This reverts commit 994e9a5ed1c4e9f23a8bed79caea684eaa270027.

Broke x86 build.
994e9a5ed1c4e9f23a8bed79caea684eaa270027 01-Nov-2011 Nick Kralevich <nnk@google.com> Make the linker relocatable.

Previously, the linker always loaded itself into the same
location in memory, which inhibited the effectiveness of Android's
ASLR implementation. Modify the linker code so it can be relocatable
and link itself at runtime.

Change-Id: I90d064743abdd29450ac0482ed28752b2196286c
48527c3f740a80b45acb5a6efc217f771ae50143 17-Jul-2011 Shih-wei Liao <sliao@google.com> Revert "Revert "linker: get rid of the buddy allocator""

This reverts commit f9a9cda23a6afc1c2dfdfd624cde23b61941eb5e.
This revert is promised once b/5039224, b/5036755, b/5036610 are resolved.
f9a9cda23a6afc1c2dfdfd624cde23b61941eb5e 16-Jul-2011 Nick Kralevich <nnk@google.com> Revert "linker: get rid of the buddy allocator"

This reverts commit 7059b1f02ea9197728c851edd9ae0dd7688fa700.
Bug: 5036610
7059b1f02ea9197728c851edd9ae0dd7688fa700 14-Jul-2011 Nick Kralevich <nnk@google.com> linker: get rid of the buddy allocator

Currently, the Android linker is placing shared libraries into
a well-known spot in memory. This is interfering with the kernel's
ASLR support.

This change stops forcing non-prelinked libraries into a particular
address space.

Also, get rid of FLAG_PRELINKED. As best I can tell, this flag
is never used.

Change-Id: I527af12fb54f821c2b5ca7693dbf63d022f8f4ae
a0aec0bd3083280dcba0c3aaba39602425228e2a 04-May-2011 Bruce Beare <bruce.j.beare@intel.com> x86: Enable -fstack-protector

Change-Id: Iff9e3a3ba0e2d0faa7c6d98154aa5be0cc8a6c50
Orig-Change-Id: Ib69514c3afcb4c1f5e5f3f8cd91acfd145a0866c
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
a903811819c06e4d6e9e27fcc9db3ab5459009bc 07-Jun-2011 Martijn Coenen <maco@google.com> Revert "x86: Enable -fstack-protector"

This reverts commit e0b4844a20ffd022a568abb4203b3f7c759c7ff5,
causes netd to crash.
e0b4844a20ffd022a568abb4203b3f7c759c7ff5 04-May-2011 Bruce Beare <bruce.j.beare@intel.com> x86: Enable -fstack-protector

Change-Id: Ib69514c3afcb4c1f5e5f3f8cd91acfd145a0866c
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
368070454b1349d1fcf29a5d1eb51c869fb538f6 14-Mar-2011 Iliyan Malchev <malchev@google.com> bionic: remove LOCAL_PRELINK_MODULE

Change-Id: Iad65ae18446b20d2aace7b8fe19b1a032b616e9c
Signed-off-by: Iliyan Malchev <malchev@google.com>
be5755969d70668bbab0e0c0ed75ebd867189723 16-Dec-2010 David 'Digit' Turner <digit@google.com> linker: Remove unsecure env. variable for setuid programs.

This removes several unsecure environment variables from the
environment block when the program being loaded is setuid. The
list of env. variables is the same than what GLibc uses at this
point.

Change-Id: I456d3ea0880fe0d4de0d3c5dd51871dd36e87fd6
8bff9a31aa13ff83ccaedd54ebda96770e6cf910 11-Jun-2010 David 'Digit' Turner <digit@google.com> linker: remove libcutils dependency by re-implementing simpler socket_local_client.

Change-Id: I87f29fd59454d713b9ddfb13e6cf114822f52efd
5c734644eebf8d01be1e86cbe20a111a5c5a2738 20-Jan-2010 David 'Digit' Turner <digit@google.com> Fix debug output in the dynamic linker.

This provides a mini-printf implementation that reduces the
size of the dynamic linker by 25 KB, by preventing the drag of
formatting-related routines from the C library.

Also allow traces to be sent to the log, instead of stdout.

NOTE: You now need to modify Android.mk to enable/disable debug
output.
90f82e5868de5a30d4842951b80be0c8a9cedc6d 25-Jan-2010 Doug Kwan <dougkwan@google.com> Fix typo in a comment.
1a2917ca954f575cc9698c99e54bd93087793c8f 25-Jan-2010 Doug Kwan <dougkwan@google.com> Align TEXT section to 4K boundary so that we can use both ld and gold.
278d157f437c0357b7c6d1fb1cbffbc0a72bb788 30-Sep-2009 Gary King <gking@nvidia.com> Use correct TLS codepath for linker

Replicate ARM libc build's HAVE_ARM_TLS_REGISTER preprocessor definition
logic, to ensure that the runtime linker uses the correct codepath for
accessing the TLS address
ad13c57298e57d33c130fb03a2c6494da573408c 06-Nov-2009 Shin-ichiro KAWASAKI <shinichiro.kawasaki.mg@hitachi.com> added and modified linker to support SuperH architecture
2e85579c34047c305caf15fb0ebe02bf3d001d0e 21-May-2009 Dima Zavin <dima@android.com> linker: Make the errors reported by dlopen/dlsym be more useful.

Changed it so that when the linker generates error messages, they are
scribbled away into a buffer that dlfcn and friends can read from.

Since the error messages are generetad with snprintf, and snprintf
MAY call malloc during some code paths, we now link against a version
of libc that does not contain malloc/free/realloc/calloc. We then define
malloc and friends in the dynamic loader, and make them abort() if they
are ever called.

Signed-off-by: Dima Zavin <dima@android.com>
1dc9e472e19acfe6dc7f41e429236e7eef7ceda1 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
1767f908af327fa388b1c66883760ad851267013 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
a799b53f10e5a6fd51fef4436cfb7ec99836a516 03-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@132589
fe5745033a4f397c62a4e00efd9257ac9f83755c 03-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@137055
e5cc1f386b167b9f7bfdebc7219e89aa9b71e4b2 16-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@126645
a27d2baa0c1a2ec70f47ea9199b1dd6762c8a349 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution