| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
| |
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
|
|\
| |
| |
| |
| |
| |
| | |
Merge commit 'fe62de1ad036a1417df44b7b1a7c65cc79dc7091' into eclair-plus-aosp
* commit 'fe62de1ad036a1417df44b7b1a7c65cc79dc7091':
Add support for R_ARM_REL32 to the dynamic linker.
|
| |
| |
| |
| | |
Merged from eclair-mr2
|
|\ \ |
|
| | | |
|
|\ \ \
| | |/
| |/|
| | |
| | |
| | |
| | |
| | | |
Merge commit '763ac28357f604e0e4196e0a7ad5b0f5cdcf274a' into eclair-plus-aosp
* commit '763ac28357f604e0e4196e0a7ad5b0f5cdcf274a':
bionic/linker: make the buddy allocator compute max_order on its own
bionic/linker: change the buddy allocator to take a handle to the managed area
|
| | |
| | |
| | |
| | | |
Signed-off-by: Iliyan Malchev <malchev@google.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
-- rename struct ba_info to struct ba
-- move the static ba descriptor from ba.c to linker.c and rename it ba_prelink
-- ba_init, ba_allocate, ba_free, ba_start_addr, and ba_len all take a pointer
to struct ba
Signed-off-by: Iliyan Malchev <malchev@google.com>
|
|\ \ \
| |/ /
| | |
| | |
| | |
| | |
| | | |
Merge commit 'ff7b46b87c4d85881d88c2105a94be6c6accb628' into eclair-plus-aosp
* commit 'ff7b46b87c4d85881d88c2105a94be6c6accb628':
Allow the dynamic linker to relocate references to thumb symbols in NDK libraries.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
libraries.
The lowest bit of the symbol's value should be ignored when looking at UNDEF symbols
for correctness. It is used as an ARM/Thumb flag by the linker.
|
|\ \ \
| |/ /
|/| /
| |/ |
|
| |
| |
| |
| |
| |
| |
| | |
GDB will try to read l_ld of linkmaps and compare the value to vma of
.dynamic sections from shared objects. Since linker does not assign l_ld,
GDB will complain about and re-compute l_addr from l_ld. And, GDB will get a
wrong value.
|
| |
| |
| |
| | |
Signed-off-by: Iliyan Malchev <malchev@google.com>
|
| | |
|
| |
| |
| |
| | |
This reverts commit 33acbf0719c4f3db059bc9e1f52cf554a5d0295f.
|
| |
| |
| |
| | |
This reverts commit 8d0c0334f1106d36f2fd5c1cf6d5dc75a4b88850.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When resolving relocations while loading a library, the linker used to find
symbols by looking them up in the list of all linked libraries for the current
process, as opposed to following just the library's DT_NEEDED entries. This
can cause a problem where the symbol is picked up from the wrong library.
Signed-off-by: Iliyan Malchev <malchev@google.com>
|
|/
|
|
| |
Signed-off-by: Erik Gilling <konkers@android.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to this change, the dynamic loader kept track of opened libraries
either by their base name (i.e., libfoo.so instead of /system/lib/libfoo.so)
when the shared library was loaded through the DT_NEEDED tag in an ELF header,
or by whatever name was passed to dlopen(). This created a number of problems,
among which:
1. dlopen("libfoo.so") and dlopen("/path/to/libfoo.so") would open the same
library twice;
2. dlopen("/path/to/libfoo.so") and then dlopen("libbar.so"), where libbar.so
depends on libfoo.so, would open libfoo.so twice.
This patch makes the dynamic loader keep track of each loaded library by
basename, which resolves the above ambiguity. The patch also enforces
library lookup by base name, which means that it will refuse to load another
library that has the same name.
Thanks for the inspiration Iliyan.
Signed-off-by: Erik Gilling <konkers@android.com>
Cc: Iliyan Malchev <malchev@google.com>
|
|
|
|
| |
Signed-off-by: Erik Gilling <konkers@android.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is needed to properly initialize the C runtime when libc.so
is loaded by the dynamic linker.
Move the temporary TLS setup before the first system call, just
in case something really horrible happens, we won't crash when
trying to write an error code in 'errno'
Remove the broken TLS_SLOT_THREAD_ID setup. First, this slot
should normally receive the address of a pthread_internal_t,
not a kernel thread identifier. Second, it is never used by
the linker anyway.
Also remove an obsolete comment.
|
| |
|
|
|
|
| |
Signed-off-by: Dima Zavin <dima@android.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
in reverse order).
Also add a small design overview document for the linker. The latter contains details on
how the initialization/finalization is supposed to work.
|
|
|
|
| |
Signed-off-by: Dima Zavin <dima@android.com>
|
|
|
|
|
|
| |
required for OpenCORE 2.0
This is the same as Change 71 in master branch.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|