diff options
Diffstat (limited to 'linker')
-rw-r--r-- | linker/Android.mk | 1 | ||||
-rw-r--r-- | linker/arch/x86/begin.S | 6 | ||||
-rw-r--r-- | linker/dlfcn.c | 2 | ||||
-rw-r--r-- | linker/linker.c | 9 |
4 files changed, 11 insertions, 7 deletions
diff --git a/linker/Android.mk b/linker/Android.mk index 5ab48a09c..0cbaf366a 100644 --- a/linker/Android.mk +++ b/linker/Android.mk @@ -62,6 +62,7 @@ LOCAL_CFLAGS += -DANDROID_ARM_LINKER else ifeq ($(TARGET_ARCH),x86) LOCAL_CFLAGS += -DANDROID_X86_LINKER + LOCAL_CFLAGS += -I$(LOCAL_PATH)/../libc/arch-x86/bionic else ifeq ($(TARGET_ARCH),sh) LOCAL_CFLAGS += -DANDROID_SH_LINKER diff --git a/linker/arch/x86/begin.S b/linker/arch/x86/begin.S index d8a39ca32..5be59cb15 100644 --- a/linker/arch/x86/begin.S +++ b/linker/arch/x86/begin.S @@ -44,9 +44,5 @@ _start: popl %esp jmp *%eax -.section .ctors, "wa" -.globl __CTOR_LIST__ - -__CTOR_LIST__: - .long -1 +#include "__stack_chk_fail_local.S" diff --git a/linker/dlfcn.c b/linker/dlfcn.c index a36b42ccf..429c588f6 100644 --- a/linker/dlfcn.c +++ b/linker/dlfcn.c @@ -42,7 +42,7 @@ static const char *dl_errors[] = { #define likely(expr) __builtin_expect (expr, 1) #define unlikely(expr) __builtin_expect (expr, 0) -static pthread_mutex_t dl_lock = PTHREAD_MUTEX_INITIALIZER; +pthread_mutex_t dl_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER; static void set_dlerror(int err) { diff --git a/linker/linker.c b/linker/linker.c index bb31703bf..6a80ce7da 100644 --- a/linker/linker.c +++ b/linker/linker.c @@ -438,9 +438,16 @@ static unsigned elfhash(const char *_name) while(*name) { h = (h << 4) + *name++; g = h & 0xf0000000; - h ^= g; + /* The hash algorithm in the ELF ABI is as follows: + * if (g != 0) + * h ^=g >> 24; + * h &= ~g; + * But we can use the equivalent and faster implementation: + */ h ^= g >> 24; } + /* Lift the operation out of the inner loop */ + h &= 0x0fffffff; return h; } |