about summary refs log tree commit diff
path: root/sysdeps/mips/dl-machine.h
diff options
context:
space:
mode:
authorMatthew Fortune <matthew.fortune@imgtec.com>2015-06-11 10:43:48 +0100
committerMatthew Fortune <matthew.fortune@imgtec.com>2015-06-26 12:03:45 +0100
commita2057c984e4314c3740f04cf54e36c824e4c8f32 (patch)
tree672f0235b7e453357caf0a2ae08ada10e5506f34 /sysdeps/mips/dl-machine.h
parenta8e2112ae3e57fae592d84af2936a61d6239a248 (diff)
downloadglibc-a2057c984e4314c3740f04cf54e36c824e4c8f32.tar.gz
glibc-a2057c984e4314c3740f04cf54e36c824e4c8f32.tar.xz
glibc-a2057c984e4314c3740f04cf54e36c824e4c8f32.zip
Add support for DT_MIPS_RLD_MAP_REL.
This tag allows debugging of MIPS position independent executables
and provides access to shared library information.

	* elf/elf.h (DT_MIPS_RLD_MAP_REL): New macro.
	(DT_MIPS_NUM): Update.
	* sysdeps/mips/dl-machine.h (ELF_MACHINE_DEBUG_SETUP): Handle
	DT_MIPS_RLD_MAP_REL.
Diffstat (limited to 'sysdeps/mips/dl-machine.h')
-rw-r--r--sysdeps/mips/dl-machine.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h
index d63238a4fe..8738564241 100644
--- a/sysdeps/mips/dl-machine.h
+++ b/sysdeps/mips/dl-machine.h
@@ -68,10 +68,17 @@
    in l_info array.  */
 #define DT_MIPS(x) (DT_MIPS_##x - DT_LOPROC + DT_NUM)
 
-/* If there is a DT_MIPS_RLD_MAP entry in the dynamic section, fill it in
-   with the run-time address of the r_debug structure  */
+/* If there is a DT_MIPS_RLD_MAP_REL or DT_MIPS_RLD_MAP entry in the dynamic
+   section, fill in the debug map pointer with the run-time address of the
+   r_debug structure.  */
 #define ELF_MACHINE_DEBUG_SETUP(l,r) \
-do { if ((l)->l_info[DT_MIPS (RLD_MAP)]) \
+do { if ((l)->l_info[DT_MIPS (RLD_MAP_REL)]) \
+       { \
+	 char *ptr = (char *)(l)->l_info[DT_MIPS (RLD_MAP_REL)]; \
+	 ptr += (l)->l_info[DT_MIPS (RLD_MAP_REL)]->d_un.d_val; \
+	 *(ElfW(Addr) *)ptr = (ElfW(Addr)) (r); \
+       } \
+     else if ((l)->l_info[DT_MIPS (RLD_MAP)]) \
        *(ElfW(Addr) *)((l)->l_info[DT_MIPS (RLD_MAP)]->d_un.d_ptr) = \
        (ElfW(Addr)) (r); \
    } while (0)