]> git.pld-linux.org Git - packages/elfutils.git/blob - elfutils-alpha.patch
- http://lists.pld-linux.org/mailman/pipermail/pld-devel-pl/2007-June/141329.html
[packages/elfutils.git] / elfutils-alpha.patch
1 2007-03-16  Jakub Bogusz  <qboosh at pld-linux dot org>
2
3         * backends/alpha_init.c: Add register_info and machine_section_flag_check hooks.
4         * backends/alpha_regs.c: New file.
5         * backends/alpha_symbol.c: (alpha_machine_section_flag_check) New function.
6         * backends/Makefile.am: Add alpha_regs.c.
7
8 --- elfutils-0.126/backends/alpha_init.c.orig   2006-07-05 06:09:28.000000000 +0200
9 +++ elfutils-0.126/backends/alpha_init.c        2006-07-22 10:34:36.417909750 +0200
10 @@ -54,6 +54,8 @@
11    HOOK (eh, dynamic_tag_check);
12    HOOK (eh, reloc_simple_type);
13    HOOK (eh, return_value_location);
14 +  HOOK (eh, machine_section_flag_check);
15 +  HOOK (eh, register_info);
16    eh->sysvhash_entrysize = sizeof (Elf64_Xword);
17  
18    return MODVERSION;
19 --- elfutils-0.124/backends/alpha_regs.c.orig   1970-01-01 01:00:00.000000000 +0100
20 +++ elfutils-0.124/backends/alpha_regs.c        2006-11-16 21:29:16.824457750 +0100
21 @@ -0,0 +1,91 @@
22 +/* Register names and numbers for ALPHA DWARF.
23 +   Based on i386_regs.c, Copyright (C) 2005 Red Hat, Inc.
24 +   This file is part of Red Hat elfutils.
25 +
26 +   Red Hat elfutils is free software; you can redistribute it and/or modify
27 +   it under the terms of the GNU General Public License as published by the
28 +   Free Software Foundation; version 2 of the License.
29 +
30 +   Red Hat elfutils is distributed in the hope that it will be useful, but
31 +   WITHOUT ANY WARRANTY; without even the implied warranty of
32 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
33 +   General Public License for more details.
34 +
35 +   You should have received a copy of the GNU General Public License along
36 +   with Red Hat elfutils; if not, write to the Free Software Foundation,
37 +   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
38 +
39 +   Red Hat elfutils is an included package of the Open Invention Network.
40 +   An included package of the Open Invention Network is a package for which
41 +   Open Invention Network licensees cross-license their patents.  No patent
42 +   license is granted, either expressly or impliedly, by designation as an
43 +   included package.  Should you wish to participate in the Open Invention
44 +   Network licensing program, please visit www.openinventionnetwork.com
45 +   <http://www.openinventionnetwork.com>.  */
46 +
47 +#ifdef HAVE_CONFIG_H
48 +# include <config.h>
49 +#endif
50 +
51 +#include <string.h>
52 +#include <dwarf.h>
53 +
54 +#define BACKEND alpha_
55 +#include "libebl_CPU.h"
56 +
57 +ssize_t
58 +alpha_register_info (Ebl *ebl __attribute__ ((unused)),
59 +                   int regno, char *name, size_t namelen,
60 +                   const char **prefix, const char **setname,
61 +                   int *bits, int *type)
62 +{
63 +  if (name == NULL)
64 +    return 33;
65 +
66 +  if (regno < 0 || regno > 64 || namelen < 5)
67 +    return -1;
68 +
69 +  *prefix = "%";
70 +  *bits = 64;
71 +  if (regno < 32) {
72 +    *setname = "integer";
73 +    if (regno == 26 || regno == 29 || regno == 30) /* ra,gp,sp in alpha ABI */
74 +      *type = DW_ATE_address;
75 +    else
76 +      *type = DW_ATE_signed;
77 +  } else if (regno < 64) {
78 +    *setname = "fp";
79 +    *type = DW_ATE_float;
80 +  } else {
81 +    *setname = "pc";
82 +    *type = DW_ATE_address;
83 +  }
84 +
85 +  switch (regno)
86 +    {
87 +      static const char *alpharegs[] =
88 +       {
89 +         "v0", "t0", "t1", "t2", "t3", "t4", "t5", "t6",
90 +         "t7", "s0", "s1", "s2", "s3", "s4", "s5", "s6",
91 +         "a0", "a1", "a2", "a3", "a4", "a5", "t8", "t9",
92 +         "t10","t11","ra", "t12","at", "gp", "sp", "zero",
93 +         "fv0","fv1","fs0","fs1","fs2","fs3","fs4","fs5",
94 +         "fs6","fs7","ft0","ft1","ft2","ft3","ft4","ft5",
95 +         "fa0","fa1","fa2","fa3","fa4","fa5","ft6","ft7",
96 +         "ft8","ft9","ft10","ft11","ft12","ft13","ft14","fzero",
97 +         "pc"
98 +       };
99 +
100 +    case 0 ... 64:
101 +      strcpy(name, alpharegs[regno]);
102 +      namelen = strlen(name);
103 +      break;
104 +
105 +    default:
106 +      name[0] = '\0';
107 +      *setname = NULL;
108 +      return 0;
109 +    }
110 +
111 +  return namelen;
112 +}
113 --- elfutils-0.126/backends/alpha_symbol.c.orig 2006-04-13 17:04:56.000000000 +0200
114 +++ elfutils-0.126/backends/alpha_symbol.c      2007-03-16 20:11:35.167246761 +0100
115 @@ -55,6 +55,13 @@
116    return tag == DT_ALPHA_PLTRO;
117  }
118  
119 +/* Check whether SHF_MASKPROC flags are valid.  */
120 +bool
121 +alpha_machine_section_flag_check (GElf_Xword sh_flags)
122 +{
123 +  return (sh_flags &~ SHF_ALPHA_GPREL) == 0;
124 +}
125 +
126  /* Check for the simple reloc types.  */
127  Elf_Type
128  alpha_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
129 --- elfutils-0.120/backends/Makefile.am.orig    2006-04-16 13:15:56.425192000 +0200
130 +++ elfutils-0.120/backends/Makefile.am 2006-04-16 13:28:26.928096250 +0200
131 @@ -90,7 +90,7 @@
132  libebl_ia64_pic_a_SOURCES = $(ia64_SRCS)
133  am_libebl_ia64_pic_a_OBJECTS = $(ia64_SRCS:.c=.os)
134  
135 -alpha_SRCS = alpha_init.c alpha_symbol.c alpha_retval.c
136 +alpha_SRCS = alpha_init.c alpha_symbol.c alpha_retval.c alpha_regs.c
137  libebl_alpha_pic_a_SOURCES = $(alpha_SRCS)
138  am_libebl_alpha_pic_a_OBJECTS = $(alpha_SRCS:.c=.os)
139  
This page took 0.0471 seconds and 3 git commands to generate.