1 /* Handle SunOS shared libraries for GDB, the GNU Debugger.
2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
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 #include <sys/types.h>
27 #include "gdb_string.h"
28 #include <sys/param.h>
31 /* SunOS shared libs need the nlist structure. */
45 /* Link map info to include in an allocated so_list entry */
49 /* Pointer to copy of link map from inferior. The type is char *
50 rather than void *, so that we may use byte offsets to find the
51 various fields without the need for a cast. */
56 /* Symbols which are used to locate the base of the link map structures. */
58 static char *debug_base_symbols
[] =
65 static char *main_name_list
[] =
71 /* Macro to extract an address from a solib structure. When GDB is
72 configured for some 32-bit targets (e.g. Solaris 2.7 sparc), BFD is
73 configured to handle 64-bit targets, so CORE_ADDR is 64 bits. We
74 have to extract only the significant bits of addresses to get the
75 right address when accessing the core file BFD.
77 Assume that the address is unsigned. */
79 #define SOLIB_EXTRACT_ADDRESS(MEMBER) \
80 extract_unsigned_integer (&(MEMBER), sizeof (MEMBER))
82 /* local data declarations */
84 static struct link_dynamic dynamic_copy
;
85 static struct link_dynamic_2 ld_2_copy
;
86 static struct ld_debug debug_copy
;
87 static CORE_ADDR debug_addr
;
88 static CORE_ADDR flag_addr
;
91 #define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
93 #define fieldsize(TYPE, MEMBER) (sizeof (((TYPE *)0)->MEMBER))
95 /* link map access functions */
98 LM_ADDR (struct so_list
*so
)
100 int lm_addr_offset
= offsetof (struct link_map
, lm_addr
);
101 int lm_addr_size
= fieldsize (struct link_map
, lm_addr
);
103 return (CORE_ADDR
) extract_signed_integer (so
->lm_info
->lm
+ lm_addr_offset
,
108 LM_NEXT (struct so_list
*so
)
110 int lm_next_offset
= offsetof (struct link_map
, lm_next
);
111 int lm_next_size
= fieldsize (struct link_map
, lm_next
);
113 /* Assume that the address is unsigned. */
114 return extract_unsigned_integer (so
->lm_info
->lm
+ lm_next_offset
,
119 LM_NAME (struct so_list
*so
)
121 int lm_name_offset
= offsetof (struct link_map
, lm_name
);
122 int lm_name_size
= fieldsize (struct link_map
, lm_name
);
124 /* Assume that the address is unsigned. */
125 return extract_unsigned_integer (so
->lm_info
->lm
+ lm_name_offset
,
129 static CORE_ADDR debug_base
; /* Base of dynamic linker structures */
131 /* Local function prototypes */
133 static int match_main (char *);
135 /* Allocate the runtime common object file. */
138 allocate_rt_common_objfile (void)
140 struct objfile
*objfile
;
141 struct objfile
*last_one
;
143 objfile
= (struct objfile
*) xmalloc (sizeof (struct objfile
));
144 memset (objfile
, 0, sizeof (struct objfile
));
146 objfile
->psymbol_cache
= bcache_xmalloc ();
147 objfile
->macro_cache
= bcache_xmalloc ();
148 obstack_specify_allocation (&objfile
->psymbol_obstack
, 0, 0, xmalloc
,
150 obstack_specify_allocation (&objfile
->symbol_obstack
, 0, 0, xmalloc
,
152 obstack_specify_allocation (&objfile
->type_obstack
, 0, 0, xmalloc
,
154 objfile
->name
= mstrsave (objfile
->md
, "rt_common");
156 /* Add this file onto the tail of the linked list of other such files. */
158 objfile
->next
= NULL
;
159 if (object_files
== NULL
)
160 object_files
= objfile
;
163 for (last_one
= object_files
;
165 last_one
= last_one
->next
);
166 last_one
->next
= objfile
;
169 rt_common_objfile
= objfile
;
172 /* Read all dynamically loaded common symbol definitions from the inferior
173 and put them into the minimal symbol table for the runtime common
177 solib_add_common_symbols (CORE_ADDR rtc_symp
)
179 struct rtc_symb inferior_rtc_symb
;
180 struct nlist inferior_rtc_nlist
;
184 /* Remove any runtime common symbols from previous runs. */
186 if (rt_common_objfile
!= NULL
&& rt_common_objfile
->minimal_symbol_count
)
188 obstack_free (&rt_common_objfile
->symbol_obstack
, 0);
189 obstack_specify_allocation (&rt_common_objfile
->symbol_obstack
, 0, 0,
191 rt_common_objfile
->minimal_symbol_count
= 0;
192 rt_common_objfile
->msymbols
= NULL
;
193 terminate_minimal_symbol_table (rt_common_objfile
);
196 init_minimal_symbol_collection ();
197 make_cleanup_discard_minimal_symbols ();
201 read_memory (rtc_symp
,
202 (char *) &inferior_rtc_symb
,
203 sizeof (inferior_rtc_symb
));
204 read_memory (SOLIB_EXTRACT_ADDRESS (inferior_rtc_symb
.rtc_sp
),
205 (char *) &inferior_rtc_nlist
,
206 sizeof (inferior_rtc_nlist
));
207 if (inferior_rtc_nlist
.n_type
== N_COMM
)
209 /* FIXME: The length of the symbol name is not available, but in the
210 current implementation the common symbol is allocated immediately
211 behind the name of the symbol. */
212 len
= inferior_rtc_nlist
.n_value
- inferior_rtc_nlist
.n_un
.n_strx
;
214 name
= xmalloc (len
);
215 read_memory (SOLIB_EXTRACT_ADDRESS (inferior_rtc_nlist
.n_un
.n_name
),
218 /* Allocate the runtime common objfile if necessary. */
219 if (rt_common_objfile
== NULL
)
220 allocate_rt_common_objfile ();
222 prim_record_minimal_symbol (name
, inferior_rtc_nlist
.n_value
,
223 mst_bss
, rt_common_objfile
);
226 rtc_symp
= SOLIB_EXTRACT_ADDRESS (inferior_rtc_symb
.rtc_next
);
229 /* Install any minimal symbols that have been collected as the current
230 minimal symbols for the runtime common objfile. */
232 install_minimal_symbols (rt_common_objfile
);
240 locate_base -- locate the base address of dynamic linker structs
244 CORE_ADDR locate_base (void)
248 For both the SunOS and SVR4 shared library implementations, if the
249 inferior executable has been linked dynamically, there is a single
250 address somewhere in the inferior's data space which is the key to
251 locating all of the dynamic linker's runtime structures. This
252 address is the value of the debug base symbol. The job of this
253 function is to find and return that address, or to return 0 if there
254 is no such address (the executable is statically linked for example).
256 For SunOS, the job is almost trivial, since the dynamic linker and
257 all of it's structures are statically linked to the executable at
258 link time. Thus the symbol for the address we are looking for has
259 already been added to the minimal symbol table for the executable's
260 objfile at the time the symbol file's symbols were read, and all we
261 have to do is look it up there. Note that we explicitly do NOT want
262 to find the copies in the shared library.
264 The SVR4 version is a bit more complicated because the address
265 is contained somewhere in the dynamic info section. We have to go
266 to a lot more work to discover the address of the debug base symbol.
267 Because of this complexity, we cache the value we find and return that
268 value on subsequent invocations. Note there is no copy in the
269 executable symbol tables.
276 struct minimal_symbol
*msymbol
;
277 CORE_ADDR address
= 0;
280 /* For SunOS, we want to limit the search for the debug base symbol to the
281 executable being debugged, since there is a duplicate named symbol in the
282 shared library. We don't want the shared library versions. */
284 for (symbolp
= debug_base_symbols
; *symbolp
!= NULL
; symbolp
++)
286 msymbol
= lookup_minimal_symbol (*symbolp
, NULL
, symfile_objfile
);
287 if ((msymbol
!= NULL
) && (SYMBOL_VALUE_ADDRESS (msymbol
) != 0))
289 address
= SYMBOL_VALUE_ADDRESS (msymbol
);
300 first_link_map_member -- locate first member in dynamic linker's map
304 static CORE_ADDR first_link_map_member (void)
308 Find the first element in the inferior's dynamic link map, and
309 return its address in the inferior. This function doesn't copy the
310 link map entry itself into our address space; current_sos actually
314 first_link_map_member (void)
318 read_memory (debug_base
, (char *) &dynamic_copy
, sizeof (dynamic_copy
));
319 if (dynamic_copy
.ld_version
>= 2)
321 /* It is a version that we can deal with, so read in the secondary
322 structure and find the address of the link map list from it. */
323 read_memory (SOLIB_EXTRACT_ADDRESS (dynamic_copy
.ld_un
.ld_2
),
324 (char *) &ld_2_copy
, sizeof (struct link_dynamic_2
));
325 lm
= SOLIB_EXTRACT_ADDRESS (ld_2_copy
.ld_loaded
);
331 open_symbol_file_object (void *from_ttyp
)
339 current_sos -- build a list of currently loaded shared objects
343 struct so_list *current_sos ()
347 Build a list of `struct so_list' objects describing the shared
348 objects currently loaded in the inferior. This list does not
349 include an entry for the main executable file.
351 Note that we only gather information directly available from the
352 inferior --- we don't examine any of the shared library files
353 themselves. The declaration of `struct so_list' says which fields
354 we provide values for. */
356 static struct so_list
*
357 sunos_current_sos (void)
360 struct so_list
*head
= 0;
361 struct so_list
**link_ptr
= &head
;
365 /* Make sure we've looked up the inferior's dynamic linker's base
369 debug_base
= locate_base ();
371 /* If we can't find the dynamic linker's base structure, this
372 must not be a dynamically linked executable. Hmm. */
377 /* Walk the inferior's link map list, and build our list of
378 `struct so_list' nodes. */
379 lm
= first_link_map_member ();
383 = (struct so_list
*) xmalloc (sizeof (struct so_list
));
384 struct cleanup
*old_chain
= make_cleanup (xfree
, new);
386 memset (new, 0, sizeof (*new));
388 new->lm_info
= xmalloc (sizeof (struct lm_info
));
389 make_cleanup (xfree
, new->lm_info
);
391 new->lm_info
->lm
= xmalloc (sizeof (struct link_map
));
392 make_cleanup (xfree
, new->lm_info
->lm
);
393 memset (new->lm_info
->lm
, 0, sizeof (struct link_map
));
395 read_memory (lm
, new->lm_info
->lm
, sizeof (struct link_map
));
399 /* Extract this shared object's name. */
400 target_read_string (LM_NAME (new), &buffer
,
401 SO_NAME_MAX_PATH_SIZE
- 1, &errcode
);
404 warning ("current_sos: Can't read pathname for load map: %s\n",
405 safe_strerror (errcode
));
409 strncpy (new->so_name
, buffer
, SO_NAME_MAX_PATH_SIZE
- 1);
410 new->so_name
[SO_NAME_MAX_PATH_SIZE
- 1] = '\0';
412 strcpy (new->so_original_name
, new->so_name
);
415 /* If this entry has no name, or its name matches the name
416 for the main executable, don't include it in the list. */
417 if (! new->so_name
[0]
418 || match_main (new->so_name
))
424 link_ptr
= &new->next
;
427 discard_cleanups (old_chain
);
434 /* On some systems, the only way to recognize the link map entry for
435 the main executable file is by looking at its name. Return
436 non-zero iff SONAME matches one of the known main executable names. */
439 match_main (char *soname
)
443 for (mainp
= main_name_list
; *mainp
!= NULL
; mainp
++)
445 if (strcmp (soname
, *mainp
) == 0)
454 sunos_in_dynsym_resolve_code (CORE_ADDR pc
)
463 disable_break -- remove the "mapping changed" breakpoint
467 static int disable_break ()
471 Removes the breakpoint that gets hit when the dynamic linker
472 completes a mapping change.
479 CORE_ADDR breakpoint_addr
; /* Address where end bkpt is set */
483 /* Read the debugger structure from the inferior to retrieve the
484 address of the breakpoint and the original contents of the
485 breakpoint address. Remove the breakpoint by writing the original
488 read_memory (debug_addr
, (char *) &debug_copy
, sizeof (debug_copy
));
490 /* Set `in_debugger' to zero now. */
492 write_memory (flag_addr
, (char *) &in_debugger
, sizeof (in_debugger
));
494 breakpoint_addr
= SOLIB_EXTRACT_ADDRESS (debug_copy
.ldd_bp_addr
);
495 write_memory (breakpoint_addr
, (char *) &debug_copy
.ldd_bp_inst
,
496 sizeof (debug_copy
.ldd_bp_inst
));
498 /* For the SVR4 version, we always know the breakpoint address. For the
499 SunOS version we don't know it until the above code is executed.
500 Grumble if we are stopped anywhere besides the breakpoint address. */
502 if (stop_pc
!= breakpoint_addr
)
504 warning ("stopped at unknown breakpoint while handling shared libraries");
515 enable_break -- arrange for dynamic linker to hit breakpoint
519 int enable_break (void)
523 Both the SunOS and the SVR4 dynamic linkers have, as part of their
524 debugger interface, support for arranging for the inferior to hit
525 a breakpoint after mapping in the shared libraries. This function
526 enables that breakpoint.
528 For SunOS, there is a special flag location (in_debugger) which we
529 set to 1. When the dynamic linker sees this flag set, it will set
530 a breakpoint at a location known only to itself, after saving the
531 original contents of that place and the breakpoint address itself,
532 in it's own internal structures. When we resume the inferior, it
533 will eventually take a SIGTRAP when it runs into the breakpoint.
534 We handle this (in a different place) by restoring the contents of
535 the breakpointed location (which is only known after it stops),
536 chasing around to locate the shared libraries that have been
537 loaded, then resuming.
539 For SVR4, the debugger interface structure contains a member (r_brk)
540 which is statically initialized at the time the shared library is
541 built, to the offset of a function (_r_debug_state) which is guaran-
542 teed to be called once before mapping in a library, and again when
543 the mapping is complete. At the time we are examining this member,
544 it contains only the unrelocated offset of the function, so we have
545 to do our own relocation. Later, when the dynamic linker actually
546 runs, it relocates r_brk to be the actual address of _r_debug_state().
548 The debugger interface structure also contains an enumeration which
549 is set to either RT_ADD or RT_DELETE prior to changing the mapping,
550 depending upon whether or not the library is being mapped or unmapped,
551 and then set to RT_CONSISTENT after the library is mapped/unmapped.
561 /* Get link_dynamic structure */
563 j
= target_read_memory (debug_base
, (char *) &dynamic_copy
,
564 sizeof (dynamic_copy
));
571 /* Calc address of debugger interface structure */
573 debug_addr
= SOLIB_EXTRACT_ADDRESS (dynamic_copy
.ldd
);
575 /* Calc address of `in_debugger' member of debugger interface structure */
577 flag_addr
= debug_addr
+ (CORE_ADDR
) ((char *) &debug_copy
.ldd_in_debugger
-
578 (char *) &debug_copy
);
580 /* Write a value of 1 to this member. */
583 write_memory (flag_addr
, (char *) &in_debugger
, sizeof (in_debugger
));
593 special_symbol_handling -- additional shared library symbol handling
597 void special_symbol_handling ()
601 Once the symbols from a shared object have been loaded in the usual
602 way, we are called to do any system specific symbol handling that
605 For SunOS4, this consists of grunging around in the dynamic
606 linkers structures to find symbol definitions for "common" symbols
607 and adding them to the minimal symbol table for the runtime common
613 sunos_special_symbol_handling (void)
619 /* Get link_dynamic structure */
621 j
= target_read_memory (debug_base
, (char *) &dynamic_copy
,
622 sizeof (dynamic_copy
));
629 /* Calc address of debugger interface structure */
630 /* FIXME, this needs work for cross-debugging of core files
631 (byteorder, size, alignment, etc). */
633 debug_addr
= SOLIB_EXTRACT_ADDRESS (dynamic_copy
.ldd
);
636 /* Read the debugger structure from the inferior, just to make sure
637 we have a current copy. */
639 j
= target_read_memory (debug_addr
, (char *) &debug_copy
,
640 sizeof (debug_copy
));
642 return; /* unreadable */
644 /* Get common symbol definitions for the loaded object. */
646 if (debug_copy
.ldd_cp
)
648 solib_add_common_symbols (SOLIB_EXTRACT_ADDRESS (debug_copy
.ldd_cp
));
652 /* Relocate the main executable. This function should be called upon
653 stopping the inferior process at the entry point to the program.
654 The entry point from BFD is compared to the PC and if they are
655 different, the main executable is relocated by the proper amount.
657 As written it will only attempt to relocate executables which
658 lack interpreter sections. It seems likely that only dynamic
659 linker executables will get relocated, though it should work
660 properly for a position-independent static executable as well. */
663 sunos_relocate_main_executable (void)
665 asection
*interp_sect
;
666 CORE_ADDR pc
= read_pc ();
668 /* Decide if the objfile needs to be relocated. As indicated above,
669 we will only be here when execution is stopped at the beginning
670 of the program. Relocation is necessary if the address at which
671 we are presently stopped differs from the start address stored in
672 the executable AND there's no interpreter section. The condition
673 regarding the interpreter section is very important because if
674 there *is* an interpreter section, execution will begin there
675 instead. When there is an interpreter section, the start address
676 is (presumably) used by the interpreter at some point to start
677 execution of the program.
679 If there is an interpreter, it is normal for it to be set to an
680 arbitrary address at the outset. The job of finding it is
681 handled in enable_break().
683 So, to summarize, relocations are necessary when there is no
684 interpreter section and the start address obtained from the
685 executable is different from the address at which GDB is
688 [ The astute reader will note that we also test to make sure that
689 the executable in question has the DYNAMIC flag set. It is my
690 opinion that this test is unnecessary (undesirable even). It
691 was added to avoid inadvertent relocation of an executable
692 whose e_type member in the ELF header is not ET_DYN. There may
693 be a time in the future when it is desirable to do relocations
694 on other types of files as well in which case this condition
695 should either be removed or modified to accomodate the new file
696 type. (E.g, an ET_EXEC executable which has been built to be
697 position-independent could safely be relocated by the OS if
698 desired. It is true that this violates the ABI, but the ABI
699 has been known to be bent from time to time.) - Kevin, Nov 2000. ]
702 interp_sect
= bfd_get_section_by_name (exec_bfd
, ".interp");
703 if (interp_sect
== NULL
704 && (bfd_get_file_flags (exec_bfd
) & DYNAMIC
) != 0
705 && bfd_get_start_address (exec_bfd
) != pc
)
707 struct cleanup
*old_chain
;
708 struct section_offsets
*new_offsets
;
710 CORE_ADDR displacement
;
712 /* It is necessary to relocate the objfile. The amount to
713 relocate by is simply the address at which we are stopped
714 minus the starting address from the executable.
716 We relocate all of the sections by the same amount. This
717 behavior is mandated by recent editions of the System V ABI.
718 According to the System V Application Binary Interface,
719 Edition 4.1, page 5-5:
721 ... Though the system chooses virtual addresses for
722 individual processes, it maintains the segments' relative
723 positions. Because position-independent code uses relative
724 addressesing between segments, the difference between
725 virtual addresses in memory must match the difference
726 between virtual addresses in the file. The difference
727 between the virtual address of any segment in memory and
728 the corresponding virtual address in the file is thus a
729 single constant value for any one executable or shared
730 object in a given process. This difference is the base
731 address. One use of the base address is to relocate the
732 memory image of the program during dynamic linking.
734 The same language also appears in Edition 4.0 of the System V
735 ABI and is left unspecified in some of the earlier editions. */
737 displacement
= pc
- bfd_get_start_address (exec_bfd
);
740 new_offsets
= xcalloc (symfile_objfile
->num_sections
,
741 sizeof (struct section_offsets
));
742 old_chain
= make_cleanup (xfree
, new_offsets
);
744 for (i
= 0; i
< symfile_objfile
->num_sections
; i
++)
746 if (displacement
!= ANOFFSET (symfile_objfile
->section_offsets
, i
))
748 new_offsets
->offsets
[i
] = displacement
;
752 objfile_relocate (symfile_objfile
, new_offsets
);
754 do_cleanups (old_chain
);
762 sunos_solib_create_inferior_hook -- shared library startup support
766 void sunos_solib_create_inferior_hook()
770 When gdb starts up the inferior, it nurses it along (through the
771 shell) until it is ready to execute it's first instruction. At this
772 point, this function gets called via expansion of the macro
773 SOLIB_CREATE_INFERIOR_HOOK.
775 For SunOS executables, this first instruction is typically the
776 one at "_start", or a similar text label, regardless of whether
777 the executable is statically or dynamically linked. The runtime
778 startup code takes care of dynamically linking in any shared
779 libraries, once gdb allows the inferior to continue.
781 For SVR4 executables, this first instruction is either the first
782 instruction in the dynamic linker (for dynamically linked
783 executables) or the instruction at "start" for statically linked
784 executables. For dynamically linked executables, the system
785 first exec's /lib/libc.so.N, which contains the dynamic linker,
786 and starts it running. The dynamic linker maps in any needed
787 shared libraries, maps in the actual user executable, and then
788 jumps to "start" in the user executable.
790 For both SunOS shared libraries, and SVR4 shared libraries, we
791 can arrange to cooperate with the dynamic linker to discover the
792 names of shared libraries that are dynamically linked, and the
793 base addresses to which they are linked.
795 This function is responsible for discovering those names and
796 addresses, and saving sufficient information about them to allow
797 their symbols to be read at a later time.
801 Between enable_break() and disable_break(), this code does not
802 properly handle hitting breakpoints which the user might have
803 set in the startup code or in the dynamic linker itself. Proper
804 handling will probably have to wait until the implementation is
805 changed to use the "breakpoint handler function" method.
807 Also, what if child has exit()ed? Must exit loop somehow.
811 sunos_solib_create_inferior_hook (void)
813 /* Relocate the main executable if necessary. */
814 sunos_relocate_main_executable ();
816 if ((debug_base
= locate_base ()) == 0)
818 /* Can't find the symbol or the executable is statically linked. */
822 if (!enable_break ())
824 warning ("shared library handler failed to enable breakpoint");
828 /* SCO and SunOS need the loop below, other systems should be using the
829 special shared library breakpoints and the shared library breakpoint
832 Now run the target. It will eventually hit the breakpoint, at
833 which point all of the libraries will have been mapped in and we
834 can go groveling around in the dynamic linker structures to find
835 out what we need to know about them. */
837 clear_proceed_status ();
838 stop_soon
= STOP_QUIETLY
;
839 stop_signal
= TARGET_SIGNAL_0
;
842 target_resume (pid_to_ptid (-1), 0, stop_signal
);
843 wait_for_inferior ();
845 while (stop_signal
!= TARGET_SIGNAL_TRAP
);
846 stop_soon
= NO_STOP_QUIETLY
;
848 /* We are now either at the "mapping complete" breakpoint (or somewhere
849 else, a condition we aren't prepared to deal with anyway), so adjust
850 the PC as necessary after a breakpoint, disable the breakpoint, and
851 add any shared libraries that were mapped in. */
853 if (DECR_PC_AFTER_BREAK
)
855 stop_pc
-= DECR_PC_AFTER_BREAK
;
856 write_register (PC_REGNUM
, stop_pc
);
859 if (!disable_break ())
861 warning ("shared library handler failed to disable breakpoint");
864 solib_add ((char *) 0, 0, (struct target_ops
*) 0, auto_solib_add
);
868 sunos_clear_solib (void)
874 sunos_free_so (struct so_list
*so
)
876 xfree (so
->lm_info
->lm
);
881 sunos_relocate_section_addresses (struct so_list
*so
,
882 struct section_table
*sec
)
884 sec
->addr
+= LM_ADDR (so
);
885 sec
->endaddr
+= LM_ADDR (so
);
888 static struct target_so_ops sunos_so_ops
;
891 _initialize_sunos_solib (void)
893 sunos_so_ops
.relocate_section_addresses
= sunos_relocate_section_addresses
;
894 sunos_so_ops
.free_so
= sunos_free_so
;
895 sunos_so_ops
.clear_solib
= sunos_clear_solib
;
896 sunos_so_ops
.solib_create_inferior_hook
= sunos_solib_create_inferior_hook
;
897 sunos_so_ops
.special_symbol_handling
= sunos_special_symbol_handling
;
898 sunos_so_ops
.current_sos
= sunos_current_sos
;
899 sunos_so_ops
.open_symbol_file_object
= open_symbol_file_object
;
900 sunos_so_ops
.in_dynsym_resolve_code
= sunos_in_dynsym_resolve_code
;
902 /* FIXME: Don't do this here. *_gdbarch_init() should set so_ops. */
903 current_target_so_ops
= &sunos_so_ops
;