]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Start at parisc backend. roland/parisc
authorRoland McGrath <roland@redhat.com>
Mon, 6 Jul 2009 23:41:02 +0000 (16:41 -0700)
committerRoland McGrath <roland@redhat.com>
Tue, 7 Jul 2009 01:04:52 +0000 (18:04 -0700)
backends/ChangeLog
backends/Makefile.am
backends/alpha_corenote.c
backends/parisc_corenote.c [new file with mode: 0644]
backends/parisc_init.c [new file with mode: 0644]

index a1aa351fc039a45793c17a7ad7e47fc7f8ba4c17..51131f5ba23bc80eaf3a277417a1541015257659 100644 (file)
@@ -1,3 +1,12 @@
+2009-07-06  Roland McGrath  <roland@redhat.com>
+
+       * parisc_init.c: New file.
+       * parisc_corenote.c: New file.
+       * parisc64_corenote.c: New file.
+       * Makefile.am (libebl_pic): Add parisc backend.
+       (parisc_SRCS): New variable.
+       (libebl_parisc_pic_a_SOURCES, am_libebl_parisc_pic_a_OBJECTS): Likewise.
+
 2009-06-01  Ulrich Drepper  <drepper@redhat.com>
 
        * i386_reloc.def: Add IRELATIVE entry.
index 6d7eb667c8aee4fc8d9ac6fcf056942f0fc025d5..cf851ffd163334c8d8dda09bf6b6e84f13c54f9e 100644 (file)
@@ -41,7 +41,7 @@ modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390
 libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \
             libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \
             libebl_sparc_pic.a libebl_ppc_pic.a libebl_ppc64_pic.a \
-            libebl_s390_pic.a
+            libebl_s390_pic.a libebl_parisc_pic.a
 noinst_LIBRARIES = $(libebl_pic)
 noinst_DATA = $(libebl_pic:_pic.a=.so)
 
@@ -109,6 +109,10 @@ s390_SRCS = s390_init.c s390_symbol.c s390_regs.c s390_retval.c
 libebl_s390_pic_a_SOURCES = $(s390_SRCS)
 am_libebl_s390_pic_a_OBJECTS = $(s390_SRCS:.c=.os)
 
+parisc_SRCS = parisc_init.c parisc_corenote.c parisc64_corenote.c
+libebl_parisc_pic_a_SOURCES = $(parisc_SRCS)
+am_libebl_parisc_pic_a_OBJECTS = $(parisc_SRCS:.c=.os)
+
 
 libebl_%.so: libebl_%_pic.a libebl_%.map $(libelf) $(libdw) \
             $(cpu_$(@:libebl_%.so=%)
index dcc62e9e70be6295f25742dc8175258ac0b27db3..5a86ae4906f4ee13859698fd7a855133d984f5d9 100644 (file)
@@ -1,4 +1,4 @@
-/* PowerPC specific core note handling.
+/* Alpha specific core note handling.
    Copyright (C) 2007 Red Hat, Inc.
    This file is part of Red Hat elfutils.
 
diff --git a/backends/parisc_corenote.c b/backends/parisc_corenote.c
new file mode 100644 (file)
index 0000000..c18e7b7
--- /dev/null
@@ -0,0 +1,96 @@
+/* HPPA specific core note handling.
+   Copyright (C) 2009 Red Hat, Inc.
+   This file is part of Red Hat elfutils.
+
+   Red Hat elfutils is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by the
+   Free Software Foundation; version 2 of the License.
+
+   Red Hat elfutils is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with Red Hat elfutils; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+   Red Hat elfutils is an included package of the Open Invention Network.
+   An included package of the Open Invention Network is a package for which
+   Open Invention Network licensees cross-license their patents.  No patent
+   license is granted, either expressly or impliedly, by designation as an
+   included package.  Should you wish to participate in the Open Invention
+   Network licensing program, please visit www.openinventionnetwork.com
+   <http://www.openinventionnetwork.com>.  */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <elf.h>
+#include <inttypes.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <sys/time.h>
+
+#ifndef BITS
+# define BITS          32
+# define BACKEND       parisc_
+#else
+# define BITS          64
+# define BACKEND       parisc64_
+#endif
+#include "libebl_CPU.h"
+
+static const Ebl_Register_Location prstatus_regs[] =
+  {
+    { .offset = 0, .regno = 0, .count = 32, .bits = BITS },    /* r0-r31 */
+    { .offset = 32 * 4, .regno = 33, .count = 8, .bits = BITS },/* sr0-sr7 */
+    { .offset = 40 * 4, .regno = 50, .count = 2, .bits = BITS },/* iaoq[01] */
+    { .offset = 42 * 4, .regno = 60, .count = 2, .bits = BITS },/* iasq[01] */
+    { .offset = 44 * 4, .regno = 32, .count = 1, .bits = BITS },/* sar */
+    { .offset = 45 * 4, .regno = 119, .count = 4, .bits = BITS },/* cr19-cr22 */
+    { .offset = 49 * 4, .regno = 100, .count = 4, .bits = BITS },/* cr0 */
+    { .offset = 50 * 4, .regno = 124, .count = 8, .bits = BITS },/* cr24-cr31 */
+    { .offset = 58 * 4, .regno = 108, .count = 2, .bits = BITS },/* cr8-cr9 */
+    { .offset = 60 * 4, .regno = 112, .count = 2, .bits = BITS },/* cr12-cr13 */
+    { .offset = 62 * 4, .regno = 110, .count = 1, .bits = BITS },/* cr10 */
+    { .offset = 63 * 4, .regno = 115, .count = 1, .bits = BITS },/* cr15 */
+  };
+#define PRSTATUS_REGS_SIZE     (64 * 4)
+
+static const Ebl_Register_Location fpregset_regs[] =
+  {
+    { .offset = 0, .regno = 64, .count = 32, .bits = 64 }, /* fr0-fr31 */
+  };
+#define FPREGSET_SIZE          (32 * 8)
+
+#if BITS == 32
+# define ULONG                 uint32_t
+# define ALIGN_ULONG           4
+# define TYPE_ULONG            ELF_T_WORD
+# define TYPE_LONG             ELF_T_SWORD
+# define UID_T                 uint32_t
+# define GID_T                 uint32_t
+# define ALIGN_UID_T           2
+# define ALIGN_GID_T           2
+# define TYPE_UID_T            ELF_T_HALF
+# define TYPE_GID_T            ELF_T_HALF
+#else
+# define ULONG                 uint64_t
+# define ALIGN_ULONG           8
+# define TYPE_ULONG            ELF_T_XWORD
+# define TYPE_LONG             ELF_T_SXWORD
+# define UID_T                 uint32_t
+# define GID_T                 uint32_t
+# define ALIGN_UID_T           4
+# define ALIGN_GID_T           4
+# define TYPE_UID_T            ELF_T_WORD
+# define TYPE_GID_T            ELF_T_WORD
+# define SUSECONDS_HALF                1
+#endif
+#define PID_T                  int32_t
+#define ALIGN_PID_T            4
+#define TYPE_PID_T             ELF_T_SWORD
+
+#include "linux-core-note.c"
diff --git a/backends/parisc_init.c b/backends/parisc_init.c
new file mode 100644 (file)
index 0000000..7a41f7b
--- /dev/null
@@ -0,0 +1,66 @@
+/* Initialization of HPPA specific backend library.
+   Copyright (C) 2009 Red Hat, Inc.
+   This file is part of Red Hat elfutils.
+
+   Red Hat elfutils is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by the
+   Free Software Foundation; version 2 of the License.
+
+   Red Hat elfutils is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with Red Hat elfutils; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+   Red Hat elfutils is an included package of the Open Invention Network.
+   An included package of the Open Invention Network is a package for which
+   Open Invention Network licensees cross-license their patents.  No patent
+   license is granted, either expressly or impliedly, by designation as an
+   included package.  Should you wish to participate in the Open Invention
+   Network licensing program, please visit www.openinventionnetwork.com
+   <http://www.openinventionnetwork.com>.  */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#define BACKEND                parisc_
+#define RELOC_PREFIX   R_PARISC_
+#include "libebl_CPU.h"
+
+/* This defines the common reloc hooks based on parisc_reloc.def.  */
+//#include "common-reloc.c"
+
+extern __typeof (EBLHOOK (core_note)) parisc64_core_note attribute_hidden;
+
+const char *
+parisc_init (elf, machine, eh, ehlen)
+     Elf *elf __attribute__ ((unused));
+     GElf_Half machine __attribute__ ((unused));
+     Ebl *eh;
+     size_t ehlen;
+{
+  /* Check whether the Elf_BH object has a sufficent size.  */
+  if (ehlen < sizeof (Ebl))
+    return NULL;
+
+  /* We handle it.  */
+  eh->name = "HPPA";
+  //  hppa_init_reloc (eh);
+  //  HOOK (eh, reloc_simple_type);
+  //  HOOK (eh, gotpc_reloc_check);
+  if (eh->class == ELFCLASS64)
+    eh->core_note = parisc64_core_note;
+  else
+    HOOK (eh, core_note);
+  //  HOOK (eh, return_value_location);
+  //  HOOK (eh, register_info);
+  //  HOOK (eh, syscall_abi);
+  //  HOOK (eh, auxv_info);
+  //  HOOK (eh, disasm);
+
+  return MODVERSION;
+}