]>
Commit | Line | Data |
---|---|---|
3c756ccc | 1 | 2007-03-16 Jakub Bogusz <qboosh at pld-linux dot org> |
96b9de17 | 2 | |
3c756ccc | 3 | * backends/alpha_init.c: Add register_info and machine_section_flag_check hooks. |
4867747f | 4 | * backends/alpha_regs.c: New file. |
3c756ccc | 5 | * backends/alpha_symbol.c: (alpha_machine_section_flag_check) New function. |
4867747f | 6 | * backends/Makefile.am: Add alpha_regs.c. |
96b9de17 | 7 | |
3c756ccc JB |
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 @@ | |
4867747f JB |
11 | HOOK (eh, dynamic_tag_check); |
12 | HOOK (eh, reloc_simple_type); | |
13 | HOOK (eh, return_value_location); | |
3c756ccc | 14 | + HOOK (eh, machine_section_flag_check); |
3532d289 | 15 | + HOOK (eh, register_info); |
86f100ef | 16 | eh->sysvhash_entrysize = sizeof (Elf64_Xword); |
4867747f JB |
17 | |
18 | return MODVERSION; | |
3532d289 JB |
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 @@ | |
4867747f JB |
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> | |
3532d289 | 52 | +#include <dwarf.h> |
4867747f JB |
53 | + |
54 | +#define BACKEND alpha_ | |
55 | +#include "libebl_CPU.h" | |
56 | + | |
57 | +ssize_t | |
3532d289 | 58 | +alpha_register_info (Ebl *ebl __attribute__ ((unused)), |
4867747f | 59 | + int regno, char *name, size_t namelen, |
3532d289 JB |
60 | + const char **prefix, const char **setname, |
61 | + int *bits, int *type) | |
4867747f JB |
62 | +{ |
63 | + if (name == NULL) | |
64 | + return 33; | |
65 | + | |
66 | + if (regno < 0 || regno > 64 || namelen < 5) | |
67 | + return -1; | |
68 | + | |
69 | + *prefix = "%"; | |
3532d289 JB |
70 | + *bits = 64; |
71 | + if (regno < 32) { | |
4867747f | 72 | + *setname = "integer"; |
3532d289 JB |
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) { | |
4867747f | 78 | + *setname = "fp"; |
3532d289 JB |
79 | + *type = DW_ATE_float; |
80 | + } else { | |
4867747f | 81 | + *setname = "pc"; |
3532d289 JB |
82 | + *type = DW_ATE_address; |
83 | + } | |
4867747f JB |
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 | +} | |
3c756ccc JB |
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) | |
4867747f JB |
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 |