#include "target.h"
 #include "nat/aarch64-hw-point.h"
 
+#include "elf/common.h"
+
 #include <sys/param.h>
 #include <sys/ptrace.h>
 #include <machine/armreg.h>
 #include <machine/reg.h>
 
 #include "fbsd-nat.h"
+#include "aarch64-tdep.h"
 #include "aarch64-fbsd-tdep.h"
 #include "aarch64-nat.h"
 #include "inf-ptrace.h"
   void fetch_registers (struct regcache *, int) override;
   void store_registers (struct regcache *, int) override;
 
+  const struct target_desc *read_description () override;
+
 #ifdef HAVE_DBREG
   /* Hardware breakpoints and watchpoints.  */
   bool stopped_by_watchpoint () override;
                                  &aarch64_fbsd_gregset);
   fetch_register_set<struct fpreg> (regcache, regnum, PT_GETFPREGS,
                                    &aarch64_fbsd_fpregset);
+
+  gdbarch *gdbarch = regcache->arch ();
+  aarch64_gdbarch_tdep *tdep = (aarch64_gdbarch_tdep *) gdbarch_tdep (gdbarch);
+  if (tdep->has_tls ())
+    {
+      const struct regcache_map_entry aarch64_fbsd_tls_regmap[] =
+       {
+         { 1, tdep->tls_regnum, 8 },
+         { 0 }
+       };
+
+      const struct regset aarch64_fbsd_tls_regset =
+       {
+         aarch64_fbsd_tls_regmap,
+         regcache_supply_regset, regcache_collect_regset
+       };
+
+      fetch_regset<uint64_t> (regcache, regnum, NT_ARM_TLS,
+                             &aarch64_fbsd_tls_regset);
+    }
 }
 
 /* Store register REGNUM back into the inferior.  If REGNUM is -1, do
                                  &aarch64_fbsd_gregset);
   store_register_set<struct fpreg> (regcache, regnum, PT_GETFPREGS,
                                    PT_SETFPREGS, &aarch64_fbsd_fpregset);
+
+  gdbarch *gdbarch = regcache->arch ();
+  aarch64_gdbarch_tdep *tdep = (aarch64_gdbarch_tdep *) gdbarch_tdep (gdbarch);
+  if (tdep->has_tls ())
+    {
+      const struct regcache_map_entry aarch64_fbsd_tls_regmap[] =
+       {
+         { 1, tdep->tls_regnum, 8 },
+         { 0 }
+       };
+
+      const struct regset aarch64_fbsd_tls_regset =
+       {
+         aarch64_fbsd_tls_regmap,
+         regcache_supply_regset, regcache_collect_regset
+       };
+
+      store_regset<uint64_t> (regcache, regnum, NT_ARM_TLS,
+                             &aarch64_fbsd_tls_regset);
+    }
+}
+
+/* Implement the target read_description method.  */
+
+const struct target_desc *
+aarch64_fbsd_nat_target::read_description ()
+{
+  bool tls = have_regset (inferior_ptid, NT_ARM_TLS) != 0;
+  return aarch64_read_description (0, false, false, tls);
 }
 
 #ifdef HAVE_DBREG