GDB: fix offsets for reading svr4 link map on x86_64-nacl

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10797007
diff --git a/gdb/nacl-tdep.c b/gdb/nacl-tdep.c
index edb3763..53dc8f9 100644
--- a/gdb/nacl-tdep.c
+++ b/gdb/nacl-tdep.c
@@ -71,6 +71,34 @@
   return amd64_nacl_addr_bits_remove (gdbarch, sp);
 }
 
+struct link_map_offsets *
+amd64_nacl_fetch_link_map_offsets (void)
+{
+  static struct link_map_offsets lmo;
+  static struct link_map_offsets *lmp = NULL;
+
+  if (lmp == NULL)
+    {
+      lmp = &lmo;
+
+      lmo.r_version_offset = 0;
+      lmo.r_version_size = 4;
+      lmo.r_map_offset = 4;
+      lmo.r_brk_offset = 8;
+      /* Dynamic linker is in the normal list of shared objects.  */
+      lmo.r_ldsomap_offset = -1;
+
+      lmo.link_map_size = 24;
+      lmo.l_addr_offset = 0;
+      lmo.l_name_offset = 8;
+      lmo.l_ld_offset = 12;
+      lmo.l_next_offset = 16;
+      lmo.l_prev_offset = 20;
+    }
+
+  return lmp;
+}
+
 static void
 amd64_nacl_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
@@ -79,7 +107,7 @@
   amd64_init_abi (info, gdbarch);
   tdep->tdesc = tdesc_amd64_linux;
   set_solib_svr4_fetch_link_map_offsets (gdbarch,
-					 svr4_lp64_fetch_link_map_offsets);
+					 amd64_nacl_fetch_link_map_offsets);
   nacl_init_abi (info, gdbarch);
 
   /* NaCl data model.