aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libc/arch-mips/include/machine/elf_machdep.h1
-rw-r--r--linker/linker.cpp7
2 files changed, 8 insertions, 0 deletions
diff --git a/libc/arch-mips/include/machine/elf_machdep.h b/libc/arch-mips/include/machine/elf_machdep.h
index d27d4318..0aacedfe 100644
--- a/libc/arch-mips/include/machine/elf_machdep.h
+++ b/libc/arch-mips/include/machine/elf_machdep.h
@@ -121,6 +121,7 @@
121#define DT_MIPS_GOTSYM 0x70000013 /* first dynamic sym in got */ 121#define DT_MIPS_GOTSYM 0x70000013 /* first dynamic sym in got */
122#define DT_MIPS_HIPAGENO 0x70000014 122#define DT_MIPS_HIPAGENO 0x70000014
123#define DT_MIPS_RLD_MAP 0x70000016 /* address of loader map */ 123#define DT_MIPS_RLD_MAP 0x70000016 /* address of loader map */
124#define DT_MIPS_RLD_MAP2 0x70000035 /* offset of loader map, used for PIE */
124 125
125/* 126/*
126 * ELF Flags 127 * ELF Flags
diff --git a/linker/linker.cpp b/linker/linker.cpp
index 34099316..babefeb3 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -2402,6 +2402,13 @@ bool soinfo::prelink_image() {
2402 *dp = &_r_debug; 2402 *dp = &_r_debug;
2403 } 2403 }
2404 break; 2404 break;
2405 case DT_MIPS_RLD_MAP2:
2406 // Set the DT_MIPS_RLD_MAP2 entry to the address of _r_debug for GDB.
2407 {
2408 r_debug** dp = reinterpret_cast<r_debug**>(reinterpret_cast<ElfW(Addr)>(d) + d->d_un.d_val);
2409 *dp = &_r_debug;
2410 }
2411 break;
2405 2412
2406 case DT_MIPS_RLD_VERSION: 2413 case DT_MIPS_RLD_VERSION:
2407 case DT_MIPS_FLAGS: 2414 case DT_MIPS_FLAGS: