aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitry Ivanov2014-12-19 15:15:01 -0600
committerGerrit Code Review2014-12-19 15:15:02 -0600
commitdb3146489eecf2757cab9c3a7a0abb561f2addc8 (patch)
tree1b112c37b41793712198b43e4ae492587c6272b0
parent65e6985617d035ef45da86f8c8bcceea7bc47239 (diff)
parent688157295f55edbfddb2277e7bdf5635f6be591a (diff)
downloadplatform-bionic-db3146489eecf2757cab9c3a7a0abb561f2addc8.tar.gz
platform-bionic-db3146489eecf2757cab9c3a7a0abb561f2addc8.tar.xz
platform-bionic-db3146489eecf2757cab9c3a7a0abb561f2addc8.zip
Merge "Add support for DT_MIPS_RLD_MAP2 tag."
-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: