ensure debugger hook for dynamic linker does not point to a PLT slot
authorRich Felker <dalias@aerifal.cx>
Sat, 18 Apr 2015 03:23:05 +0000 (23:23 -0400)
committerRich Felker <dalias@aerifal.cx>
Sat, 18 Apr 2015 03:23:05 +0000 (23:23 -0400)
this change is made in preparation to support linking without
-Bsymbolic-functions.

src/ldso/dynlink.c

index 122fc49ee7b43ed441346335c3bdac8f1f57c42a..9f91a73822933a39cc1a33100c50426d5e76b4ec 100644 (file)
@@ -998,10 +998,12 @@ static void do_init_fini(struct dso *p)
        if (need_locking) pthread_mutex_unlock(&init_fini_lock);
 }
 
-void _dl_debug_state(void)
+static void dl_debug_state(void)
 {
 }
 
+weak_alias(dl_debug_state, _dl_debug_state);
+
 void __reset_tls()
 {
        pthread_t self = __pthread_self();
@@ -1369,7 +1371,7 @@ _Noreturn void __dls3(size_t *sp)
        runtime = 1;
 
        debug.ver = 1;
-       debug.bp = _dl_debug_state;
+       debug.bp = dl_debug_state;
        debug.head = head;
        debug.base = ldso.base;
        debug.state = 0;