]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Add Linux/x86_64 core support to i[3-7]86-*-linux
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 30 Oct 2012 08:36:10 +0000 (08:36 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 30 Oct 2012 08:36:10 +0000 (08:36 +0000)
* configure.in: Set CORE_HEADER to hosts/x86-64linux.h for
'i[3-7]86-*-linux-*' if x86_64-*linux is enabled.
* configure: Regenerated.

* elf64-x86-64.c (elf_x86_64_write_core_note): Replace type
'prpsinfo_t' and 'prstatus_t' with 'prpsinfo64_t' and
'prstatus64_t' respectively.

* hosts/x86-64linux.h (a8_uint64_t): New.
(user_regsx32_struct): Renamed to ...
(user_regs64_struct): This.  Replace uint64_t with a8_uint64_t.
(elf_gregx32_t): Renamed to ...
(elf_greg64_t): This.  Replace uint64_t with a8_uint64_t.
(ELF_NGREGX32): Removed.
(ELF_NGREG64): New.
(elf_gregx32_t): Removed.
(elf_greg64_t): New.
(struct prstatus64_timeval): New.
(elf_prstatusx32): Replace elf_gregsetx32_t with elf_gregset64_t.
(elf_prstatus64): New.
(elf_prpsinfo64): New.
(prstatus64_t, prpsinfo64_t): New typedef.

bfd/ChangeLog
bfd/configure
bfd/configure.in
bfd/elf64-x86-64.c
bfd/hosts/x86-64linux.h

index 202a8dbe9d15ea04747ef8a72a52fa59d0044c70..d846f635fc502a640d131728c373c68ba3c1e0c0 100644 (file)
@@ -1,3 +1,29 @@
+2012-10-30  Yao Qi  <yao@codesourcery.com>
+           H.J. Lu  <hongjiu.lu@intel.com>
+
+       * configure.in: Set CORE_HEADER to hosts/x86-64linux.h for 
+       'i[3-7]86-*-linux-*' if x86_64-*linux is enabled.
+       * configure: Regenerated.
+
+       * elf64-x86-64.c (elf_x86_64_write_core_note): Replace type
+       'prpsinfo_t' and 'prstatus_t' with 'prpsinfo64_t' and
+       'prstatus64_t' respectively.
+
+       * hosts/x86-64linux.h (a8_uint64_t): New.
+       (user_regsx32_struct): Renamed to ...
+       (user_regs64_struct): This.  Replace uint64_t with a8_uint64_t.
+       (elf_gregx32_t): Renamed to ...
+       (elf_greg64_t): This.  Replace uint64_t with a8_uint64_t.
+       (ELF_NGREGX32): Removed.
+       (ELF_NGREG64): New.
+       (elf_gregx32_t): Removed.
+       (elf_greg64_t): New.
+       (struct prstatus64_timeval): New.
+       (elf_prstatusx32): Replace elf_gregsetx32_t with elf_gregset64_t.
+       (elf_prstatus64): New.
+       (elf_prpsinfo64): New.
+       (prstatus64_t, prpsinfo64_t): New typedef.
+
 2012-10-29  Sean Keys <skeys@ipdatasys.com>
 
        * elf32-xgate.c(elf_xgate_howto_table): Fix src and dest mask for
index fdf5356bc000280301da1b82a444d490a328bb96..427e5c10cd5024e3c494682aeb1e50e7f8467618 100755 (executable)
@@ -13927,6 +13927,10 @@ if test "${target}" = "${host}"; then
   i[3-7]86-*-linux-*)
        COREFILE=trad-core.lo
        TRAD_HEADER='"hosts/i386linux.h"'
+       case "$enable_targets" in
+       *x86_64-*linux*)
+         CORE_HEADER='"hosts/x86-64linux.h"'
+       esac
        ;;
   i[3-7]86-*-isc*)     COREFILE=trad-core.lo ;;
   i[3-7]86-*-aix*)     COREFILE=aix386-core.lo ;;
index 530bbcb348d88bccc27482f7810f2784a976a6c1..9a31c04acfd976e5960a95cf9bc06dadcb8c2a57 100644 (file)
@@ -331,6 +331,10 @@ changequote(,)dnl
 changequote([,])dnl
        COREFILE=trad-core.lo
        TRAD_HEADER='"hosts/i386linux.h"'
+       case "$enable_targets" in
+       *x86_64-*linux*)
+         CORE_HEADER='"hosts/x86-64linux.h"'
+       esac
        ;;
 changequote(,)dnl
   i[3-7]86-*-isc*)     COREFILE=trad-core.lo ;;
index ca9a45c764e96b7b1578579c59623774af0bc1e2..d58384ff7e8efb9968c5726da6c327fd1b8344fe 100644 (file)
@@ -449,7 +449,7 @@ elf_x86_64_write_core_note (bfd *abfd, char *buf, int *bufsiz,
        }
       else
        {
-         prpsinfo_t data;
+         prpsinfo64_t data;
          memset (&data, 0, sizeof (data));
          strncpy (data.pr_fname, fname, sizeof (data.pr_fname));
          strncpy (data.pr_psargs, psargs, sizeof (data.pr_psargs));
@@ -490,7 +490,7 @@ elf_x86_64_write_core_note (bfd *abfd, char *buf, int *bufsiz,
        }
       else
        {
-         prstatus_t prstat;
+         prstatus64_t prstat;
          memset (&prstat, 0, sizeof (prstat));
          prstat.pr_pid = pid;
          prstat.pr_cursig = cursig;
index 4ffc3f26ad3f959fd492a28739706fb26e1c7619..78be09afa0c40af74f3485eb1118fbd3504e0438 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006, 2011
+/* Copyright (C) 2006, 2011, 2012
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -40,6 +40,9 @@ typedef unsigned int uint32_t;
 typedef unsigned long long int uint64_t;
 #endif
 
+/* Unsigned 64-bit integer aligned to 8 bytes.  */
+typedef uint64_t __attribute__ ((__aligned__ (8))) a8_uint64_t;
+
 #undef HAVE_PRPSINFO32_T
 #define HAVE_PRPSINFO32_T
 #undef HAVE_PRPSINFO32_T_PR_PID
@@ -71,40 +74,40 @@ struct user_regs32_struct
   int32_t xss;
 };
 
-struct user_regsx32_struct
+struct user_regs64_struct
 {
-  uint64_t r15;
-  uint64_t r14;
-  uint64_t r13;
-  uint64_t r12;
-  uint64_t rbp;
-  uint64_t rbx;
-  uint64_t r11;
-  uint64_t r10;
-  uint64_t r9;
-  uint64_t r8;
-  uint64_t rax;
-  uint64_t rcx;
-  uint64_t rdx;
-  uint64_t rsi;
-  uint64_t rdi;
-  uint64_t orig_rax;
-  uint64_t rip;
-  uint64_t cs;
-  uint64_t eflags;
-  uint64_t rsp;
-  uint64_t ss;
-  uint64_t fs_base;
-  uint64_t gs_base;
-  uint64_t ds;
-  uint64_t es;
-  uint64_t fs;
-  uint64_t gs;
+  a8_uint64_t r15;
+  a8_uint64_t r14;
+  a8_uint64_t r13;
+  a8_uint64_t r12;
+  a8_uint64_t rbp;
+  a8_uint64_t rbx;
+  a8_uint64_t r11;
+  a8_uint64_t r10;
+  a8_uint64_t r9;
+  a8_uint64_t r8;
+  a8_uint64_t rax;
+  a8_uint64_t rcx;
+  a8_uint64_t rdx;
+  a8_uint64_t rsi;
+  a8_uint64_t rdi;
+  a8_uint64_t orig_rax;
+  a8_uint64_t rip;
+  a8_uint64_t cs;
+  a8_uint64_t eflags;
+  a8_uint64_t rsp;
+  a8_uint64_t ss;
+  a8_uint64_t fs_base;
+  a8_uint64_t gs_base;
+  a8_uint64_t ds;
+  a8_uint64_t es;
+  a8_uint64_t fs;
+  a8_uint64_t gs;
 };
 
 /* Type for a general-purpose register.  */
 typedef uint32_t elf_greg32_t;
-typedef uint64_t elf_gregx32_t;
+typedef a8_uint64_t elf_greg64_t;
 
 /* And the whole bunch of them.  We could have used `struct
    user_regs_struct' directly in the typedef, but tradition says that
@@ -112,8 +115,8 @@ typedef uint64_t elf_gregx32_t;
    semantics, so leave it that way.  */
 #define ELF_NGREG32 (sizeof (struct user_regs32_struct) / sizeof(elf_greg32_t))
 typedef elf_greg32_t elf_gregset32_t[ELF_NGREG32];
-#define ELF_NGREGX32 (sizeof (struct user_regsx32_struct) / sizeof(elf_gregx32_t))
-typedef elf_gregx32_t elf_gregsetx32_t[ELF_NGREGX32];
+#define ELF_NGREG64 (sizeof (struct user_regs64_struct) / sizeof(elf_greg64_t))
+typedef elf_greg64_t elf_gregset64_t[ELF_NGREG64];
 
 /* Definitions to generate Intel SVR4-like core files.  These mostly
    have the same names as the SVR4 types with "elf_" tacked on the
@@ -128,6 +131,12 @@ struct prstatus32_timeval
     int tv_usec;
   };
 
+struct prstatus64_timeval
+  {
+    a8_uint64_t tv_sec;
+    a8_uint64_t tv_usec;
+  };
+
 struct elf_prstatus32
   {
     struct elf_siginfo pr_info;                /* Info associated with signal.  */
@@ -160,7 +169,25 @@ struct elf_prstatusx32
     struct prstatus32_timeval pr_stime;                /* System time.  */
     struct prstatus32_timeval pr_cutime;       /* Cumulative user time.  */
     struct prstatus32_timeval pr_cstime;       /* Cumulative system time.  */
-    elf_gregsetx32_t pr_reg;           /* GP registers.  */
+    elf_gregset64_t pr_reg;            /* GP registers.  */
+    int pr_fpvalid;                    /* True if math copro being used.  */
+  };
+
+struct elf_prstatus64
+  {
+    struct elf_siginfo pr_info;        /* Info associated with signal.  */
+    short int pr_cursig;               /* Current signal.  */
+    a8_uint64_t pr_sigpend;            /* Set of pending signals.  */
+    a8_uint64_t pr_sighold;            /* Set of held signals.  */
+    pid_t pr_pid;
+    pid_t pr_ppid;
+    pid_t pr_pgrp;
+    pid_t pr_sid;
+    struct prstatus64_timeval pr_utime;                /* User time.  */
+    struct prstatus64_timeval pr_stime;                /* System time.  */
+    struct prstatus64_timeval pr_cutime;       /* Cumulative user time.  */
+    struct prstatus64_timeval pr_cstime;       /* Cumulative system time.  */
+    elf_gregset64_t pr_reg;            /* GP registers.  */
     int pr_fpvalid;                    /* True if math copro being used.  */
   };
 
@@ -179,6 +206,20 @@ struct elf_prpsinfo32
     char pr_psargs[ELF_PRARGSZ];       /* Initial part of arg list.  */
   };
 
+struct elf_prpsinfo64
+  {
+    char pr_state;                     /* Numeric process state.  */
+    char pr_sname;                     /* Char for pr_state.  */
+    char pr_zomb;                      /* Zombie.  */
+    char pr_nice;                      /* Nice val.  */
+    a8_uint64_t pr_flag;               /* Flags.  */
+    unsigned int pr_uid;
+    unsigned int pr_gid;
+    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
+    /* Lots missing */
+    char pr_fname[16];                 /* Filename of executable.  */
+    char pr_psargs[ELF_PRARGSZ];       /* Initial part of arg list.  */
+  };
 
 /* The rest of this file provides the types for emulation of the
    Solaris <proc_service.h> interfaces that should be implemented by
@@ -187,4 +228,6 @@ struct elf_prpsinfo32
 /* Process status and info.  In the end we do provide typedefs for them.  */
 typedef struct elf_prstatus32 prstatus32_t;
 typedef struct elf_prstatusx32 prstatusx32_t;
+typedef struct elf_prstatus64 prstatus64_t;
 typedef struct elf_prpsinfo32 prpsinfo32_t;
+typedef struct elf_prpsinfo64 prpsinfo64_t;