From 8e04c064c4cb39bae5e5bec166c762d2fc88cb11 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Sat, 18 Apr 2015 21:36:26 +0200 Subject: ldso: PRELINK: Remove surplus newline in early debugging code Signed-off-by: Bernhard Reutner-Fischer --- ldso/ldso/ldso.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ldso') diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c index 56196292b..f38f9e34c 100644 --- a/ldso/ldso/ldso.c +++ b/ldso/ldso/ldso.c @@ -1196,6 +1196,7 @@ of this helper program; chances are you did not intend to run this program.\n\ } #endif #ifdef __UCLIBC_HAS_SSP__ + _dl_debug_early("Setting up SSP guards\n"); /* Set up the stack checker's canary. */ stack_chk_guard = _dl_setup_stack_chk_guard (); # ifdef THREAD_SET_STACK_GUARD @@ -1268,7 +1269,7 @@ of this helper program; chances are you did not intend to run this program.\n\ } - _dl_debug_early ("\nprelink checking: %s\n", prelinked ? "ok" : "failed"); + _dl_debug_early ("prelink checking: %s\n", prelinked ? "ok" : "failed"); if (prelinked) { if (_dl_loaded_modules->dynamic_info[DT_GNU_CONFLICT_IDX]) { -- cgit v1.2.3 From 7c78a5c52b2db6bb0d6e163b38897a003a289958 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Sat, 18 Apr 2015 21:37:30 +0200 Subject: NPTL: Rename a variable There seems to be a bug in gold with static TLS at least on x86_64 (?) Signed-off-by: Bernhard Reutner-Fischer --- ldso/include/ldsodefs.h | 2 ++ ldso/ldso/dl-tls.c | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'ldso') diff --git a/ldso/include/ldsodefs.h b/ldso/include/ldsodefs.h index 4063d00f4..0feed8954 100644 --- a/ldso/include/ldsodefs.h +++ b/ldso/include/ldsodefs.h @@ -106,7 +106,9 @@ EXTERN size_t _dl_tls_static_used; /* Alignment requirement of the static TLS block. */ EXTERN size_t _dl_tls_static_align; /* Function pointer for catching TLS errors. */ +#if 1 /* def _LIBC_REENTRANT */ EXTERN void **(*_dl_error_catch_tsd) (void) __attribute__ ((const)); +#endif /* Number of additional entries in the slotinfo array of each slotinfo list element. A large number makes it almost certain take we never diff --git a/ldso/ldso/dl-tls.c b/ldso/ldso/dl-tls.c index 6679693f4..05193a893 100644 --- a/ldso/ldso/dl-tls.c +++ b/ldso/ldso/dl-tls.c @@ -950,8 +950,13 @@ static bool tls_init_tp_called; void ** __attribute__ ((const)) _dl_initial_error_catch_tsd (void) { - static void *data; - return &data; + static +#if 0 /* def ARCH_NEEDS_BOOTSTRAP_RELOCS */ + /* If we have to do bootstrap relocs anyway we might as well */ + __thread +# endif + void *__tsd_data; + return &__tsd_data; } #ifdef SHARED -- cgit v1.2.3 From e71fc570caec4f2d4bbe729dfe9eb41bfe5a732a Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Sat, 18 Apr 2015 22:41:46 +0200 Subject: arm: Add BX and BXC macros Signed-off-by: Bernhard Reutner-Fischer --- ldso/ldso/arm/dl-startup.h | 12 ++---------- ldso/ldso/arm/resolve.S | 18 ++++++------------ 2 files changed, 8 insertions(+), 22 deletions(-) (limited to 'ldso') diff --git a/ldso/ldso/arm/dl-startup.h b/ldso/ldso/arm/dl-startup.h index df2c82469..eb2a9a22a 100644 --- a/ldso/ldso/arm/dl-startup.h +++ b/ldso/ldso/arm/dl-startup.h @@ -47,11 +47,7 @@ __asm__( " ldr r0, .L_FINI_PROC\n" " ldr r0, [sl, r0]\n" " @ jump to the user_s entry point\n" -#if defined(__USE_BX__) - " bx r6\n" -#else - " mov pc, r6\n" -#endif + " " __stringify(BX(r6)) "\n" ".L_GET_GOT:\n" " .word _GLOBAL_OFFSET_TABLE_ - .L_GOT_GOT - 4\n" ".L_SKIP_ARGS:\n" @@ -113,11 +109,7 @@ __asm__( " ldr r0, .L_FINI_PROC\n" " ldr r0, [r7, r0]\n" " @ jump to the user_s entry point\n" -#if defined(__USE_BX__) - " bx r6\n" -#else - " mov pc, r6\n" -#endif + " " __stringify(BX(r6)) "\n" "\n\n" ".L_GET_GOT:\n" " .word _GLOBAL_OFFSET_TABLE_ - .L_GOT_GOT - 4\n" diff --git a/ldso/ldso/arm/resolve.S b/ldso/ldso/arm/resolve.S index c1caf9a14..7e0058e0d 100644 --- a/ldso/ldso/arm/resolve.S +++ b/ldso/ldso/arm/resolve.S @@ -90,12 +90,10 @@ * dl-startup.c). */ -#include +#include #include #include -#include - #define sl r10 #define fp r11 #define ip r12 @@ -114,8 +112,8 @@ _dl_linux_resolve: @ function must branch to the real function, and that expects @ r0-r3 and lr to be as they were before the whole PLT stuff - @ ip can be trashed. - @ This routine is called after pushing lr, so we must push an odd - @ number of words to keep the stack correctly aligned. + @ This routine is called after pushing lr, so we must push an odd + @ number of words to keep the stack correctly aligned. stmdb sp!, {r0, r1, r2, r3, r4} ldr r0, [lr, #-4] @ r0 : = [lr-4] (GOT_TABLE[1]) @@ -124,16 +122,12 @@ _dl_linux_resolve: @ ~x = -x-1, therefore ~(r1>>2) = (-((lr-ip)>>2)-1) @ = - ((lr-ip)/4) - 1 = (ip - lr - 4)/4, as required - bl _dl_linux_resolver + bl _dl_linux_resolver - mov ip, r0 + mov ip, r0 ldmia sp!, {r0, r1, r2, r3, r4, lr} -#if defined(__USE_BX__) - bx ip -#else - mov pc,ip -#endif + BX(ip) #else @ In the thumb case _dl_linux_resolver is thumb. If a bl is used @ from arm code the linker will insert a stub call which, with -- cgit v1.2.3