_dl_debug_message ("\n", NULL);
_dl_debug_message (1, "\n", NULL);
_dl_map_object (struct link_map *loader, const char *name, int preloaded,		int type, int trace_mode){  int fd;  char *realname;  char *name_copy;  struct link_map *l;  /* Look for this name among those already loaded.  */  for (l = _dl_loaded; l; l = l->l_next)    {      /* If the requested name matches the soname of a loaded object,	 use that object.  Elide this check for names that have not	 yet been opened.  */      if (l->l_opencount <= 0)	continue;      if (!_dl_name_match_p (name, l))	{	  const char *soname;	  if (l->l_info[DT_SONAME] == NULL)	    continue;	  soname = (const char *) (l->l_addr				   + l->l_info[DT_STRTAB]->d_un.d_ptr				   + l->l_info[DT_SONAME]->d_un.d_val);	  if (strcmp (name, soname) != 0)	    continue;	  /* We have a match on a new name -- cache it.  */	  add_name_to_object (l, local_strdup (soname));	}      /* We have a match -- bump the reference count and return it.  */      ++l->l_opencount;      return l;    }  if (strchr (name, '/') == NULL)    {      /* Search for NAME in several places.  */      size_t namelen = strlen (name) + 1;      if (_dl_debug_libs)	_dl_debug_message ("\tfind library=", name, "; searching\n", NULL);      fd = -1;      /* First try the DT_RPATH of the dependent object that caused NAME	 to be loaded.  Then that object's dependent, and on up.  */      for (l = loader; fd == -1 && l; l = l->l_loader)	if (l && l->l_info[DT_RPATH])	  {	    /* Make sure the cache information is available.  */	    if (l->l_rpath_dirs == NULL)	      {		size_t ptrval = (l->l_addr				 + l->l_info[DT_STRTAB]->d_un.d_ptr				 + l->l_info[DT_RPATH]->d_un.d_val);		l->l_rpath_dirs =		  decompose_rpath ((const char *) ptrval, 0,				   "RPATH", l->l_name);	      }	    if (l->l_rpath_dirs != (struct r_search_path_elem **) -1l)	      fd = open_path (name, namelen, preloaded, l->l_rpath_dirs,			      &realname);	  }      /* If dynamically linked, try the DT_RPATH of the executable itself	 and the LD_LIBRARY_PATH environment variable.  */      l = _dl_loaded;      if (fd == -1 && l && l->l_type != lt_loaded	  && l->l_rpath_dirs != (struct r_search_path_elem **) -1l)	fd = open_path (name, namelen, preloaded, l->l_rpath_dirs, &realname);      /* This is used if a static binary uses dynamic loading and there	 is a LD_LIBRARY_PATH given.  */      if (fd == -1 && fake_path_list != NULL)	fd = open_path (name, namelen, preloaded, fake_path_list, &realname);      if (fd == -1)	{	  /* Check the list of libraries in the file /etc/ld.so.cache,	     for compatibility with Linux's ldconfig program.  */	  extern const char *_dl_load_cache_lookup (const char *name);	  const char *cached = _dl_load_cache_lookup (name);	  if (cached)	    {	      fd = __open (cached, O_RDONLY);	      if (fd != -1)		{		  realname = local_strdup (cached);		  if (realname == NULL)		    {		      __close (fd);		      fd = -1;		    }		}	    }	}      /* Finally, try the default path.  */      if (fd == -1)	fd = open_path (name, namelen, preloaded, rtld_search_dirs, &realname);      /* Add another newline when we a tracing the library loading.  */      if (_dl_debug_libs)        _dl_debug_message ("\n", NULL);    }  else    {      fd = __open (name, O_RDONLY);      if (fd != -1)	{	  realname = local_strdup (name);	  if (realname == NULL)	    {	      __close (fd);	      fd = -1;	    }	}    }  if (fd != -1)    {      name_copy = local_strdup (name);      if (name_copy == NULL)	{	  __close (fd);	  fd = -1;	}    }  if (fd == -1)    {      if (trace_mode)	{	  /* We haven't found an appropriate library.  But since we	     are only interested in the list of libraries this isn't	     so severe.  Fake an entry with all the information we	     have.  */	  static const ElfW(Symndx) dummy_bucket = STN_UNDEF;	  /* Enter the new object in the list of loaded objects.  */	  if ((name_copy = local_strdup (name)) == NULL	      || (l = _dl_new_object (name_copy, name, type)) == NULL)	    _dl_signal_error (ENOMEM, name,			      "cannot create shared object descriptor");	  /* We use an opencount of 0 as a sign for the faked entry.  */	  l->l_opencount = 0;	  l->l_reserved = 0;	  l->l_buckets = &dummy_bucket;	  l->l_nbuckets = 1;	  l->l_relocated = 1;	  return l;	}      else	_dl_signal_error (errno, name, "cannot open shared object file");    }  return _dl_map_object_from_fd (name_copy, fd, realname, loader, type);}