]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Support _r_debug for static binaries.
authorCarlos O'Donell <carlos@redhat.com>
Fri, 11 Apr 2014 16:43:58 +0000 (12:43 -0400)
committerCarlos O'Donell <carlos@redhat.com>
Mon, 14 Apr 2014 19:45:40 +0000 (15:45 -0400)
We initialize _r_debug for static binaries to allows debug
agents to treat static binaries a little more like dyanmic
ones. This simplifies the work a debug agent has to do to
access TLS in a static binary via libthread_db.

Tested on x86_64.

See:
https://sourceware.org/ml/libc-alpha/2014-04/msg00183.html

[BZ #16831]
* csu/libc-start.c (LIBC_START_MAIN) [!SHARED]: Call
_dl_debug_initialize.

ChangeLog
NEWS
csu/libc-start.c

index 77fc36e4ec89d3aa80d5633f8a7b788a3ed42940..d16da4ea1060bb0595389c9883773553231dab4b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-04-14  Carlos O'Donell  <carlos@redhat.com>
+
+       [BZ #16831]
+       * csu/libc-start.c (LIBC_START_MAIN) [!SHARED]: Call
+       _dl_debug_initialize.
+
 2014-04-14  Carlos O'Donell  <carlos@redhat.com>
 
        * configure.ac: Remove SELinux header check.
diff --git a/NEWS b/NEWS
index bbcc2232b03f2d07774246c3dd66e33e19725484..a63b4256911f2baefa73111cb5824a0c062723ac 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -14,7 +14,7 @@ Version 2.20
   16610, 16611, 16613, 16623, 16632, 16634, 16639, 16642, 16648, 16649,
   16670, 16674, 16677, 16680, 16683, 16689, 16695, 16701, 16706, 16707,
   16712, 16713, 16714, 16731, 16739, 16743, 16758, 16759, 16760, 16770,
-  16786, 16789, 16799, 16800, 16815, 16838.
+  16786, 16789, 16799, 16800, 16815, 16831, 16838.
 
 * Running the testsuite no longer terminates as soon as a test fails.
   Instead, a file tests.sum (xtests.sum from "make xcheck") is generated,
index 3b7092b359451b77b22a40b68062a1284f931d37..d571a1aca94bc9eb0d5117ba614294d6b252363f 100644 (file)
@@ -264,6 +264,9 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
     GLRO(dl_debug_printf) ("\ntransferring control: %s\n\n", argv[0]);
 #endif
 
+#ifndef SHARED
+  _dl_debug_initialize (0, LM_ID_BASE);
+#endif
 #ifdef HAVE_CLEANUP_JMP_BUF
   /* Memory for the cancellation buffer.  */
   struct pthread_unwind_buf unwind_buf;