[ppc64le] Use skip_entrypoint for skip_trampoline_code
[deliverable/binutils-gdb.git] / gdb / solib.c
index ed1bc253ecb80236e62a96b8c5bcf775d8ce630c..c46116d4fbcdb162c187fdfa07b3fbc2ef2cf9ee 100644 (file)
@@ -158,6 +158,7 @@ solib_find_1 (char *in_pathname, int *fd, int is_solib)
   const char *fskind = effective_target_file_system_kind ();
   struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
   char *sysroot = gdb_sysroot;
+  int prefix_len, orig_prefix_len;
 
   /* If the absolute prefix starts with "target:" but the filesystem
      accessed by the target_fileio_* methods is the local filesystem
@@ -168,17 +169,16 @@ solib_find_1 (char *in_pathname, int *fd, int is_solib)
   if (is_target_filename (sysroot) && target_filesystem_is_local ())
     sysroot += strlen (TARGET_SYSROOT_PREFIX);
 
-  if (*sysroot == '\0')
-    sysroot = NULL;
-  else
-    {
-      int prefix_len = strlen (sysroot);
+  /* Strip any trailing slashes from the absolute prefix.  */
+  prefix_len = orig_prefix_len = strlen (sysroot);
 
-      /* Remove trailing slashes from absolute prefix.  */
-      while (prefix_len > 0
-            && IS_DIR_SEPARATOR (sysroot[prefix_len - 1]))
-       prefix_len--;
+  while (prefix_len > 0 && IS_DIR_SEPARATOR (sysroot[prefix_len - 1]))
+    prefix_len--;
 
+  if (prefix_len == 0)
+    sysroot = NULL;
+  else if (prefix_len != orig_prefix_len)
+    {
       sysroot = savestring (sysroot, prefix_len);
       make_cleanup (xfree, sysroot);
     }
@@ -1511,16 +1511,16 @@ show_auto_solib_add (struct ui_file *file, int from_tty,
 /* Handler for library-specific lookup of global symbol NAME in OBJFILE.  Call
    the library-specific handler if it is installed for the current target.  */
 
-struct symbol *
+struct block_symbol
 solib_global_lookup (struct objfile *objfile,
                     const char *name,
                     const domain_enum domain)
 {
-  const struct target_so_ops *ops = solib_ops (get_objfile_arch (objfile));
+  const struct target_so_ops *ops = solib_ops (target_gdbarch ());
 
   if (ops->lookup_lib_global_symbol != NULL)
     return ops->lookup_lib_global_symbol (objfile, name, domain);
-  return NULL;
+  return (struct block_symbol) {NULL, NULL};
 }
 
 /* Lookup the value for a specific symbol from dynamic symbol table.  Look
This page took 0.024231 seconds and 4 git commands to generate.