F H ~ . I have one idea for you.
If you are interested in prelink knowledge by Jakub Jelinek,
I recommend that you will read http://people.redhat.com/jakub/prelink.pdf.
and, If you are want to modify android source for custom your toolchain,
Analize prelink related source like a belows.
./build/core/prelink-linux-arm.map
./build/core/shared_library.mk
./bionic/linker/linker.c.
./build/tools/apriori/prelinkmap.c (prelinkmap.h)
1. ./build/core/prelink-linux-arm.map
-------------------------------------
# 0xC0000000 - 0xFFFFFFFF Kernel
# 0xB0100000 - 0xBFFFFFFF Thread 0 Stack
# 0xB0000000 - 0xB00FFFFF Linker
# 0xA0000000 - 0xBFFFFFFF Prelinked System Libraries
# 0x90000000 - 0x9FFFFFFF Prelinked App Libraries
# 0x80000000 - 0x8FFFFFFF Non-prelinked Libraries
# 0x40000000 - 0x7FFFFFFF mmap'd stuff
# 0x10000000 - 0x3FFFFFFF Thread Stacks
# 0x00000000 - 0x0FFFFFFF .text / .data / heap
-------------------------------------
2. ./build/core/shared_library.mk
Standard rules for building a normal shared library.
Additional inputs from base_rules.make:None.
LOCAL_MODULE_SUFFIX will be set for you
------------------------------
ifeq ($(strip $(LOCAL_PRELINK_MODULE)),)
LOCAL_PRELINK_MODULE := $(strip $(TARGET_PRELINK_MODULE))
endif
------------------------------
3. ./bionic/linker/linker.c
---------------------------
>>> IMPORTANT NOTE - READ ME BEFORE MODIFYING <<<
Do NOT use malloc() and friends or pthread_*() code here.
Don't use printf() either; it's caused mysterious memory
corruption in the past.
The linker runs before we bring up libc and it's easiest
to make sure it does not depend on any complex libc features
open issues / todo:
- should we do anything special for STB_WEAK symbols?
- are we doing everything we should for ARM_COPY relocations?
- cleaner error reporting
- configuration for paths (LD_LIBRARY_PATH?)
- after linking, set as much stuff as possible to READONLY
and NOEXEC
- linker hardcodes PAGE_SIZE and PAGE_MASK because the kernel
headers provide versions that are negative...
- allocate space for soinfo structs dynamically instead of
having a hard limit (64)
features to add someday:
- dlopen() and friends
---------------------------
4. ./build/tools/apriori/prelinkmap.c
-----------------------------------------------------
These values limit the address range within which we prelinked libraries
reside. The limit is not set in stone, but should be observed in the
prelink map, or the prelink step will fail.
#define PRELINK_MIN 0x90000000
#define PRELINK_MAX 0xB0000000
-----------------------------------------------------
2009/1/7 David Turner <di...@android.com>: