1 /* Handle shared libraries for GDB, the GNU Debugger.
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 2 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, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
25 /* Critical offsets and sizes which describe struct r_debug and
26 struct link_map on SVR4-like targets. All offsets and sizes are
27 in bytes unless otherwise specified. */
29 struct link_map_offsets
31 /* Size of struct r_debug (or equivalent), or at least enough of it to
32 be able to obtain the r_map field. */
35 /* Offset to the r_map field in struct r_debug. */
38 /* Size of the r_map field in struct r_debug. */
41 /* Size of struct link_map (or equivalent), or at least enough of it
42 to be able to obtain the fields below. */
45 /* Offset to l_addr field in struct link_map. */
48 /* Size of l_addr field in struct link_map. */
51 /* Offset to l_next field in struct link_map. */
54 /* Size of l_next field in struct link_map. */
57 /* Offset to l_prev field in struct link_map. */
60 /* Size of l_prev field in struct link_map. */
63 /* Offset to l_name field in struct link_map. */
66 /* Size of l_name field in struct link_map. */
70 /* set_solib_svr4_fetch_link_map_offsets() is intended to be called by
71 a <arch>_gdbarch_init() function. It is used to establish an
72 architecture specific link_map_offsets fetcher for the architecture
75 extern void set_solib_svr4_fetch_link_map_offsets
76 (struct gdbarch
*gdbarch
, struct link_map_offsets
*(*func
) (void));
78 /* This function is called by thread_db.c. Return the address of the
79 link map for the given objfile. */
80 extern CORE_ADDR
svr4_fetch_objfile_link_map (struct objfile
*objfile
);
82 /* legacy_svr4_fetch_link_map_offsets_hook is a pointer to a function
83 which is used to fetch link map offsets. It will only be set
84 by solib-legacy.c, if at all. */
85 extern struct link_map_offsets
*(*legacy_svr4_fetch_link_map_offsets_hook
)(void);
87 /* Fetch (and possibly build) an appropriate `struct link_map_offsets'
88 for ILP32 and LP64 SVR4 systems. */
89 extern struct link_map_offsets
*svr4_ilp32_fetch_link_map_offsets (void);
90 extern struct link_map_offsets
*svr4_lp64_fetch_link_map_offsets (void);