aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghu Gandham2014-12-18 21:12:19 -0600
committerRaghu Gandham2014-12-19 13:13:11 -0600
commit688157295f55edbfddb2277e7bdf5635f6be591a (patch)
tree1b112c37b41793712198b43e4ae492587c6272b0
parent65e6985617d035ef45da86f8c8bcceea7bc47239 (diff)
downloadplatform-bionic-688157295f55edbfddb2277e7bdf5635f6be591a.tar.gz
platform-bionic-688157295f55edbfddb2277e7bdf5635f6be591a.tar.xz
platform-bionic-688157295f55edbfddb2277e7bdf5635f6be591a.zip
Add support for DT_MIPS_RLD_MAP2 tag.
Position Independent Executables cannot communicate with GDB using DT_MIPS_RLD_TAG. Hence a new tag DT_MIPS_RLD_MAP2 got introduced to fix the issue. Change-Id: I77ce3faf1ef2e121003b804ecd291abb25cfbb56 Signed-off-by: Nikola Veljkovic<Nikola.Veljkovic@imgtec.com>
-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: