PR 17819: Fix --build-id=tree when using --compress-debug-sections.
[deliverable/binutils-gdb.git] / gdb / nto-tdep.c
index dff87bbf96183b074d19057d30d69ef9e26e78f4..ba3c845c3c8c14119d31fb9c43e0bc7431205fbf 100644 (file)
@@ -1,6 +1,6 @@
 /* nto-tdep.c - general QNX Neutrino target functionality.
 
-   Copyright (C) 2003-2004, 2007-2012 Free Software Foundation, Inc.
+   Copyright (C) 2003-2015 Free Software Foundation, Inc.
 
    Contributed by QNX Software Systems Ltd.
 
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_stat.h"
-#include "gdb_string.h"
+#include <sys/stat.h>
 #include "nto-tdep.h"
 #include "top.h"
 #include "inferior.h"
+#include "infrun.h"
 #include "gdbarch.h"
 #include "bfd.h"
 #include "elf-bfd.h"
@@ -32,8 +32,6 @@
 #include "gdbcore.h"
 #include "objfiles.h"
 
-#include <string.h>
-
 #ifdef __CYGWIN__
 #include <sys/cygwin.h>
 #endif
@@ -86,7 +84,8 @@ nto_map_arch_to_cputype (const char *arch)
 int
 nto_find_and_open_solib (char *solib, unsigned o_flags, char **temp_pathname)
 {
-  char *buf, *arch_path, *nto_root, *endian;
+  char *buf, *arch_path, *nto_root;
+  const char *endian;
   const char *base;
   const char *arch;
   int arch_len, len, ret;
@@ -128,7 +127,8 @@ nto_find_and_open_solib (char *solib, unsigned o_flags, char **temp_pathname)
             arch_path);
 
   base = lbasename (solib);
-  ret = openp (buf, 1, base, o_flags, temp_pathname);
+  ret = openp (buf, OPF_TRY_CWD_FIRST | OPF_RETURN_REALPATH, base, o_flags,
+              temp_pathname);
   if (ret < 0 && base != solib)
     {
       xsnprintf (arch_path, arch_len, "/%s", solib);
@@ -138,7 +138,7 @@ nto_find_and_open_solib (char *solib, unsigned o_flags, char **temp_pathname)
          if (ret >= 0)
            *temp_pathname = gdb_realpath (arch_path);
          else
-           **temp_pathname = '\0';
+           *temp_pathname = NULL;
        }
     }
   return ret;
@@ -148,7 +148,8 @@ void
 nto_init_solib_absolute_prefix (void)
 {
   char buf[PATH_MAX * 2], arch_path[PATH_MAX];
-  char *nto_root, *endian;
+  char *nto_root;
+  const char *endian;
   const char *arch;
 
   nto_root = nto_target ();
@@ -306,7 +307,7 @@ nto_relocate_section_addresses (struct so_list *so, struct target_section *sec)
   /* Neutrino treats the l_addr base address field in link.h as different than
      the base address in the System V ABI and so the offset needs to be
      calculated and applied to relocations.  */
-  Elf_Internal_Phdr *phdr = find_load_phdr (sec->bfd);
+  Elf_Internal_Phdr *phdr = find_load_phdr (sec->the_bfd_section->owner);
   unsigned vaddr = phdr ? phdr->p_vaddr : 0;
 
   sec->addr = nto_truncate_ptr (sec->addr + lm_addr (so) - vaddr);
@@ -318,7 +319,7 @@ nto_relocate_section_addresses (struct so_list *so, struct target_section *sec)
 int
 nto_in_dynsym_resolve_code (CORE_ADDR pc)
 {
-  if (in_plt_section (pc, NULL))
+  if (in_plt_section (pc))
     return 1;
   return 0;
 }
@@ -363,11 +364,11 @@ static const char *nto_thread_state_str[] =
 };
 
 char *
-nto_extra_thread_info (struct thread_info *ti)
+nto_extra_thread_info (struct target_ops *self, struct thread_info *ti)
 {
-  if (ti && ti->private
-      && ti->private->state < ARRAY_SIZE (nto_thread_state_str))
-    return (char *)nto_thread_state_str [ti->private->state];
+  if (ti && ti->priv
+      && ti->priv->state < ARRAY_SIZE (nto_thread_state_str))
+    return (char *)nto_thread_state_str [ti->priv->state];
   return "";
 }
 
This page took 0.02574 seconds and 4 git commands to generate.