Commit graph

93 commits

Author SHA1 Message Date
Zhenghua Wang
897815a1fe bionic: add machine type check
android linker doesn't check machine type, it may load some
libraries which it doesn't support sometimes.

Author: Zhenghua Wang <zhenghua.wang@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2011-11-29 17:01:08 -08:00
Mathias Agopian
bda5da074e fix prototype of dladdr
this breaks C++ source code in particular.

Change-Id: Ie06b5d31d23b5455e6950c470adc64dd5e7784df
2011-09-28 12:17:34 -07:00
David 'Digit' Turner
96e5faccdc am 91966c30: am 0acdbe08: am 89ea107d: Merge "linker: allow debugging of constructors"
* commit '91966c30efbdc7feecd6c45a46ab488e715c0a35':
  linker: allow debugging of constructors
2011-08-30 09:50:54 -07:00
David 'Digit' Turner
91966c30ef am 0acdbe08: am 89ea107d: Merge "linker: allow debugging of constructors"
* commit '0acdbe0892105d01a38de9baf4e34eef22b8259c':
  linker: allow debugging of constructors
2011-08-29 18:01:05 -07:00
Nick Kralevich
38bccb271f linker.h: don't change the soinfo structure
In 48527c3f74, we modified the soinfo
structure to remove an unnecessary variable. However, third party
programs seem to be relying on the structure not changing.
Add a dummy variable back into place to preserve structure.

Bug: 5064106

Change-Id: I3014dda1a46e624644b09e156c3e9381ba3729bd
2011-08-29 13:52:18 -07:00
David 'Digit' Turner
e5ea45547e linker: allow debugging of constructors
This patch allows the debugging of constructors in shared
libraries and executables. It does so by ensuring that the
corresponding binary is visible to gdb before running the
constructors.

Change-Id: I0a3df726a04ad109944c834dcbba672b85d3991e
2011-08-27 10:21:01 +02:00
Andy McFadden
ec92af8fe5 Log signal info at time of receipt
When a fatal signal is received, we now write a message to the log
that looks like this:

  F/libc    ( 1540): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1)

This is useful for debugging fatal signals that turn out not to be
fatal.  This also changes the signal reset from SIG_IGN to SIG_DFL,
so that future non-fatal fatal signals are fatal.

The code that blocked SIGUSR1 to avoid being interrupted by the GC
has been removed.

Also, fix minor issues in format_buffer().

Bug 5035703

Change-Id: I8940af47297b5dcf3cf33537e3483ca5334ed565
2011-08-04 14:48:15 -07:00
Shih-wei Liao
48527c3f74 Revert "Revert "linker: get rid of the buddy allocator""
This reverts commit f9a9cda23a.
This revert is promised once b/5039224, b/5036755, b/5036610 are resolved.
2011-07-17 12:32:43 -07:00
Nick Kralevich
f9a9cda23a Revert "linker: get rid of the buddy allocator"
This reverts commit 7059b1f02e.
Bug: 5036610
2011-07-15 16:12:45 -07:00
Nick Kralevich
7059b1f02e 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
2011-07-14 13:48:13 -07:00
Martijn Coenen
a903811819 Revert "x86: Enable -fstack-protector"
This reverts commit e0b4844a20,
causes netd to crash.
2011-06-07 17:19:12 +02:00
David Turner
65fb884d28 am 204d1f65: am b2c7e0c1: Merge "x86: Enable -fstack-protector"
* commit '204d1f65dbfc6d5a14a90627d9d1efcfce8261ee':
  x86: Enable -fstack-protector
2011-06-06 12:57:08 -07:00
David Turner
204d1f65db am b2c7e0c1: Merge "x86: Enable -fstack-protector"
* commit 'b2c7e0c18b7ab04cfe306277c79165de0612a2d1':
  x86: Enable -fstack-protector
2011-06-06 11:32:49 -07:00
Bruce Beare
e0b4844a20 x86: Enable -fstack-protector
Change-Id: Ib69514c3afcb4c1f5e5f3f8cd91acfd145a0866c
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2011-05-24 13:32:14 -07:00
David Turner
c2af2c075f am 1af88c97: am d004dc99: Merge "Use MAP_FIXED when allocating prelinked shared library regions"
* commit '1af88c97432c88ec5b39d155e8c296d2a6eb1225':
  Use MAP_FIXED when allocating prelinked shared library regions
2011-05-02 13:30:03 -07:00
David Turner
1af88c9743 am d004dc99: Merge "Use MAP_FIXED when allocating prelinked shared library regions"
* commit 'd004dc9957cd8944d3db8ed92544c8ee65b117ca':
  Use MAP_FIXED when allocating prelinked shared library regions
2011-05-02 12:34:57 -07:00
Iliyan Malchev
368070454b bionic: remove LOCAL_PRELINK_MODULE
Change-Id: Iad65ae18446b20d2aace7b8fe19b1a032b616e9c
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-03-14 14:25:58 -07:00
Chris Dearman
db4bce0549 Use MAP_FIXED when allocating prelinked shared library regions
Prelinked libraries must be mapped to a fixed address. MAP_FIXED is ignored
for non-prelinked libraries (si->base==0)

Signed-off-by: Raghu Gandham <raghu@mips.com>
2011-03-10 10:48:14 -08:00
David 'Digit' Turner
81d79f9fb3 am 962dcb22: am fed58049: Merge "libc: Fix PTHREAD_RWLOCK_INITIALIZER"
* commit '962dcb22218a1a6d4ebd05e4fc4a69875d037234':
  libc: Fix PTHREAD_RWLOCK_INITIALIZER
  Proxy getnameinfo through netd
  Updated gcc 4.4.3 IA toolchain doesn't require the .ctors list
  Convert cname lenght before use
2011-03-10 01:55:35 -08:00
Bruce Beare
48e1feaa9d Updated gcc 4.4.3 IA toolchain doesn't require the .ctors list
Change-Id: Ia840a19a45257128eccdcf25d105f500f2d90741
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2011-02-16 17:50:23 -08:00
Kenny Root
72f9a5c374 Increase SO_MAX to accomodate valgrind
system_server loads up 87 shared libraries upon start. Running under
valgrind pushes this just over the edge of 96. Increase SO_MAX to 128 to
give us some more headroom.

Change-Id: Iadceb14ab6d9621bdccd292570d50867828057d9
2011-02-10 17:02:23 -08:00
tedbo
b67c1bacd0 Fix bug in linker environment variable lookup.
The linker_env_get() method that is used to match an environment
variable was failing due to an incorrect equality check.

This  was introduced in git change
be5755969d.

The bug was causing the linker to ignore environment variables such
as LD_LIBRARY_PATH. This issue also affects the linker_env_secure()
path that removes unsafe environment variables, since it would
not match any in the unsecure variable list.

Change-Id: I14228df9252010e9fb4c1862bed5735f23e97aec
2011-01-21 21:15:08 +01:00
tedbo
b3cdf7fef8 Fix bug in linker environment variable lookup.
The linker_env_get() method that is used to match an environment
variable was failing due to an incorrect equality check.

This  was introduced in git change
be5755969d.

The bug was causing the linker to ignore environment variables such
as LD_LIBRARY_PATH. This issue also affects the linker_env_secure()
path that removes unsafe environment variables, since it would
not match any in the unsecure variable list.

Change-Id: I169024de4a005321e768accd38246fc1d717271b
2011-01-20 20:44:44 -08:00
Glenn Kasten
1f353828c3 Fix typos
Change-Id: Ia02baba53be7034903f325258205441e5c193f7b
2011-01-18 09:36:38 -08:00
David 'Digit' Turner
be5755969d 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
2010-12-20 12:06:45 +01:00
Brian Swetland
fedbcde6ef add /vendor support
- add /vendor/lib to front of default library search path
- remove long-obsolete /lib from default library search path

Change-Id: I7d33bf899be018e7cc4c213d5790bbd991023a62
2010-09-19 03:39:13 -07:00
Dima Zavin
a716190241 linker: fix overwriting the real linker error string
Change-Id: Ia9165fd9aa1951b2bb81d0ac8f5bb3057aded8bd
Signed-off-by: Dima Zavin <dima@android.com>
2010-08-17 15:57:55 -07:00
David 'Digit' Turner
6774809b62 linker: Support dlopen(NULL, ...) properly.
Change-Id: Icba37823cb350c34848cc466d144c3a0af87c94c
2010-07-23 12:16:15 -07:00
David 'Digit' Turner
8bff9a31aa linker: remove libcutils dependency by re-implementing simpler socket_local_client.
Change-Id: I87f29fd59454d713b9ddfb13e6cf114822f52efd
2010-06-10 22:58:22 -07:00
Jean-Baptiste Queru
f439445830 fix build
Change-Id: I243c98e20a250e0d40d481f16af481ff070219fd
2010-05-12 10:05:59 -07:00
The Android Open Source Project
bb7928ccda merge from open-source master
Change-Id: Iecfd2bd3069f70bbe508042cc249fcf7ff24800d
2010-05-12 09:22:50 -07:00
Matt Fischer
4fd42c1dc0 Added support for LD_PRELOAD
The LD_PRELOAD environment variable allows the user to specify a list of
libraries which should be unconditionally loaded before any others.  This
makes possible some useful tricks, such as library interposers.

Change-Id: I433d775ab08ef63a5fbe7b21f87a5642954fc32f
2010-05-10 15:09:19 -07:00
The Android Open Source Project
5ef5272be9 merge from open-source master
Change-Id: I518bb4ae9d7269957365561d4d609f22cde519db
2010-04-21 09:10:08 -07:00
Matt Fischer
1698d9ebfc Fixed support for RTLD_NEXT in dlsym()
The previous implementation of this flag was broken--it behaved identically
to RTLD_DEFAULT.  This adds a proper implementation, which examines the address
of the calling function, and uses it to determine which library to use to begin
the symbol search process.

Change-Id: I2ad2b46363f68932af63a3828a22f9c7987eea67
2010-04-08 10:14:47 -05:00
The Android Open Source Project
d046725133 merge from open-source master
Change-Id: I483fedf77d978b1c6e52d73eebc14f011bb9f809
2010-03-31 14:19:51 -07:00
Min-su, Kim
3cab22c8cf linker: fix the undefined weak symbols issue 2010-03-29 15:43:09 -07:00
The Android Open Source Project
377d4c979d merge from open-source master
Change-Id: I70266ee8c520b216773f267e46c8273d2334c31d
2010-03-22 15:55:09 -07:00
Matt Fischer
e2a8b1fd19 Added support for dladdr()
dladdr() is a GNU extension function, which allows the caller to retrieve
symbol information for a specified memory address.  It is useful for things
like generating backtrace information at runtime.

Change-Id: I3a1def1a6c9c666d93e1e97b7d260dfa5b9b79a9
2010-03-17 16:11:37 -05:00
David 'Digit' Turner
5c734644ee 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.
2010-02-11 10:46:48 -08:00
Iliyan Malchev
e100f52f4a bionic/linker: rename ba_prelink to ba_nonprelink
-- fixes b/2432550
-- ba_prelink is used to manage non-prelinked libraries, hence ba_nonprelink is
   a more appropriate name for it

Signed-off-by: Iliyan Malchev <malchev@google.com>
2010-02-10 19:14:35 -08:00
Doug Kwan
90f82e5868 Fix typo in a comment. 2010-01-25 11:09:31 -08:00
Doug Kwan
1a2917ca95 Align TEXT section to 4K boundary so that we can use both ld and gold. 2010-01-25 10:24:50 -08:00
Gary King
278d157f43 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
2010-01-12 17:37:44 -08:00
David 'Digit' Turner
a3de55c831 am fe62de1a: Add support for R_ARM_REL32 to the dynamic linker.
Merge commit 'fe62de1ad036a1417df44b7b1a7c65cc79dc7091' into eclair-plus-aosp

* commit 'fe62de1ad036a1417df44b7b1a7c65cc79dc7091':
  Add support for R_ARM_REL32 to the dynamic linker.
2009-12-02 11:17:29 -08:00
David 'Digit' Turner
fe62de1ad0 Add support for R_ARM_REL32 to the dynamic linker.
Merged from eclair-mr2
2009-12-02 10:54:53 -08:00
David 'Digit' Turner
83d3d7491a am ebf3ea00: am 34ea5117: Add support for R_ARM_REL32 to the dynamic linker.
Merge commit 'ebf3ea006e5367fff93d2491eec24c4b1a633805'

* commit 'ebf3ea006e5367fff93d2491eec24c4b1a633805':
  Add support for R_ARM_REL32 to the dynamic linker.
2009-11-17 16:16:52 -08:00
David 'Digit' Turner
ebf3ea006e am 34ea5117: Add support for R_ARM_REL32 to the dynamic linker.
Merge commit '34ea5117dbeba41ae5dfdfb2c2ec8cae23388b66' into eclair-mr2-plus-aosp

* commit '34ea5117dbeba41ae5dfdfb2c2ec8cae23388b66':
  Add support for R_ARM_REL32 to the dynamic linker.
2009-11-17 16:06:26 -08:00
David 'Digit' Turner
34ea5117db Add support for R_ARM_REL32 to the dynamic linker. 2009-11-17 14:56:26 -08:00
Jean-Baptiste Queru
b152dde4ca am 83362689: merge from open-source master
Merge commit '83362689f5b1f6393d376d242fe29541b63ead2d'

* commit '83362689f5b1f6393d376d242fe29541b63ead2d':
  added and modified linker to support SuperH architecture
  Add the BSD sys_signame array.
  added and modified bionic code to support SuperH architecture
2009-11-09 12:07:54 -08:00
Jean-Baptiste Queru
83362689f5 merge from open-source master 2009-11-09 08:04:48 -08:00