1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00

elf: Add <dl-debug.h>

Add <dl-debug.h> to setup debugging entry in PT_DYNAMIC segment to support
DT_DEBUG, DT_MIPS_RLD_MAP_REL and DT_MIPS_RLD_MAP.

Tested on x86-64, x32 and i686 as well as with build-many-glibcs.py.
This commit is contained in:
H.J. Lu
2021-12-09 18:24:37 -08:00
parent bd1616c6be
commit 9288c92d00
5 changed files with 80 additions and 33 deletions

View File

@@ -24,6 +24,7 @@
#include <ldsodefs.h>
#include <dl-machine.h>
#include <dl-debug.h>
#define RESOLVE_MAP(map, scope, sym, version, flags) map
#include "dynamic-link.h"
@@ -68,14 +69,6 @@ _dl_relocate_static_pie (void)
/* Set up debugging before the debugger is notified for the first
time. */
# ifdef ELF_MACHINE_DEBUG_SETUP
/* Some machines (e.g. MIPS) don't use DT_DEBUG in this way. */
ELF_MACHINE_DEBUG_SETUP (main_map, r);
# else
if (main_map->l_info[DT_DEBUG] != NULL)
/* There is a DT_DEBUG entry in the dynamic section. Fill it in
with the run-time address of the r_debug structure */
main_map->l_info[DT_DEBUG]->d_un.d_ptr = (ElfW(Addr)) r;
# endif
elf_setup_debug_entry (main_map, r);
}
#endif