1 /* Target-dependent code for GNU/Linux Super-H.
3 Copyright (C) 2005, 2007, 2008, 2009, 2010, 2011
4 Free Software Foundation, Inc.
6 This file is part of GDB.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
24 #include "solib-svr4.h"
27 #include "glibc-tdep.h"
29 #include "linux-tdep.h"
31 #define REGSx16(base) \
49 /* Describe the contents of the .reg section of the core file. */
51 static const struct sh_corefile_regmap gregs_table[] =
60 {-1 /* Terminator. */, 0}
63 /* Describe the contents of the .reg2 section of the core file. */
65 static const struct sh_corefile_regmap fpregs_table[] =
68 /* REGSx16 xfp_regs omitted. */
71 {-1 /* Terminator. */, 0}
75 sh_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
77 linux_init_abi (info, gdbarch);
79 /* GNU/Linux uses SVR4-style shared libraries. */
80 set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
81 set_solib_svr4_fetch_link_map_offsets
82 (gdbarch, svr4_ilp32_fetch_link_map_offsets);
83 set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver);
85 set_gdbarch_fetch_tls_load_module_address (gdbarch,
86 svr4_fetch_objfile_link_map);
88 /* Core files are supported for 32-bit SH only, at present. */
89 if (info.bfd_arch_info->mach != bfd_mach_sh5)
91 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
93 tdep->core_gregmap = (struct sh_corefile_regmap *)gregs_table;
94 tdep->core_fpregmap = (struct sh_corefile_regmap *)fpregs_table;
98 /* Provide a prototype to silence -Wmissing-prototypes. */
99 extern void _initialize_sh_linux_tdep (void);
102 _initialize_sh_linux_tdep (void)
104 gdbarch_register_osabi (bfd_arch_sh, 0, GDB_OSABI_LINUX, sh_linux_init_abi);