[gdb/testsuite] Fix gdb.dwarf2/locexpr-data-member-location.exp with nopie
[binutils-gdb.git] / gdb / tic6x-linux-tdep.c
index 1a03a29b81228b65591e646138efabcf69c7c848..5a93294361a5c0acab9bd67f32552ad14cc76451 100644 (file)
@@ -1,5 +1,5 @@
 /* GNU/Linux on  TI C6x target support.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
+   Copyright (C) 2011-2022 Free Software Foundation, Inc.
    Contributed by Yao Qi <yao@codesourcery.com>
 
    This file is part of GDB.
 #include "tramp-frame.h"
 #include "elf-bfd.h"
 #include "elf/tic6x.h"
-
-#include "features/tic6x-c64xp-linux.c"
-#include "features/tic6x-c64x-linux.c"
-#include "features/tic6x-c62x-linux.c"
+#include "gdbarch.h"
 
 /* The offset from rt_sigframe pointer to SP register.  */
 #define TIC6X_SP_RT_SIGFRAME 8
@@ -48,7 +45,7 @@ static const gdb_byte tic6x_bkpt_bnop_le[] = { 0x22, 0xa1, 0x00, 0x00 };
 static unsigned int
 tic6x_register_sigcontext_offset (unsigned int regnum, struct gdbarch *gdbarch)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  tic6x_gdbarch_tdep *tdep = (tic6x_gdbarch_tdep *) gdbarch_tdep (gdbarch);
 
   if (regnum == TIC6X_A4_REGNUM || regnum == TIC6X_A4_REGNUM + 2
       || regnum == TIC6X_A4_REGNUM + 4)
@@ -95,7 +92,7 @@ tic6x_linux_rt_sigreturn_init (const struct tramp_frame *self,
                    + TIC6X_SIGINFO_SIZE
                    + 4 + 4 /* uc_flags and *uc_link in struct ucontext.  */
                    + TIC6X_STACK_T_SIZE);
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  tic6x_gdbarch_tdep *tdep = (tic6x_gdbarch_tdep *) gdbarch_tdep (gdbarch);
   unsigned int reg_offset;
   unsigned int i;
 
@@ -141,7 +138,7 @@ static struct tramp_frame tic6x_linux_rt_sigreturn_tramp_frame =
   4,
   {
     {0x000045aa, 0x0fffffff},  /* mvk .S2 139,b0 */
-    {0x10000000, -1},          /* swe */
+    {0x10000000, ULONGEST_MAX},                /* swe */
     {TRAMP_SENTINEL_INSN}
   },
   tic6x_linux_rt_sigreturn_init
@@ -168,9 +165,9 @@ extern struct target_so_ops dsbt_so_ops;
 static void
 tic6x_uclinux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  tic6x_gdbarch_tdep *tdep = (tic6x_gdbarch_tdep *) gdbarch_tdep (gdbarch);
 
-  linux_init_abi (info, gdbarch);
+  linux_init_abi (info, gdbarch, 0);
 
   /* Shared library handling.  */
   set_solib_ops (gdbarch, &dsbt_so_ops);
@@ -207,13 +204,10 @@ tic6x_uclinux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
                                &tic6x_linux_rt_sigreturn_tramp_frame);
 }
 
+void _initialize_tic6x_linux_tdep ();
 void
-_initialize_tic6x_linux_tdep (void)
+_initialize_tic6x_linux_tdep ()
 {
   gdbarch_register_osabi (bfd_arch_tic6x, 0, GDB_OSABI_LINUX,
                          tic6x_uclinux_init_abi);
-
-  initialize_tdesc_tic6x_c64xp_linux ();
-  initialize_tdesc_tic6x_c64x_linux ();
-  initialize_tdesc_tic6x_c62x_linux ();
 }