* i386-tdep.c (i386_coff_osabi_sniffer): Add "coff-go32" to the
[deliverable/binutils-gdb.git] / gdb / armnbsd-tdep.c
1 /* Target-specific functions for ARM running under NetBSD.
2 Copyright 2002 Free Software Foundation, Inc.
3
4 This file is part of GDB.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
20
21 #include "defs.h"
22
23 #include "arm-tdep.h"
24 #include "nbsd-tdep.h"
25 #include "solib-svr4.h"
26
27 /* Description of the longjmp buffer. */
28 #define JB_PC 24
29 #define JB_ELEMENT_SIZE INT_REGISTER_RAW_SIZE
30
31 /* For compatibility with previous implemenations of GDB on arm/NetBSD,
32 override the default little-endian breakpoint. */
33 static const char arm_nbsd_arm_le_breakpoint[] = {0x11, 0x00, 0x00, 0xe6};
34
35 static int
36 arm_netbsd_aout_in_solib_call_trampoline (CORE_ADDR pc, char *name)
37 {
38 if (strcmp (name, "_PROCEDURE_LINKAGE_TABLE_") == 0)
39 return 1;
40
41 return 0;
42 }
43
44 static void
45 arm_netbsd_init_abi_common (struct gdbarch_info info,
46 struct gdbarch *gdbarch)
47 {
48 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
49
50 tdep->lowest_pc = 0x8000;
51 tdep->arm_breakpoint = arm_nbsd_arm_le_breakpoint;
52 tdep->arm_breakpoint_size = sizeof (arm_nbsd_arm_le_breakpoint);
53
54 tdep->jb_pc = JB_PC;
55 tdep->jb_elt_size = JB_ELEMENT_SIZE;
56 }
57
58 static void
59 arm_netbsd_aout_init_abi (struct gdbarch_info info,
60 struct gdbarch *gdbarch)
61 {
62 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
63
64 arm_netbsd_init_abi_common (info, gdbarch);
65
66 set_gdbarch_in_solib_call_trampoline
67 (gdbarch, arm_netbsd_aout_in_solib_call_trampoline);
68 tdep->fp_model = ARM_FLOAT_SOFT;
69 }
70
71 static void
72 arm_netbsd_elf_init_abi (struct gdbarch_info info,
73 struct gdbarch *gdbarch)
74 {
75 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
76
77 arm_netbsd_init_abi_common (info, gdbarch);
78
79 set_solib_svr4_fetch_link_map_offsets (gdbarch,
80 nbsd_ilp32_solib_svr4_fetch_link_map_offsets);
81
82 tdep->fp_model = ARM_FLOAT_SOFT_VFP;
83 }
84
85 static enum gdb_osabi
86 arm_netbsd_aout_osabi_sniffer (bfd *abfd)
87 {
88 if (strcmp (bfd_get_target (abfd), "a.out-arm-netbsd") == 0)
89 return GDB_OSABI_NETBSD_AOUT;
90
91 return GDB_OSABI_UNKNOWN;
92 }
93
94 void
95 _initialize_arm_netbsd_tdep (void)
96 {
97 gdbarch_register_osabi_sniffer (bfd_arch_arm, bfd_target_aout_flavour,
98 arm_netbsd_aout_osabi_sniffer);
99
100 gdbarch_register_osabi (bfd_arch_arm, GDB_OSABI_NETBSD_AOUT,
101 arm_netbsd_aout_init_abi);
102 gdbarch_register_osabi (bfd_arch_arm, GDB_OSABI_NETBSD_ELF,
103 arm_netbsd_elf_init_abi);
104 }
This page took 0.06092 seconds and 4 git commands to generate.