1 2006-04-16 Jakub Bogusz <qboosh at pld-linux dot org>
3 * src/elflint.c (valid_e_machine) Add EM_ALPHA to valid machines.
4 (check_sections): Support arch-specific section flags.
5 * libelf/elf32_getshdr.c: Handle unaligned section header with same
7 * backends/alpha_init.c: Add register_name hook.
8 * backends/alpha_regs.c: New file.
9 * backends/Makefile.am: Add alpha_regs.c.
11 --- elfutils-0.116/src/elflint.c.orig 2005-11-26 10:28:00.000000000 +0100
12 +++ elfutils-0.116/src/elflint.c 2005-11-26 14:01:18.000000000 +0100
14 EM_68HC16, EM_68HC11, EM_68HC08, EM_68HC05, EM_SVX, EM_ST19, EM_VAX,
15 EM_CRIS, EM_JAVELIN, EM_FIREPATH, EM_ZSP, EM_MMIX, EM_HUANY, EM_PRISM,
16 EM_AVR, EM_FR30, EM_D10V, EM_D30V, EM_V850, EM_M32R, EM_MN10300,
17 - EM_MN10200, EM_PJ, EM_OPENRISC, EM_ARC_A5, EM_XTENSA
18 + EM_MN10200, EM_PJ, EM_OPENRISC, EM_ARC_A5, EM_XTENSA, EM_ALPHA
20 #define nvalid_e_machine \
21 (sizeof (valid_e_machine) / sizeof (valid_e_machine[0]))
22 @@ -2744,9 +2744,30 @@
23 cnt, section_name (ebl, cnt),
26 -#define ALL_SH_FLAGS (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR | SHF_MERGE \
27 +#define GALL_SH_FLAGS (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR | SHF_MERGE \
28 | SHF_STRINGS | SHF_INFO_LINK | SHF_LINK_ORDER \
29 | SHF_OS_NONCONFORMING | SHF_GROUP | SHF_TLS)
30 + uint64_t ALL_SH_FLAGS = GALL_SH_FLAGS; /* generic */
31 + switch (ehdr->e_machine) {
33 + ALL_SH_FLAGS |= SHF_MIPS_GPREL | SHF_MIPS_MERGE | SHF_MIPS_ADDR |
34 + SHF_MIPS_STRINGS | SHF_MIPS_NOSTRIP | SHF_MIPS_LOCAL |
35 + SHF_MIPS_NAMES | SHF_MIPS_NODUPE;
38 + ALL_SH_FLAGS |= SHF_PARISC_SHORT | SHF_PARISC_HUGE | SHF_PARISC_SBP;
41 + ALL_SH_FLAGS |= SHF_ALPHA_GPREL;
44 + ALL_SH_FLAGS |= SHF_ARM_ENTRYSECT | SHF_ARM_COMDEF;
47 + ALL_SH_FLAGS |= SHF_IA_64_SHORT | SHF_IA_64_NORECOV;
51 if (shdr->sh_flags & ~ALL_SH_FLAGS)
52 ERROR (gettext ("section [%2zu] '%s' contains unknown flag(s)"
54 --- elfutils-0.119/libelf/elf32_getshdr.c.orig 2006-02-05 18:17:07.948304250 +0100
55 +++ elfutils-0.119/libelf/elf32_getshdr.c 2006-02-05 18:26:52.836857500 +0100
59 /* Now copy the data and at the same time convert the byte
61 + order, if needed. */
62 + if (ehdr->e_ident[EI_DATA] == MY_ELFDATA)
63 + memcpy (shdr, ((char*) elf->map_address + elf->start_offset + ehdr->e_shoff), size);
66 || (((uintptr_t) elf->map_address + elf->start_offset
69 CONVERT_TO (shdr[cnt].sh_addralign, notcvt[cnt].sh_addralign);
70 CONVERT_TO (shdr[cnt].sh_entsize, notcvt[cnt].sh_entsize);
74 else if (likely (elf->fildes != -1))
76 --- elfutils-0.122/backends/alpha_init.c.orig 2006-07-05 06:09:28.000000000 +0200
77 +++ elfutils-0.122/backends/alpha_init.c 2006-07-22 10:34:36.417909750 +0200
79 HOOK (eh, dynamic_tag_check);
80 HOOK (eh, reloc_simple_type);
81 HOOK (eh, return_value_location);
82 + HOOK (eh, register_name);
83 eh->sysvhash_entrysize = sizeof (Elf64_Xword);
86 --- elfutils-0.120/backends/alpha_regs.c.orig 1970-01-01 01:00:00.000000000 +0100
87 +++ elfutils-0.120/backends/alpha_regs.c 2006-04-16 13:10:15.947914250 +0200
89 +/* Register names and numbers for ALPHA DWARF.
90 + Based on i386_regs.c, Copyright (C) 2005 Red Hat, Inc.
91 + This file is part of Red Hat elfutils.
93 + Red Hat elfutils is free software; you can redistribute it and/or modify
94 + it under the terms of the GNU General Public License as published by the
95 + Free Software Foundation; version 2 of the License.
97 + Red Hat elfutils is distributed in the hope that it will be useful, but
98 + WITHOUT ANY WARRANTY; without even the implied warranty of
99 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
100 + General Public License for more details.
102 + You should have received a copy of the GNU General Public License along
103 + with Red Hat elfutils; if not, write to the Free Software Foundation,
104 + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
106 + Red Hat elfutils is an included package of the Open Invention Network.
107 + An included package of the Open Invention Network is a package for which
108 + Open Invention Network licensees cross-license their patents. No patent
109 + license is granted, either expressly or impliedly, by designation as an
110 + included package. Should you wish to participate in the Open Invention
111 + Network licensing program, please visit www.openinventionnetwork.com
112 + <http://www.openinventionnetwork.com>. */
114 +#ifdef HAVE_CONFIG_H
115 +# include <config.h>
120 +#define BACKEND alpha_
121 +#include "libebl_CPU.h"
124 +alpha_register_name (Ebl *ebl __attribute__ ((unused)),
125 + int regno, char *name, size_t namelen,
126 + const char **prefix, const char **setname)
131 + if (regno < 0 || regno > 64 || namelen < 5)
136 + *setname = "integer";
137 + else if (regno < 64)
144 + static const char *alpharegs[] =
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",
158 + strcpy(name, alpharegs[regno]);
159 + namelen = strlen(name);
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
173 libebl_ia64_pic_a_SOURCES = $(ia64_SRCS)
174 am_libebl_ia64_pic_a_OBJECTS = $(ia64_SRCS:.c=.os)
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)