]>
Commit | Line | Data |
---|---|---|
4867747f | 1 | 2006-04-16 Jakub Bogusz <qboosh at pld-linux dot org> |
96b9de17 | 2 | |
3532d289 | 3 | * src/elflint.c (check_sections): Support arch-specific section flags. |
74321b06 JB |
4 | * libelf/elf32_getshdr.c: Handle unaligned section header with same |
5 | endianess properly. | |
3532d289 | 6 | * backends/alpha_init.c: Add register_info hook. |
4867747f JB |
7 | * backends/alpha_regs.c: New file. |
8 | * backends/Makefile.am: Add alpha_regs.c. | |
96b9de17 JB |
9 | |
10 | --- elfutils-0.116/src/elflint.c.orig 2005-11-26 10:28:00.000000000 +0100 | |
11 | +++ elfutils-0.116/src/elflint.c 2005-11-26 14:01:18.000000000 +0100 | |
86f100ef | 12 | @@ -2744,9 +2744,30 @@ |
96b9de17 JB |
13 | cnt, section_name (ebl, cnt), |
14 | (int) shdr->sh_type); | |
15 | ||
16 | -#define ALL_SH_FLAGS (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR | SHF_MERGE \ | |
17 | +#define GALL_SH_FLAGS (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR | SHF_MERGE \ | |
18 | | SHF_STRINGS | SHF_INFO_LINK | SHF_LINK_ORDER \ | |
19 | | SHF_OS_NONCONFORMING | SHF_GROUP | SHF_TLS) | |
20 | + uint64_t ALL_SH_FLAGS = GALL_SH_FLAGS; /* generic */ | |
21 | + switch (ehdr->e_machine) { | |
22 | + case EM_MIPS: | |
23 | + ALL_SH_FLAGS |= SHF_MIPS_GPREL | SHF_MIPS_MERGE | SHF_MIPS_ADDR | | |
24 | + SHF_MIPS_STRINGS | SHF_MIPS_NOSTRIP | SHF_MIPS_LOCAL | | |
25 | + SHF_MIPS_NAMES | SHF_MIPS_NODUPE; | |
26 | + break; | |
27 | + case EM_PARISC: | |
28 | + ALL_SH_FLAGS |= SHF_PARISC_SHORT | SHF_PARISC_HUGE | SHF_PARISC_SBP; | |
29 | + break; | |
30 | + case EM_ALPHA: | |
31 | + ALL_SH_FLAGS |= SHF_ALPHA_GPREL; | |
32 | + break; | |
33 | + case EM_ARM: | |
34 | + ALL_SH_FLAGS |= SHF_ARM_ENTRYSECT | SHF_ARM_COMDEF; | |
35 | + break; | |
36 | + case EM_IA_64: | |
37 | + ALL_SH_FLAGS |= SHF_IA_64_SHORT | SHF_IA_64_NORECOV; | |
38 | + break; | |
39 | + } | |
40 | + | |
41 | if (shdr->sh_flags & ~ALL_SH_FLAGS) | |
42 | ERROR (gettext ("section [%2zu] '%s' contains unknown flag(s)" | |
43 | " %#" PRIx64 "\n"), | |
74321b06 JB |
44 | --- elfutils-0.119/libelf/elf32_getshdr.c.orig 2006-02-05 18:17:07.948304250 +0100 |
45 | +++ elfutils-0.119/libelf/elf32_getshdr.c 2006-02-05 18:26:52.836857500 +0100 | |
46 | @@ -107,7 +107,10 @@ | |
96b9de17 JB |
47 | } |
48 | ||
49 | /* Now copy the data and at the same time convert the byte | |
50 | - order. */ | |
51 | + order, if needed. */ | |
52 | + if (ehdr->e_ident[EI_DATA] == MY_ELFDATA) | |
53 | + memcpy (shdr, ((char*) elf->map_address + elf->start_offset + ehdr->e_shoff), size); | |
54 | + else { | |
55 | if (ALLOW_UNALIGNED | |
74321b06 JB |
56 | || (((uintptr_t) elf->map_address + elf->start_offset |
57 | + ehdr->e_shoff) | |
58 | @@ -136,6 +139,7 @@ | |
96b9de17 JB |
59 | CONVERT_TO (shdr[cnt].sh_addralign, notcvt[cnt].sh_addralign); |
60 | CONVERT_TO (shdr[cnt].sh_entsize, notcvt[cnt].sh_entsize); | |
61 | } | |
62 | + } | |
63 | } | |
64 | else if (likely (elf->fildes != -1)) | |
65 | { | |
3532d289 JB |
66 | --- elfutils-0.124/backends/alpha_init.c.orig 2006-07-05 06:09:28.000000000 +0200 |
67 | +++ elfutils-0.124/backends/alpha_init.c 2006-07-22 10:34:36.417909750 +0200 | |
4867747f JB |
68 | @@ -54,6 +54,7 @@ |
69 | HOOK (eh, dynamic_tag_check); | |
70 | HOOK (eh, reloc_simple_type); | |
71 | HOOK (eh, return_value_location); | |
3532d289 | 72 | + HOOK (eh, register_info); |
86f100ef | 73 | eh->sysvhash_entrysize = sizeof (Elf64_Xword); |
4867747f JB |
74 | |
75 | return MODVERSION; | |
3532d289 JB |
76 | --- elfutils-0.124/backends/alpha_regs.c.orig 1970-01-01 01:00:00.000000000 +0100 |
77 | +++ elfutils-0.124/backends/alpha_regs.c 2006-11-16 21:29:16.824457750 +0100 | |
78 | @@ -0,0 +1,91 @@ | |
4867747f JB |
79 | +/* Register names and numbers for ALPHA DWARF. |
80 | + Based on i386_regs.c, Copyright (C) 2005 Red Hat, Inc. | |
81 | + This file is part of Red Hat elfutils. | |
82 | + | |
83 | + Red Hat elfutils is free software; you can redistribute it and/or modify | |
84 | + it under the terms of the GNU General Public License as published by the | |
85 | + Free Software Foundation; version 2 of the License. | |
86 | + | |
87 | + Red Hat elfutils is distributed in the hope that it will be useful, but | |
88 | + WITHOUT ANY WARRANTY; without even the implied warranty of | |
89 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
90 | + General Public License for more details. | |
91 | + | |
92 | + You should have received a copy of the GNU General Public License along | |
93 | + with Red Hat elfutils; if not, write to the Free Software Foundation, | |
94 | + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. | |
95 | + | |
96 | + Red Hat elfutils is an included package of the Open Invention Network. | |
97 | + An included package of the Open Invention Network is a package for which | |
98 | + Open Invention Network licensees cross-license their patents. No patent | |
99 | + license is granted, either expressly or impliedly, by designation as an | |
100 | + included package. Should you wish to participate in the Open Invention | |
101 | + Network licensing program, please visit www.openinventionnetwork.com | |
102 | + <http://www.openinventionnetwork.com>. */ | |
103 | + | |
104 | +#ifdef HAVE_CONFIG_H | |
105 | +# include <config.h> | |
106 | +#endif | |
107 | + | |
108 | +#include <string.h> | |
3532d289 | 109 | +#include <dwarf.h> |
4867747f JB |
110 | + |
111 | +#define BACKEND alpha_ | |
112 | +#include "libebl_CPU.h" | |
113 | + | |
114 | +ssize_t | |
3532d289 | 115 | +alpha_register_info (Ebl *ebl __attribute__ ((unused)), |
4867747f | 116 | + int regno, char *name, size_t namelen, |
3532d289 JB |
117 | + const char **prefix, const char **setname, |
118 | + int *bits, int *type) | |
4867747f JB |
119 | +{ |
120 | + if (name == NULL) | |
121 | + return 33; | |
122 | + | |
123 | + if (regno < 0 || regno > 64 || namelen < 5) | |
124 | + return -1; | |
125 | + | |
126 | + *prefix = "%"; | |
3532d289 JB |
127 | + *bits = 64; |
128 | + if (regno < 32) { | |
4867747f | 129 | + *setname = "integer"; |
3532d289 JB |
130 | + if (regno == 26 || regno == 29 || regno == 30) /* ra,gp,sp in alpha ABI */ |
131 | + *type = DW_ATE_address; | |
132 | + else | |
133 | + *type = DW_ATE_signed; | |
134 | + } else if (regno < 64) { | |
4867747f | 135 | + *setname = "fp"; |
3532d289 JB |
136 | + *type = DW_ATE_float; |
137 | + } else { | |
4867747f | 138 | + *setname = "pc"; |
3532d289 JB |
139 | + *type = DW_ATE_address; |
140 | + } | |
4867747f JB |
141 | + |
142 | + switch (regno) | |
143 | + { | |
144 | + static const char *alpharegs[] = | |
145 | + { | |
146 | + "v0", "t0", "t1", "t2", "t3", "t4", "t5", "t6", | |
147 | + "t7", "s0", "s1", "s2", "s3", "s4", "s5", "s6", | |
148 | + "a0", "a1", "a2", "a3", "a4", "a5", "t8", "t9", | |
149 | + "t10","t11","ra", "t12","at", "gp", "sp", "zero", | |
150 | + "fv0","fv1","fs0","fs1","fs2","fs3","fs4","fs5", | |
151 | + "fs6","fs7","ft0","ft1","ft2","ft3","ft4","ft5", | |
152 | + "fa0","fa1","fa2","fa3","fa4","fa5","ft6","ft7", | |
153 | + "ft8","ft9","ft10","ft11","ft12","ft13","ft14","fzero", | |
154 | + "pc" | |
155 | + }; | |
156 | + | |
157 | + case 0 ... 64: | |
158 | + strcpy(name, alpharegs[regno]); | |
159 | + namelen = strlen(name); | |
160 | + break; | |
161 | + | |
162 | + default: | |
163 | + name[0] = '\0'; | |
164 | + *setname = NULL; | |
165 | + return 0; | |
166 | + } | |
167 | + | |
168 | + return namelen; | |
169 | +} | |
170 | --- elfutils-0.120/backends/Makefile.am.orig 2006-04-16 13:15:56.425192000 +0200 | |
171 | +++ elfutils-0.120/backends/Makefile.am 2006-04-16 13:28:26.928096250 +0200 | |
172 | @@ -90,7 +90,7 @@ | |
173 | libebl_ia64_pic_a_SOURCES = $(ia64_SRCS) | |
174 | am_libebl_ia64_pic_a_OBJECTS = $(ia64_SRCS:.c=.os) | |
175 | ||
176 | -alpha_SRCS = alpha_init.c alpha_symbol.c alpha_retval.c | |
177 | +alpha_SRCS = alpha_init.c alpha_symbol.c alpha_retval.c alpha_regs.c | |
178 | libebl_alpha_pic_a_SOURCES = $(alpha_SRCS) | |
179 | am_libebl_alpha_pic_a_OBJECTS = $(alpha_SRCS:.c=.os) | |
180 |