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>
diff --git a/linker/linker.cpp b/linker/linker.cpp
index 3409931..babefeb 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -2402,6 +2402,13 @@
           *dp = &_r_debug;
         }
         break;
+      case DT_MIPS_RLD_MAP2:
+        // Set the DT_MIPS_RLD_MAP2 entry to the address of _r_debug for GDB.
+        {
+          r_debug** dp = reinterpret_cast<r_debug**>(reinterpret_cast<ElfW(Addr)>(d) + d->d_un.d_val);
+          *dp = &_r_debug;
+        }
+        break;
 
       case DT_MIPS_RLD_VERSION:
       case DT_MIPS_FLAGS: