Commit | Line | Data |
---|---|---|
13437d4b | 1 | /* Handle shared libraries for GDB, the GNU Debugger. |
e4bbbda8 | 2 | |
6aba47ca | 3 | Copyright (C) 2000, 2004, 2006, 2007 Free Software Foundation, Inc. |
13437d4b KB |
4 | |
5 | This file is part of GDB. | |
6 | ||
7 | This program is free software; you can redistribute it and/or modify | |
8 | it under the terms of the GNU General Public License as published by | |
9 | the Free Software Foundation; either version 2 of the License, or | |
10 | (at your option) any later version. | |
11 | ||
12 | This program is distributed in the hope that it will be useful, | |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
18 | along with this program; if not, write to the Free Software | |
197e01b6 EZ |
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 | Boston, MA 02110-1301, USA. */ | |
13437d4b | 21 | |
82b38f72 MK |
22 | #ifndef SOLIB_SVR4_H |
23 | #define SOLIB_SVR4_H | |
db1ea9ba | 24 | |
da3331ec AC |
25 | struct objfile; |
26 | ||
13437d4b KB |
27 | /* Critical offsets and sizes which describe struct r_debug and |
28 | struct link_map on SVR4-like targets. All offsets and sizes are | |
29 | in bytes unless otherwise specified. */ | |
30 | ||
31 | struct link_map_offsets | |
32 | { | |
e4cd0d6a MK |
33 | /* Offset and size of r_debug.r_version. */ |
34 | int r_version_offset, r_version_size; | |
13437d4b | 35 | |
e4cd0d6a | 36 | /* Offset of r_debug.r_map. */ |
13437d4b KB |
37 | int r_map_offset; |
38 | ||
e4cd0d6a MK |
39 | /* Offset of r_debug.r_ldsomap. */ |
40 | int r_ldsomap_offset; | |
13437d4b KB |
41 | |
42 | /* Size of struct link_map (or equivalent), or at least enough of it | |
43 | to be able to obtain the fields below. */ | |
44 | int link_map_size; | |
45 | ||
46 | /* Offset to l_addr field in struct link_map. */ | |
47 | int l_addr_offset; | |
48 | ||
cc10cae3 AO |
49 | /* Offset to l_ld field in struct link_map. */ |
50 | int l_ld_offset; | |
51 | ||
13437d4b KB |
52 | /* Offset to l_next field in struct link_map. */ |
53 | int l_next_offset; | |
54 | ||
13437d4b KB |
55 | /* Offset to l_prev field in struct link_map. */ |
56 | int l_prev_offset; | |
57 | ||
13437d4b KB |
58 | /* Offset to l_name field in struct link_map. */ |
59 | int l_name_offset; | |
13437d4b KB |
60 | }; |
61 | ||
e5e2b9ff KB |
62 | /* set_solib_svr4_fetch_link_map_offsets() is intended to be called by |
63 | a <arch>_gdbarch_init() function. It is used to establish an | |
64 | architecture specific link_map_offsets fetcher for the architecture | |
65 | being defined. */ | |
66 | ||
67 | extern void set_solib_svr4_fetch_link_map_offsets | |
68 | (struct gdbarch *gdbarch, struct link_map_offsets *(*func) (void)); | |
21479ded | 69 | |
550633cb EZ |
70 | /* This function is called by thread_db.c. Return the address of the |
71 | link map for the given objfile. */ | |
72 | extern CORE_ADDR svr4_fetch_objfile_link_map (struct objfile *objfile); | |
73 | ||
21479ded KB |
74 | /* legacy_svr4_fetch_link_map_offsets_hook is a pointer to a function |
75 | which is used to fetch link map offsets. It will only be set | |
7095b863 MS |
76 | by solib-legacy.c, if at all. */ |
77 | extern struct link_map_offsets *(*legacy_svr4_fetch_link_map_offsets_hook) (void); | |
e4bbbda8 MK |
78 | |
79 | /* Fetch (and possibly build) an appropriate `struct link_map_offsets' | |
80 | for ILP32 and LP64 SVR4 systems. */ | |
81 | extern struct link_map_offsets *svr4_ilp32_fetch_link_map_offsets (void); | |
82 | extern struct link_map_offsets *svr4_lp64_fetch_link_map_offsets (void); | |
db1ea9ba | 83 | |
82b38f72 | 84 | #endif /* solib-svr4.h */ |