-/* If non-zero, this is a prefix that will be added to the front of the name
- shared libraries with an absolute filename for loading. */
-static char *solib_absolute_prefix = NULL;
-
-/* If non-empty, this is a search path for loading non-absolute shared library
- symbol files. This takes precedence over the environment variables PATH
- and LD_LIBRARY_PATH. */
-static char *solib_search_path = NULL;
-
-
-#ifndef SVR4_SHARED_LIBS
-
-/* Allocate the runtime common object file. */
-
-static void
-allocate_rt_common_objfile (void)
-{
- struct objfile *objfile;
- struct objfile *last_one;
-
- objfile = (struct objfile *) xmalloc (sizeof (struct objfile));
- memset (objfile, 0, sizeof (struct objfile));
- objfile->md = NULL;
- obstack_specify_allocation (&objfile->psymbol_cache.cache, 0, 0,
- xmalloc, free);
- obstack_specify_allocation (&objfile->psymbol_obstack, 0, 0, xmalloc,
- free);
- obstack_specify_allocation (&objfile->symbol_obstack, 0, 0, xmalloc,
- free);
- obstack_specify_allocation (&objfile->type_obstack, 0, 0, xmalloc,
- free);
- objfile->name = mstrsave (objfile->md, "rt_common");
-
- /* Add this file onto the tail of the linked list of other such files. */
-
- objfile->next = NULL;
- if (object_files == NULL)
- object_files = objfile;
- else
- {
- for (last_one = object_files;
- last_one->next;
- last_one = last_one->next);
- last_one->next = objfile;
- }
-
- rt_common_objfile = objfile;
-}
-
-/* Read all dynamically loaded common symbol definitions from the inferior
- and put them into the minimal symbol table for the runtime common
- objfile. */
-
-static void
-solib_add_common_symbols (CORE_ADDR rtc_symp)
-{
- struct rtc_symb inferior_rtc_symb;
- struct nlist inferior_rtc_nlist;
- int len;
- char *name;
-
- /* Remove any runtime common symbols from previous runs. */
-
- if (rt_common_objfile != NULL && rt_common_objfile->minimal_symbol_count)
- {
- obstack_free (&rt_common_objfile->symbol_obstack, 0);
- obstack_specify_allocation (&rt_common_objfile->symbol_obstack, 0, 0,
- xmalloc, free);
- rt_common_objfile->minimal_symbol_count = 0;
- rt_common_objfile->msymbols = NULL;
- }
-
- init_minimal_symbol_collection ();
- make_cleanup_discard_minimal_symbols ();
-
- while (rtc_symp)
- {
- read_memory (rtc_symp,
- (char *) &inferior_rtc_symb,
- sizeof (inferior_rtc_symb));
- read_memory (SOLIB_EXTRACT_ADDRESS (inferior_rtc_symb.rtc_sp),
- (char *) &inferior_rtc_nlist,
- sizeof (inferior_rtc_nlist));
- if (inferior_rtc_nlist.n_type == N_COMM)
- {
- /* FIXME: The length of the symbol name is not available, but in the
- current implementation the common symbol is allocated immediately
- behind the name of the symbol. */
- len = inferior_rtc_nlist.n_value - inferior_rtc_nlist.n_un.n_strx;
-
- name = xmalloc (len);
- read_memory (SOLIB_EXTRACT_ADDRESS (inferior_rtc_nlist.n_un.n_name),
- name, len);
-
- /* Allocate the runtime common objfile if necessary. */
- if (rt_common_objfile == NULL)
- allocate_rt_common_objfile ();
-
- prim_record_minimal_symbol (name, inferior_rtc_nlist.n_value,
- mst_bss, rt_common_objfile);
- free (name);
- }
- rtc_symp = SOLIB_EXTRACT_ADDRESS (inferior_rtc_symb.rtc_next);
- }
-
- /* Install any minimal symbols that have been collected as the current
- minimal symbols for the runtime common objfile. */
-
- install_minimal_symbols (rt_common_objfile);
-}
-
-#endif /* SVR4_SHARED_LIBS */
-
-
-#ifdef SVR4_SHARED_LIBS
-