diff options
Diffstat (limited to 'meta/recipes-devtools/elfutils/elfutils-0.163')
15 files changed, 4237 insertions, 0 deletions
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch b/meta/recipes-devtools/elfutils/elfutils-0.163/0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch new file mode 100644 index 0000000000..3754c1c361 --- /dev/null +++ b/meta/recipes-devtools/elfutils/elfutils-0.163/0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From 668accf322fd7185e273bfd50b84320e71d9de5a Mon Sep 17 00:00:00 2001 | ||
2 | From: Martin Jansa <Martin.Jansa@gmail.com> | ||
3 | Date: Fri, 10 Apr 2015 00:29:18 +0200 | ||
4 | Subject: [PATCH] elf_getarsym: Silence -Werror=maybe-uninitialized false | ||
5 | positive | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
9 | --- | ||
10 | libelf/elf_getarsym.c | 9 +++++++-- | ||
11 | 1 file changed, 7 insertions(+), 2 deletions(-) | ||
12 | |||
13 | diff --git a/libelf/elf_getarsym.c b/libelf/elf_getarsym.c | ||
14 | index d0bb28a..08954d2 100644 | ||
15 | --- a/libelf/elf_getarsym.c | ||
16 | +++ b/libelf/elf_getarsym.c | ||
17 | @@ -165,8 +165,13 @@ elf_getarsym (elf, ptr) | ||
18 | int w = index64_p ? 8 : 4; | ||
19 | |||
20 | /* We have an archive. The first word in there is the number of | ||
21 | - entries in the table. */ | ||
22 | - uint64_t n; | ||
23 | + entries in the table. | ||
24 | + Set to SIZE_MAX just to silence -Werror=maybe-uninitialized | ||
25 | + elf_getarsym.c:290:9: error: 'n' may be used uninitialized in this function | ||
26 | + The read_number_entries function doesn't initialize n only when returning | ||
27 | + -1 which in turn ensures to jump over usage of this uninitialized variable. | ||
28 | + */ | ||
29 | + uint64_t n = SIZE_MAX; | ||
30 | size_t off = elf->start_offset + SARMAG + sizeof (struct ar_hdr); | ||
31 | if (read_number_entries (&n, elf, &off, index64_p) < 0) | ||
32 | { | ||
33 | -- | ||
34 | 2.3.5 | ||
35 | |||
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/0001-remove-the-unneed-checking.patch b/meta/recipes-devtools/elfutils/elfutils-0.163/0001-remove-the-unneed-checking.patch new file mode 100644 index 0000000000..5be92d705a --- /dev/null +++ b/meta/recipes-devtools/elfutils/elfutils-0.163/0001-remove-the-unneed-checking.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | Disable the test to convert euc-jp | ||
2 | |||
3 | Remove the test "Test against HP-UX 11.11 bug: | ||
4 | No converter from EUC-JP to UTF-8 is provided" | ||
5 | since we don't support HP-UX and if the euc-jp is not | ||
6 | installed on the host, the dependence will be built without | ||
7 | iconv support and will cause guild-native building fail. | ||
8 | |||
9 | Upstream-Status: Inappropriate [OE specific] | ||
10 | |||
11 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
12 | --- | ||
13 | m4/iconv.m4 | 2 ++ | ||
14 | 1 file changed, 2 insertions(+) | ||
15 | |||
16 | diff --git a/m4/iconv.m4 b/m4/iconv.m4 | ||
17 | index a503646..299f1eb 100644 | ||
18 | --- a/m4/iconv.m4 | ||
19 | +++ b/m4/iconv.m4 | ||
20 | @@ -159,6 +159,7 @@ int main () | ||
21 | } | ||
22 | } | ||
23 | #endif | ||
24 | +#if 0 | ||
25 | /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is | ||
26 | provided. */ | ||
27 | if (/* Try standardized names. */ | ||
28 | @@ -170,6 +171,7 @@ int main () | ||
29 | /* Try HP-UX names. */ | ||
30 | && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) | ||
31 | result |= 16; | ||
32 | +#endif | ||
33 | return result; | ||
34 | }]])], | ||
35 | [am_cv_func_iconv_works=yes], | ||
36 | -- | ||
37 | 2.0.1 | ||
38 | |||
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/arm_backend.diff b/meta/recipes-devtools/elfutils/elfutils-0.163/arm_backend.diff new file mode 100644 index 0000000000..c97c4e470d --- /dev/null +++ b/meta/recipes-devtools/elfutils/elfutils-0.163/arm_backend.diff | |||
@@ -0,0 +1,625 @@ | |||
1 | From 0db1687eee0b4d16ccbc40db5a06b574fca6614c Mon Sep 17 00:00:00 2001 | ||
2 | From: Hongxu Jia <hongxu.jia@windriver.com> | ||
3 | Date: Fri, 14 Nov 2014 15:25:42 +0800 | ||
4 | Subject: [PATCH] Rebase arm_backend.diff from 0.159 to 0.160 | ||
5 | |||
6 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
7 | --- | ||
8 | backends/arm_init.c | 18 ++++- | ||
9 | backends/arm_regs.c | 132 ++++++++++++++++++++++++++++++++++++ | ||
10 | backends/arm_retval.c | 44 +++++++++++- | ||
11 | backends/libebl_arm.h | 9 +++ | ||
12 | libelf/elf.h | 11 +++ | ||
13 | tests/run-addrcfi.sh | 93 ++++++++++++++++++++++++- | ||
14 | tests/run-allregs.sh | 95 +++++++++++++++++++++++++- | ||
15 | tests/run-readelf-mixed-corenote.sh | 11 ++- | ||
16 | 8 files changed, 401 insertions(+), 12 deletions(-) | ||
17 | create mode 100644 backends/libebl_arm.h | ||
18 | |||
19 | diff --git a/backends/arm_init.c b/backends/arm_init.c | ||
20 | index 3283c97..8b57d3f 100644 | ||
21 | --- a/backends/arm_init.c | ||
22 | +++ b/backends/arm_init.c | ||
23 | @@ -35,21 +35,32 @@ | ||
24 | #define RELOC_PREFIX R_ARM_ | ||
25 | #include "libebl_CPU.h" | ||
26 | |||
27 | +#include "libebl_arm.h" | ||
28 | + | ||
29 | /* This defines the common reloc hooks based on arm_reloc.def. */ | ||
30 | #include "common-reloc.c" | ||
31 | |||
32 | |||
33 | const char * | ||
34 | arm_init (elf, machine, eh, ehlen) | ||
35 | - Elf *elf __attribute__ ((unused)); | ||
36 | + Elf *elf; | ||
37 | GElf_Half machine __attribute__ ((unused)); | ||
38 | Ebl *eh; | ||
39 | size_t ehlen; | ||
40 | { | ||
41 | + int soft_float = 0; | ||
42 | + | ||
43 | /* Check whether the Elf_BH object has a sufficent size. */ | ||
44 | if (ehlen < sizeof (Ebl)) | ||
45 | return NULL; | ||
46 | |||
47 | + if (elf) { | ||
48 | + GElf_Ehdr ehdr_mem; | ||
49 | + GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem); | ||
50 | + if (ehdr && (ehdr->e_flags & EF_ARM_SOFT_FLOAT)) | ||
51 | + soft_float = 1; | ||
52 | + } | ||
53 | + | ||
54 | /* We handle it. */ | ||
55 | eh->name = "ARM"; | ||
56 | arm_init_reloc (eh); | ||
57 | @@ -61,7 +72,10 @@ arm_init (elf, machine, eh, ehlen) | ||
58 | HOOK (eh, core_note); | ||
59 | HOOK (eh, auxv_info); | ||
60 | HOOK (eh, check_object_attribute); | ||
61 | - HOOK (eh, return_value_location); | ||
62 | + if (soft_float) | ||
63 | + eh->return_value_location = arm_return_value_location_soft; | ||
64 | + else | ||
65 | + eh->return_value_location = arm_return_value_location_hard; | ||
66 | HOOK (eh, abi_cfi); | ||
67 | HOOK (eh, check_reloc_target_type); | ||
68 | |||
69 | diff --git a/backends/arm_regs.c b/backends/arm_regs.c | ||
70 | index 21c5ad3..4ee1039 100644 | ||
71 | --- a/backends/arm_regs.c | ||
72 | +++ b/backends/arm_regs.c | ||
73 | @@ -31,6 +31,7 @@ | ||
74 | #endif | ||
75 | |||
76 | #include <string.h> | ||
77 | +#include <stdio.h> | ||
78 | #include <dwarf.h> | ||
79 | |||
80 | #define BACKEND arm_ | ||
81 | @@ -76,6 +77,9 @@ arm_register_info (Ebl *ebl __attribute__ ((unused)), | ||
82 | break; | ||
83 | |||
84 | case 16 + 0 ... 16 + 7: | ||
85 | + /* AADWARF says that there are no registers in that range, | ||
86 | + * but gcc maps FPA registers here | ||
87 | + */ | ||
88 | regno += 96 - 16; | ||
89 | /* Fall through. */ | ||
90 | case 96 + 0 ... 96 + 7: | ||
91 | @@ -87,11 +91,139 @@ arm_register_info (Ebl *ebl __attribute__ ((unused)), | ||
92 | namelen = 2; | ||
93 | break; | ||
94 | |||
95 | + case 64 + 0 ... 64 + 9: | ||
96 | + *setname = "VFP"; | ||
97 | + *bits = 32; | ||
98 | + *type = DW_ATE_float; | ||
99 | + name[0] = 's'; | ||
100 | + name[1] = regno - 64 + '0'; | ||
101 | + namelen = 2; | ||
102 | + break; | ||
103 | + | ||
104 | + case 64 + 10 ... 64 + 31: | ||
105 | + *setname = "VFP"; | ||
106 | + *bits = 32; | ||
107 | + *type = DW_ATE_float; | ||
108 | + name[0] = 's'; | ||
109 | + name[1] = (regno - 64) / 10 + '0'; | ||
110 | + name[2] = (regno - 64) % 10 + '0'; | ||
111 | + namelen = 3; | ||
112 | + break; | ||
113 | + | ||
114 | + case 104 + 0 ... 104 + 7: | ||
115 | + /* XXX TODO: | ||
116 | + * This can be either intel wireless MMX general purpose/control | ||
117 | + * registers or xscale accumulator, which have different usage. | ||
118 | + * We only have the intel wireless MMX here now. | ||
119 | + * The name needs to be changed for the xscale accumulator too. */ | ||
120 | + *setname = "MMX"; | ||
121 | + *type = DW_ATE_unsigned; | ||
122 | + *bits = 32; | ||
123 | + memcpy(name, "wcgr", 4); | ||
124 | + name[4] = regno - 104 + '0'; | ||
125 | + namelen = 5; | ||
126 | + break; | ||
127 | + | ||
128 | + case 112 + 0 ... 112 + 9: | ||
129 | + *setname = "MMX"; | ||
130 | + *type = DW_ATE_unsigned; | ||
131 | + *bits = 64; | ||
132 | + name[0] = 'w'; | ||
133 | + name[1] = 'r'; | ||
134 | + name[2] = regno - 112 + '0'; | ||
135 | + namelen = 3; | ||
136 | + break; | ||
137 | + | ||
138 | + case 112 + 10 ... 112 + 15: | ||
139 | + *setname = "MMX"; | ||
140 | + *type = DW_ATE_unsigned; | ||
141 | + *bits = 64; | ||
142 | + name[0] = 'w'; | ||
143 | + name[1] = 'r'; | ||
144 | + name[2] = '1'; | ||
145 | + name[3] = regno - 112 - 10 + '0'; | ||
146 | + namelen = 4; | ||
147 | + break; | ||
148 | + | ||
149 | case 128: | ||
150 | + *setname = "state"; | ||
151 | *type = DW_ATE_unsigned; | ||
152 | return stpcpy (name, "spsr") + 1 - name; | ||
153 | |||
154 | + case 129: | ||
155 | + *setname = "state"; | ||
156 | + *type = DW_ATE_unsigned; | ||
157 | + return stpcpy(name, "spsr_fiq") + 1 - name; | ||
158 | + | ||
159 | + case 130: | ||
160 | + *setname = "state"; | ||
161 | + *type = DW_ATE_unsigned; | ||
162 | + return stpcpy(name, "spsr_irq") + 1 - name; | ||
163 | + | ||
164 | + case 131: | ||
165 | + *setname = "state"; | ||
166 | + *type = DW_ATE_unsigned; | ||
167 | + return stpcpy(name, "spsr_abt") + 1 - name; | ||
168 | + | ||
169 | + case 132: | ||
170 | + *setname = "state"; | ||
171 | + *type = DW_ATE_unsigned; | ||
172 | + return stpcpy(name, "spsr_und") + 1 - name; | ||
173 | + | ||
174 | + case 133: | ||
175 | + *setname = "state"; | ||
176 | + *type = DW_ATE_unsigned; | ||
177 | + return stpcpy(name, "spsr_svc") + 1 - name; | ||
178 | + | ||
179 | + case 144 ... 150: | ||
180 | + *setname = "integer"; | ||
181 | + *type = DW_ATE_signed; | ||
182 | + *bits = 32; | ||
183 | + return sprintf(name, "r%d_usr", regno - 144 + 8) + 1; | ||
184 | + | ||
185 | + case 151 ... 157: | ||
186 | + *setname = "integer"; | ||
187 | + *type = DW_ATE_signed; | ||
188 | + *bits = 32; | ||
189 | + return sprintf(name, "r%d_fiq", regno - 151 + 8) + 1; | ||
190 | + | ||
191 | + case 158 ... 159: | ||
192 | + *setname = "integer"; | ||
193 | + *type = DW_ATE_signed; | ||
194 | + *bits = 32; | ||
195 | + return sprintf(name, "r%d_irq", regno - 158 + 13) + 1; | ||
196 | + | ||
197 | + case 160 ... 161: | ||
198 | + *setname = "integer"; | ||
199 | + *type = DW_ATE_signed; | ||
200 | + *bits = 32; | ||
201 | + return sprintf(name, "r%d_abt", regno - 160 + 13) + 1; | ||
202 | + | ||
203 | + case 162 ... 163: | ||
204 | + *setname = "integer"; | ||
205 | + *type = DW_ATE_signed; | ||
206 | + *bits = 32; | ||
207 | + return sprintf(name, "r%d_und", regno - 162 + 13) + 1; | ||
208 | + | ||
209 | + case 164 ... 165: | ||
210 | + *setname = "integer"; | ||
211 | + *type = DW_ATE_signed; | ||
212 | + *bits = 32; | ||
213 | + return sprintf(name, "r%d_svc", regno - 164 + 13) + 1; | ||
214 | + | ||
215 | + case 192 ... 199: | ||
216 | + *setname = "MMX"; | ||
217 | + *bits = 32; | ||
218 | + *type = DW_ATE_unsigned; | ||
219 | + name[0] = 'w'; | ||
220 | + name[1] = 'c'; | ||
221 | + name[2] = regno - 192 + '0'; | ||
222 | + namelen = 3; | ||
223 | + break; | ||
224 | + | ||
225 | case 256 + 0 ... 256 + 9: | ||
226 | + /* XXX TODO: Neon also uses those registers and can contain | ||
227 | + * both float and integers */ | ||
228 | *setname = "VFP"; | ||
229 | *type = DW_ATE_float; | ||
230 | *bits = 64; | ||
231 | diff --git a/backends/arm_retval.c b/backends/arm_retval.c | ||
232 | index 7aced74..052132e 100644 | ||
233 | --- a/backends/arm_retval.c | ||
234 | +++ b/backends/arm_retval.c | ||
235 | @@ -48,6 +48,13 @@ static const Dwarf_Op loc_intreg[] = | ||
236 | #define nloc_intreg 1 | ||
237 | #define nloc_intregs(n) (2 * (n)) | ||
238 | |||
239 | +/* f1 */ /* XXX TODO: f0 can also have number 96 if program was compiled with -mabi=aapcs */ | ||
240 | +static const Dwarf_Op loc_fpreg[] = | ||
241 | + { | ||
242 | + { .atom = DW_OP_reg16 }, | ||
243 | + }; | ||
244 | +#define nloc_fpreg 1 | ||
245 | + | ||
246 | /* The return value is a structure and is actually stored in stack space | ||
247 | passed in a hidden argument by the caller. But, the compiler | ||
248 | helpfully returns the address of that space in r0. */ | ||
249 | @@ -58,8 +65,9 @@ static const Dwarf_Op loc_aggregate[] = | ||
250 | #define nloc_aggregate 1 | ||
251 | |||
252 | |||
253 | -int | ||
254 | -arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) | ||
255 | +static int | ||
256 | +arm_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp, | ||
257 | + int soft_float) | ||
258 | { | ||
259 | /* Start with the function's type, and get the DW_AT_type attribute, | ||
260 | which is the type of the return value. */ | ||
261 | @@ -98,14 +106,31 @@ arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) | ||
262 | else | ||
263 | return -1; | ||
264 | } | ||
265 | + if (tag == DW_TAG_base_type) | ||
266 | + { | ||
267 | + Dwarf_Word encoding; | ||
268 | + if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding, | ||
269 | + &attr_mem), &encoding) != 0) | ||
270 | + return -1; | ||
271 | + | ||
272 | + if ((encoding == DW_ATE_float) && !soft_float) | ||
273 | + { | ||
274 | + *locp = loc_fpreg; | ||
275 | + if (size <= 8) | ||
276 | + return nloc_fpreg; | ||
277 | + goto aggregate; | ||
278 | + } | ||
279 | + } | ||
280 | if (size <= 16) | ||
281 | { | ||
282 | intreg: | ||
283 | *locp = loc_intreg; | ||
284 | return size <= 4 ? nloc_intreg : nloc_intregs ((size + 3) / 4); | ||
285 | } | ||
286 | + /* fall through. */ | ||
287 | |||
288 | aggregate: | ||
289 | + /* XXX TODO sometimes aggregates are returned in r0 (-mabi=aapcs) */ | ||
290 | *locp = loc_aggregate; | ||
291 | return nloc_aggregate; | ||
292 | } | ||
293 | @@ -125,3 +150,18 @@ arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) | ||
294 | DWARF and might be valid. */ | ||
295 | return -2; | ||
296 | } | ||
297 | + | ||
298 | +/* return location for -mabi=apcs-gnu -msoft-float */ | ||
299 | +int | ||
300 | +arm_return_value_location_soft (Dwarf_Die *functypedie, const Dwarf_Op **locp) | ||
301 | +{ | ||
302 | + return arm_return_value_location_ (functypedie, locp, 1); | ||
303 | +} | ||
304 | + | ||
305 | +/* return location for -mabi=apcs-gnu -mhard-float (current default) */ | ||
306 | +int | ||
307 | +arm_return_value_location_hard (Dwarf_Die *functypedie, const Dwarf_Op **locp) | ||
308 | +{ | ||
309 | + return arm_return_value_location_ (functypedie, locp, 0); | ||
310 | +} | ||
311 | + | ||
312 | diff --git a/backends/libebl_arm.h b/backends/libebl_arm.h | ||
313 | new file mode 100644 | ||
314 | index 0000000..c00770c | ||
315 | --- /dev/null | ||
316 | +++ b/backends/libebl_arm.h | ||
317 | @@ -0,0 +1,9 @@ | ||
318 | +#ifndef _LIBEBL_ARM_H | ||
319 | +#define _LIBEBL_ARM_H 1 | ||
320 | + | ||
321 | +#include <libdw.h> | ||
322 | + | ||
323 | +extern int arm_return_value_location_soft(Dwarf_Die *, const Dwarf_Op **locp); | ||
324 | +extern int arm_return_value_location_hard(Dwarf_Die *, const Dwarf_Op **locp); | ||
325 | + | ||
326 | +#endif | ||
327 | diff --git a/libelf/elf.h b/libelf/elf.h | ||
328 | index a3cce3e..0891674 100644 | ||
329 | --- a/libelf/elf.h | ||
330 | +++ b/libelf/elf.h | ||
331 | @@ -2346,6 +2346,9 @@ typedef Elf32_Addr Elf32_Conflict; | ||
332 | #define EF_ARM_EABI_VER4 0x04000000 | ||
333 | #define EF_ARM_EABI_VER5 0x05000000 | ||
334 | |||
335 | +/* EI_OSABI values */ | ||
336 | +#define ELFOSABI_ARM_AEABI 64 /* Contains symbol versioning. */ | ||
337 | + | ||
338 | /* Additional symbol types for Thumb. */ | ||
339 | #define STT_ARM_TFUNC STT_LOPROC /* A Thumb function. */ | ||
340 | #define STT_ARM_16BIT STT_HIPROC /* A Thumb label. */ | ||
341 | @@ -2363,12 +2366,19 @@ typedef Elf32_Addr Elf32_Conflict; | ||
342 | |||
343 | /* Processor specific values for the Phdr p_type field. */ | ||
344 | #define PT_ARM_EXIDX (PT_LOPROC + 1) /* ARM unwind segment. */ | ||
345 | +#define PT_ARM_UNWIND PT_ARM_EXIDX | ||
346 | |||
347 | /* Processor specific values for the Shdr sh_type field. */ | ||
348 | #define SHT_ARM_EXIDX (SHT_LOPROC + 1) /* ARM unwind section. */ | ||
349 | #define SHT_ARM_PREEMPTMAP (SHT_LOPROC + 2) /* Preemption details. */ | ||
350 | #define SHT_ARM_ATTRIBUTES (SHT_LOPROC + 3) /* ARM attributes section. */ | ||
351 | |||
352 | +/* Processor specific values for the Dyn d_tag field. */ | ||
353 | +#define DT_ARM_RESERVED1 (DT_LOPROC + 0) | ||
354 | +#define DT_ARM_SYMTABSZ (DT_LOPROC + 1) | ||
355 | +#define DT_ARM_PREEMTMAB (DT_LOPROC + 2) | ||
356 | +#define DT_ARM_RESERVED2 (DT_LOPROC + 3) | ||
357 | +#define DT_ARM_NUM 4 | ||
358 | |||
359 | /* AArch64 relocs. */ | ||
360 | |||
361 | @@ -2647,6 +2657,7 @@ typedef Elf32_Addr Elf32_Conflict; | ||
362 | TLS block (LDR, STR). */ | ||
363 | #define R_ARM_TLS_IE12GP 111 /* 12 bit GOT entry relative | ||
364 | to GOT origin (LDR). */ | ||
365 | +/* 112 - 127 private range */ | ||
366 | #define R_ARM_ME_TOO 128 /* Obsolete. */ | ||
367 | #define R_ARM_THM_TLS_DESCSEQ 129 | ||
368 | #define R_ARM_THM_TLS_DESCSEQ16 129 | ||
369 | diff --git a/tests/run-addrcfi.sh b/tests/run-addrcfi.sh | ||
370 | index 5d33246..78464a8 100755 | ||
371 | --- a/tests/run-addrcfi.sh | ||
372 | +++ b/tests/run-addrcfi.sh | ||
373 | @@ -2530,6 +2530,38 @@ dwarf_cfi_addrframe (.eh_frame): no matching address range | ||
374 | FPA reg21 (f5): undefined | ||
375 | FPA reg22 (f6): undefined | ||
376 | FPA reg23 (f7): undefined | ||
377 | + VFP reg64 (s0): undefined | ||
378 | + VFP reg65 (s1): undefined | ||
379 | + VFP reg66 (s2): undefined | ||
380 | + VFP reg67 (s3): undefined | ||
381 | + VFP reg68 (s4): undefined | ||
382 | + VFP reg69 (s5): undefined | ||
383 | + VFP reg70 (s6): undefined | ||
384 | + VFP reg71 (s7): undefined | ||
385 | + VFP reg72 (s8): undefined | ||
386 | + VFP reg73 (s9): undefined | ||
387 | + VFP reg74 (s10): undefined | ||
388 | + VFP reg75 (s11): undefined | ||
389 | + VFP reg76 (s12): undefined | ||
390 | + VFP reg77 (s13): undefined | ||
391 | + VFP reg78 (s14): undefined | ||
392 | + VFP reg79 (s15): undefined | ||
393 | + VFP reg80 (s16): undefined | ||
394 | + VFP reg81 (s17): undefined | ||
395 | + VFP reg82 (s18): undefined | ||
396 | + VFP reg83 (s19): undefined | ||
397 | + VFP reg84 (s20): undefined | ||
398 | + VFP reg85 (s21): undefined | ||
399 | + VFP reg86 (s22): undefined | ||
400 | + VFP reg87 (s23): undefined | ||
401 | + VFP reg88 (s24): undefined | ||
402 | + VFP reg89 (s25): undefined | ||
403 | + VFP reg90 (s26): undefined | ||
404 | + VFP reg91 (s27): undefined | ||
405 | + VFP reg92 (s28): undefined | ||
406 | + VFP reg93 (s29): undefined | ||
407 | + VFP reg94 (s30): undefined | ||
408 | + VFP reg95 (s31): undefined | ||
409 | FPA reg96 (f0): undefined | ||
410 | FPA reg97 (f1): undefined | ||
411 | FPA reg98 (f2): undefined | ||
412 | @@ -2538,7 +2570,66 @@ dwarf_cfi_addrframe (.eh_frame): no matching address range | ||
413 | FPA reg101 (f5): undefined | ||
414 | FPA reg102 (f6): undefined | ||
415 | FPA reg103 (f7): undefined | ||
416 | - integer reg128 (spsr): undefined | ||
417 | + MMX reg104 (wcgr0): undefined | ||
418 | + MMX reg105 (wcgr1): undefined | ||
419 | + MMX reg106 (wcgr2): undefined | ||
420 | + MMX reg107 (wcgr3): undefined | ||
421 | + MMX reg108 (wcgr4): undefined | ||
422 | + MMX reg109 (wcgr5): undefined | ||
423 | + MMX reg110 (wcgr6): undefined | ||
424 | + MMX reg111 (wcgr7): undefined | ||
425 | + MMX reg112 (wr0): undefined | ||
426 | + MMX reg113 (wr1): undefined | ||
427 | + MMX reg114 (wr2): undefined | ||
428 | + MMX reg115 (wr3): undefined | ||
429 | + MMX reg116 (wr4): undefined | ||
430 | + MMX reg117 (wr5): undefined | ||
431 | + MMX reg118 (wr6): undefined | ||
432 | + MMX reg119 (wr7): undefined | ||
433 | + MMX reg120 (wr8): undefined | ||
434 | + MMX reg121 (wr9): undefined | ||
435 | + MMX reg122 (wr10): undefined | ||
436 | + MMX reg123 (wr11): undefined | ||
437 | + MMX reg124 (wr12): undefined | ||
438 | + MMX reg125 (wr13): undefined | ||
439 | + MMX reg126 (wr14): undefined | ||
440 | + MMX reg127 (wr15): undefined | ||
441 | + state reg128 (spsr): undefined | ||
442 | + state reg129 (spsr_fiq): undefined | ||
443 | + state reg130 (spsr_irq): undefined | ||
444 | + state reg131 (spsr_abt): undefined | ||
445 | + state reg132 (spsr_und): undefined | ||
446 | + state reg133 (spsr_svc): undefined | ||
447 | + integer reg144 (r8_usr): undefined | ||
448 | + integer reg145 (r9_usr): undefined | ||
449 | + integer reg146 (r10_usr): undefined | ||
450 | + integer reg147 (r11_usr): undefined | ||
451 | + integer reg148 (r12_usr): undefined | ||
452 | + integer reg149 (r13_usr): undefined | ||
453 | + integer reg150 (r14_usr): undefined | ||
454 | + integer reg151 (r8_fiq): undefined | ||
455 | + integer reg152 (r9_fiq): undefined | ||
456 | + integer reg153 (r10_fiq): undefined | ||
457 | + integer reg154 (r11_fiq): undefined | ||
458 | + integer reg155 (r12_fiq): undefined | ||
459 | + integer reg156 (r13_fiq): undefined | ||
460 | + integer reg157 (r14_fiq): undefined | ||
461 | + integer reg158 (r13_irq): undefined | ||
462 | + integer reg159 (r14_irq): undefined | ||
463 | + integer reg160 (r13_abt): undefined | ||
464 | + integer reg161 (r14_abt): undefined | ||
465 | + integer reg162 (r13_und): undefined | ||
466 | + integer reg163 (r14_und): undefined | ||
467 | + integer reg164 (r13_svc): undefined | ||
468 | + integer reg165 (r14_svc): undefined | ||
469 | + MMX reg192 (wc0): undefined | ||
470 | + MMX reg193 (wc1): undefined | ||
471 | + MMX reg194 (wc2): undefined | ||
472 | + MMX reg195 (wc3): undefined | ||
473 | + MMX reg196 (wc4): undefined | ||
474 | + MMX reg197 (wc5): undefined | ||
475 | + MMX reg198 (wc6): undefined | ||
476 | + MMX reg199 (wc7): undefined | ||
477 | VFP reg256 (d0): undefined | ||
478 | VFP reg257 (d1): undefined | ||
479 | VFP reg258 (d2): undefined | ||
480 | diff --git a/tests/run-allregs.sh b/tests/run-allregs.sh | ||
481 | index 6f3862e..13557d5 100755 | ||
482 | --- a/tests/run-allregs.sh | ||
483 | +++ b/tests/run-allregs.sh | ||
484 | @@ -2671,7 +2671,28 @@ integer registers: | ||
485 | 13: sp (sp), address 32 bits | ||
486 | 14: lr (lr), address 32 bits | ||
487 | 15: pc (pc), address 32 bits | ||
488 | - 128: spsr (spsr), unsigned 32 bits | ||
489 | + 144: r8_usr (r8_usr), signed 32 bits | ||
490 | + 145: r9_usr (r9_usr), signed 32 bits | ||
491 | + 146: r10_usr (r10_usr), signed 32 bits | ||
492 | + 147: r11_usr (r11_usr), signed 32 bits | ||
493 | + 148: r12_usr (r12_usr), signed 32 bits | ||
494 | + 149: r13_usr (r13_usr), signed 32 bits | ||
495 | + 150: r14_usr (r14_usr), signed 32 bits | ||
496 | + 151: r8_fiq (r8_fiq), signed 32 bits | ||
497 | + 152: r9_fiq (r9_fiq), signed 32 bits | ||
498 | + 153: r10_fiq (r10_fiq), signed 32 bits | ||
499 | + 154: r11_fiq (r11_fiq), signed 32 bits | ||
500 | + 155: r12_fiq (r12_fiq), signed 32 bits | ||
501 | + 156: r13_fiq (r13_fiq), signed 32 bits | ||
502 | + 157: r14_fiq (r14_fiq), signed 32 bits | ||
503 | + 158: r13_irq (r13_irq), signed 32 bits | ||
504 | + 159: r14_irq (r14_irq), signed 32 bits | ||
505 | + 160: r13_abt (r13_abt), signed 32 bits | ||
506 | + 161: r14_abt (r14_abt), signed 32 bits | ||
507 | + 162: r13_und (r13_und), signed 32 bits | ||
508 | + 163: r14_und (r14_und), signed 32 bits | ||
509 | + 164: r13_svc (r13_svc), signed 32 bits | ||
510 | + 165: r14_svc (r14_svc), signed 32 bits | ||
511 | FPA registers: | ||
512 | 16: f0 (f0), float 96 bits | ||
513 | 17: f1 (f1), float 96 bits | ||
514 | @@ -2689,7 +2710,72 @@ FPA registers: | ||
515 | 101: f5 (f5), float 96 bits | ||
516 | 102: f6 (f6), float 96 bits | ||
517 | 103: f7 (f7), float 96 bits | ||
518 | +MMX registers: | ||
519 | + 104: wcgr0 (wcgr0), unsigned 32 bits | ||
520 | + 105: wcgr1 (wcgr1), unsigned 32 bits | ||
521 | + 106: wcgr2 (wcgr2), unsigned 32 bits | ||
522 | + 107: wcgr3 (wcgr3), unsigned 32 bits | ||
523 | + 108: wcgr4 (wcgr4), unsigned 32 bits | ||
524 | + 109: wcgr5 (wcgr5), unsigned 32 bits | ||
525 | + 110: wcgr6 (wcgr6), unsigned 32 bits | ||
526 | + 111: wcgr7 (wcgr7), unsigned 32 bits | ||
527 | + 112: wr0 (wr0), unsigned 64 bits | ||
528 | + 113: wr1 (wr1), unsigned 64 bits | ||
529 | + 114: wr2 (wr2), unsigned 64 bits | ||
530 | + 115: wr3 (wr3), unsigned 64 bits | ||
531 | + 116: wr4 (wr4), unsigned 64 bits | ||
532 | + 117: wr5 (wr5), unsigned 64 bits | ||
533 | + 118: wr6 (wr6), unsigned 64 bits | ||
534 | + 119: wr7 (wr7), unsigned 64 bits | ||
535 | + 120: wr8 (wr8), unsigned 64 bits | ||
536 | + 121: wr9 (wr9), unsigned 64 bits | ||
537 | + 122: wr10 (wr10), unsigned 64 bits | ||
538 | + 123: wr11 (wr11), unsigned 64 bits | ||
539 | + 124: wr12 (wr12), unsigned 64 bits | ||
540 | + 125: wr13 (wr13), unsigned 64 bits | ||
541 | + 126: wr14 (wr14), unsigned 64 bits | ||
542 | + 127: wr15 (wr15), unsigned 64 bits | ||
543 | + 192: wc0 (wc0), unsigned 32 bits | ||
544 | + 193: wc1 (wc1), unsigned 32 bits | ||
545 | + 194: wc2 (wc2), unsigned 32 bits | ||
546 | + 195: wc3 (wc3), unsigned 32 bits | ||
547 | + 196: wc4 (wc4), unsigned 32 bits | ||
548 | + 197: wc5 (wc5), unsigned 32 bits | ||
549 | + 198: wc6 (wc6), unsigned 32 bits | ||
550 | + 199: wc7 (wc7), unsigned 32 bits | ||
551 | VFP registers: | ||
552 | + 64: s0 (s0), float 32 bits | ||
553 | + 65: s1 (s1), float 32 bits | ||
554 | + 66: s2 (s2), float 32 bits | ||
555 | + 67: s3 (s3), float 32 bits | ||
556 | + 68: s4 (s4), float 32 bits | ||
557 | + 69: s5 (s5), float 32 bits | ||
558 | + 70: s6 (s6), float 32 bits | ||
559 | + 71: s7 (s7), float 32 bits | ||
560 | + 72: s8 (s8), float 32 bits | ||
561 | + 73: s9 (s9), float 32 bits | ||
562 | + 74: s10 (s10), float 32 bits | ||
563 | + 75: s11 (s11), float 32 bits | ||
564 | + 76: s12 (s12), float 32 bits | ||
565 | + 77: s13 (s13), float 32 bits | ||
566 | + 78: s14 (s14), float 32 bits | ||
567 | + 79: s15 (s15), float 32 bits | ||
568 | + 80: s16 (s16), float 32 bits | ||
569 | + 81: s17 (s17), float 32 bits | ||
570 | + 82: s18 (s18), float 32 bits | ||
571 | + 83: s19 (s19), float 32 bits | ||
572 | + 84: s20 (s20), float 32 bits | ||
573 | + 85: s21 (s21), float 32 bits | ||
574 | + 86: s22 (s22), float 32 bits | ||
575 | + 87: s23 (s23), float 32 bits | ||
576 | + 88: s24 (s24), float 32 bits | ||
577 | + 89: s25 (s25), float 32 bits | ||
578 | + 90: s26 (s26), float 32 bits | ||
579 | + 91: s27 (s27), float 32 bits | ||
580 | + 92: s28 (s28), float 32 bits | ||
581 | + 93: s29 (s29), float 32 bits | ||
582 | + 94: s30 (s30), float 32 bits | ||
583 | + 95: s31 (s31), float 32 bits | ||
584 | 256: d0 (d0), float 64 bits | ||
585 | 257: d1 (d1), float 64 bits | ||
586 | 258: d2 (d2), float 64 bits | ||
587 | @@ -2722,6 +2808,13 @@ VFP registers: | ||
588 | 285: d29 (d29), float 64 bits | ||
589 | 286: d30 (d30), float 64 bits | ||
590 | 287: d31 (d31), float 64 bits | ||
591 | +state registers: | ||
592 | + 128: spsr (spsr), unsigned 32 bits | ||
593 | + 129: spsr_fiq (spsr_fiq), unsigned 32 bits | ||
594 | + 130: spsr_irq (spsr_irq), unsigned 32 bits | ||
595 | + 131: spsr_abt (spsr_abt), unsigned 32 bits | ||
596 | + 132: spsr_und (spsr_und), unsigned 32 bits | ||
597 | + 133: spsr_svc (spsr_svc), unsigned 32 bits | ||
598 | EOF | ||
599 | |||
600 | # See run-readelf-mixed-corenote.sh for instructions to regenerate | ||
601 | diff --git a/tests/run-readelf-mixed-corenote.sh b/tests/run-readelf-mixed-corenote.sh | ||
602 | index 01e4594..9a8a380 100755 | ||
603 | --- a/tests/run-readelf-mixed-corenote.sh | ||
604 | +++ b/tests/run-readelf-mixed-corenote.sh | ||
605 | @@ -30,12 +30,11 @@ Note segment of 892 bytes at offset 0x274: | ||
606 | pid: 11087, ppid: 11063, pgrp: 11087, sid: 11063 | ||
607 | utime: 0.000000, stime: 0.010000, cutime: 0.000000, cstime: 0.000000 | ||
608 | orig_r0: -1, fpvalid: 1 | ||
609 | - r0: 1 r1: -1091672508 r2: -1091672500 | ||
610 | - r3: 0 r4: 0 r5: 0 | ||
611 | - r6: 33728 r7: 0 r8: 0 | ||
612 | - r9: 0 r10: -1225703496 r11: -1091672844 | ||
613 | - r12: 0 sp: 0xbeee64f4 lr: 0xb6dc3f48 | ||
614 | - pc: 0x00008500 spsr: 0x60000010 | ||
615 | + r0: 1 r1: -1091672508 r2: -1091672500 r3: 0 | ||
616 | + r4: 0 r5: 0 r6: 33728 r7: 0 | ||
617 | + r8: 0 r9: 0 r10: -1225703496 r11: -1091672844 | ||
618 | + r12: 0 sp: 0xbeee64f4 lr: 0xb6dc3f48 pc: 0x00008500 | ||
619 | + spsr: 0x60000010 | ||
620 | CORE 124 PRPSINFO | ||
621 | state: 0, sname: R, zomb: 0, nice: 0, flag: 0x00400500 | ||
622 | uid: 0, gid: 0, pid: 11087, ppid: 11063, pgrp: 11087, sid: 11063 | ||
623 | -- | ||
624 | 1.9.1 | ||
625 | |||
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/arm_func_value.patch b/meta/recipes-devtools/elfutils/elfutils-0.163/arm_func_value.patch new file mode 100644 index 0000000000..2fe4df68b7 --- /dev/null +++ b/meta/recipes-devtools/elfutils/elfutils-0.163/arm_func_value.patch | |||
@@ -0,0 +1,165 @@ | |||
1 | From: Mark Wielaard <mjw@redhat.com> | ||
2 | Date: Sun, 15 Jun 2014 11:30:35 +0200 | ||
3 | Subject: libebl: Add sym_func_value hook. | ||
4 | |||
5 | The ARM EABI says that the zero bit of function symbol st_value indicates | ||
6 | whether the symbol points to a THUMB or ARM function. Add a new ebl hook | ||
7 | to adjust the st_value in such a case so that we get the actual value that | ||
8 | the symbol points to. It isn't easily possible to reuse the existing | ||
9 | resolve_sym_value for this purpose, so we end up with another hook that | ||
10 | can be used from dwfl_module_getsym and elflint. | ||
11 | |||
12 | Rebase arm_func_value.patch from 0.159 to 0.160 | ||
13 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
14 | --- | ||
15 | backends/arm_init.c | 1 + | ||
16 | backends/arm_symbol.c | 8 ++++++++ | ||
17 | libdwfl/dwfl_module_getsym.c | 2 +- | ||
18 | libebl/Makefile.am | 3 ++- | ||
19 | libebl/ebl-hooks.h | 3 +++ | ||
20 | libebl/eblsymfuncval.c | 43 ++++++++++++++++++++++++++++++++++++++++++ | ||
21 | libebl/libebl.h | 11 +++++++++++ | ||
22 | 7 files changed, 69 insertions(+), 2 deletions(-) | ||
23 | |||
24 | diff --git a/backends/arm_init.c b/backends/arm_init.c | ||
25 | index 7171186..9f03630 100644 | ||
26 | --- a/backends/arm_init.c | ||
27 | +++ b/backends/arm_init.c | ||
28 | @@ -78,6 +78,7 @@ arm_init (elf, machine, eh, ehlen) | ||
29 | eh->return_value_location = arm_return_value_location_hard; | ||
30 | HOOK (eh, abi_cfi); | ||
31 | HOOK (eh, check_reloc_target_type); | ||
32 | + HOOK (eh, sym_func_value); | ||
33 | HOOK (eh, symbol_type_name); | ||
34 | |||
35 | /* We only unwind the core integer registers. */ | ||
36 | diff --git a/backends/arm_symbol.c b/backends/arm_symbol.c | ||
37 | index da4a50a..ccea03b 100644 | ||
38 | --- a/backends/arm_symbol.c | ||
39 | +++ b/backends/arm_symbol.c | ||
40 | @@ -130,6 +130,14 @@ arm_check_reloc_target_type (Ebl *ebl __attribute__ ((unused)), Elf64_Word sh_ty | ||
41 | return sh_type == SHT_ARM_EXIDX; | ||
42 | } | ||
43 | |||
44 | +/* ARM EABI says that the low bit indicates whether the function | ||
45 | + symbol value is a THUMB function or not. Mask it off. */ | ||
46 | +GElf_Addr | ||
47 | +arm_sym_func_value (Ebl *ebl __attribute__ ((unused)), GElf_Addr val) | ||
48 | +{ | ||
49 | + return val & ~(GElf_Addr)1; | ||
50 | +} | ||
51 | + | ||
52 | const char * | ||
53 | arm_symbol_type_name (int type, | ||
54 | char *buf __attribute__ ((unused)), | ||
55 | diff --git a/libdwfl/dwfl_module_getsym.c b/libdwfl/dwfl_module_getsym.c | ||
56 | index 42d2b67..fb192d7 100644 | ||
57 | --- a/libdwfl/dwfl_module_getsym.c | ||
58 | +++ b/libdwfl/dwfl_module_getsym.c | ||
59 | @@ -119,7 +119,7 @@ __libdwfl_getsym (Dwfl_Module *mod, int ndx, GElf_Sym *sym, GElf_Addr *addr, | ||
60 | descriptors). */ | ||
61 | |||
62 | char *ident; | ||
63 | - GElf_Addr st_value = sym->st_value & ebl_func_addr_mask (mod->ebl); | ||
64 | + GElf_Addr st_value = ebl_sym_func_value (mod->ebl, sym->st_value); | ||
65 | *resolved = false; | ||
66 | if (! adjust_st_value && mod->e_type != ET_REL && alloc | ||
67 | && (GELF_ST_TYPE (sym->st_info) == STT_FUNC | ||
68 | diff --git a/libebl/Makefile.am b/libebl/Makefile.am | ||
69 | index ec4477b..889c21b 100644 | ||
70 | --- a/libebl/Makefile.am | ||
71 | +++ b/libebl/Makefile.am | ||
72 | @@ -55,7 +55,8 @@ gen_SOURCES = eblopenbackend.c eblclosebackend.c eblstrtab.c \ | ||
73 | eblsysvhashentrysize.c eblauxvinfo.c eblcheckobjattr.c \ | ||
74 | ebl_check_special_section.c ebl_syscall_abi.c eblabicfi.c \ | ||
75 | eblstother.c eblinitreg.c ebldwarftoregno.c eblnormalizepc.c \ | ||
76 | - eblunwind.c eblresolvesym.c eblcheckreloctargettype.c | ||
77 | + eblunwind.c eblresolvesym.c eblcheckreloctargettype.c \ | ||
78 | + eblsymfuncval.c | ||
79 | |||
80 | libebl_a_SOURCES = $(gen_SOURCES) | ||
81 | |||
82 | diff --git a/libebl/ebl-hooks.h b/libebl/ebl-hooks.h | ||
83 | index 2e31446..9df945d 100644 | ||
84 | --- a/libebl/ebl-hooks.h | ||
85 | +++ b/libebl/ebl-hooks.h | ||
86 | @@ -191,5 +191,8 @@ bool EBLHOOK(unwind) (Ebl *ebl, Dwarf_Addr pc, ebl_tid_registers_t *setfunc, | ||
87 | (e.g. function descriptor resolving) */ | ||
88 | bool EBLHOOK(resolve_sym_value) (Ebl *ebl, GElf_Addr *addr); | ||
89 | |||
90 | +/* Returns the real value of a symbol function address or offset. */ | ||
91 | +GElf_Addr EBLHOOK(sym_func_value) (Ebl *ebl, GElf_Addr val); | ||
92 | + | ||
93 | /* Destructor for ELF backend handle. */ | ||
94 | void EBLHOOK(destr) (struct ebl *); | ||
95 | diff --git a/libebl/eblsymfuncval.c b/libebl/eblsymfuncval.c | ||
96 | new file mode 100644 | ||
97 | index 0000000..c0b322f | ||
98 | --- /dev/null | ||
99 | +++ b/libebl/eblsymfuncval.c | ||
100 | @@ -0,0 +1,43 @@ | ||
101 | +/* Turn a symbol function value into a real function address or offset. | ||
102 | + Copyright (C) 2014 Red Hat, Inc. | ||
103 | + This file is part of elfutils. | ||
104 | + | ||
105 | + This file is free software; you can redistribute it and/or modify | ||
106 | + it under the terms of either | ||
107 | + | ||
108 | + * the GNU Lesser General Public License as published by the Free | ||
109 | + Software Foundation; either version 3 of the License, or (at | ||
110 | + your option) any later version | ||
111 | + | ||
112 | + or | ||
113 | + | ||
114 | + * the GNU General Public License as published by the Free | ||
115 | + Software Foundation; either version 2 of the License, or (at | ||
116 | + your option) any later version | ||
117 | + | ||
118 | + or both in parallel, as here. | ||
119 | + | ||
120 | + elfutils is distributed in the hope that it will be useful, but | ||
121 | + WITHOUT ANY WARRANTY; without even the implied warranty of | ||
122 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
123 | + General Public License for more details. | ||
124 | + | ||
125 | + You should have received copies of the GNU General Public License and | ||
126 | + the GNU Lesser General Public License along with this program. If | ||
127 | + not, see <http://www.gnu.org/licenses/>. */ | ||
128 | + | ||
129 | +#ifdef HAVE_CONFIG_H | ||
130 | +# include <config.h> | ||
131 | +#endif | ||
132 | + | ||
133 | +#include <libeblP.h> | ||
134 | +#include <assert.h> | ||
135 | + | ||
136 | +GElf_Addr | ||
137 | +ebl_sym_func_value (Ebl *ebl, GElf_Addr val) | ||
138 | +{ | ||
139 | + if (ebl == NULL || ebl->sym_func_value == NULL) | ||
140 | + return val; | ||
141 | + | ||
142 | + return ebl->sym_func_value (ebl, val); | ||
143 | +} | ||
144 | diff --git a/libebl/libebl.h b/libebl/libebl.h | ||
145 | index 7dbf460..96c076b 100644 | ||
146 | --- a/libebl/libebl.h | ||
147 | +++ b/libebl/libebl.h | ||
148 | @@ -472,6 +472,17 @@ extern bool ebl_unwind (Ebl *ebl, Dwarf_Addr pc, ebl_tid_registers_t *setfunc, | ||
149 | extern bool ebl_resolve_sym_value (Ebl *ebl, GElf_Addr *addr) | ||
150 | __nonnull_attribute__ (2); | ||
151 | |||
152 | +/* Returns the real value of a symbol function address or offset | ||
153 | + (e.g. when the st_value contains some flag bits that need to be | ||
154 | + masked off). This is different from ebl_resolve_sym_value which | ||
155 | + only works for actual symbol addresses (in non-ET_REL files) that | ||
156 | + might resolve to an address in a different section. | ||
157 | + ebl_sym_func_value is called to turn the given value into the a | ||
158 | + real address or offset (the original value might not be a real | ||
159 | + address). This works for both ET_REL when the value is a section | ||
160 | + offset or ET_EXEC or ET_DYN symbol values, which are addresses. */ | ||
161 | +extern GElf_Addr ebl_sym_func_value (Ebl *ebl, GElf_Addr val); | ||
162 | + | ||
163 | #ifdef __cplusplus | ||
164 | } | ||
165 | #endif | ||
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/arm_unwind_ret_mask.patch b/meta/recipes-devtools/elfutils/elfutils-0.163/arm_unwind_ret_mask.patch new file mode 100644 index 0000000000..8abb36bb49 --- /dev/null +++ b/meta/recipes-devtools/elfutils/elfutils-0.163/arm_unwind_ret_mask.patch | |||
@@ -0,0 +1,83 @@ | |||
1 | From: Mark Wielaard <mjw@redhat.com> | ||
2 | Date: Sun, 15 Jun 2014 12:30:02 +0200 | ||
3 | Subject: libebl: Add ebl_unwind_ret_mask. | ||
4 | |||
5 | Another ARM oddity. A return value address in an unwind will contain an | ||
6 | extra bit to indicate whether to return to a regular ARM or THUMB function. | ||
7 | Add a new ebl function to return a mask to use to get the actual return | ||
8 | address during an unwind ebl_unwind_ret_mask. | ||
9 | |||
10 | Rebase arm_unwind_ret_mask.patch from 0.159 to 0.160 | ||
11 | |||
12 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
13 | --- | ||
14 | backends/arm_init.c | 3 +++ | ||
15 | libebl/eblinitreg.c | 8 ++++++++ | ||
16 | libebl/libebl.h | 4 ++++ | ||
17 | libebl/libeblP.h | 6 ++++++ | ||
18 | 4 files changed, 21 insertions(+) | ||
19 | |||
20 | diff --git a/backends/arm_init.c b/backends/arm_init.c | ||
21 | index 2266829..f8df042 100644 | ||
22 | --- a/backends/arm_init.c | ||
23 | +++ b/backends/arm_init.c | ||
24 | @@ -87,5 +87,8 @@ arm_init (elf, machine, eh, ehlen) | ||
25 | /* Bit zero encodes whether an function address is THUMB or ARM. */ | ||
26 | eh->func_addr_mask = ~(GElf_Addr)1; | ||
27 | |||
28 | + /* Bit zero encodes whether to return to a THUMB or ARM function. */ | ||
29 | + eh->unwind_ret_mask = ~(GElf_Addr)1; | ||
30 | + | ||
31 | return MODVERSION; | ||
32 | } | ||
33 | diff --git a/libebl/eblinitreg.c b/libebl/eblinitreg.c | ||
34 | index 5729b3c..ca681c0 100644 | ||
35 | --- a/libebl/eblinitreg.c | ||
36 | +++ b/libebl/eblinitreg.c | ||
37 | @@ -56,3 +56,11 @@ ebl_func_addr_mask (Ebl *ebl) | ||
38 | return ((ebl == NULL || ebl->func_addr_mask == 0) | ||
39 | ? ~(GElf_Addr)0 : ebl->func_addr_mask); | ||
40 | } | ||
41 | + | ||
42 | +GElf_Addr | ||
43 | +ebl_unwind_ret_mask (Ebl *ebl) | ||
44 | +{ | ||
45 | + return ((ebl == NULL || ebl->unwind_ret_mask == 0) | ||
46 | + ? ~(GElf_Addr)0 : ebl->unwind_ret_mask); | ||
47 | +} | ||
48 | + | ||
49 | diff --git a/libebl/libebl.h b/libebl/libebl.h | ||
50 | index 40cf635..be70027 100644 | ||
51 | --- a/libebl/libebl.h | ||
52 | +++ b/libebl/libebl.h | ||
53 | @@ -420,6 +420,10 @@ extern size_t ebl_frame_nregs (Ebl *ebl) | ||
54 | tables) is needed. */ | ||
55 | extern GElf_Addr ebl_func_addr_mask (Ebl *ebl); | ||
56 | |||
57 | +/* Mask to use for unwind return address in case the architecture adds | ||
58 | + some extra non-address bits to it. */ | ||
59 | +extern GElf_Addr ebl_unwind_ret_mask (Ebl *ebl); | ||
60 | + | ||
61 | /* Convert *REGNO as is in DWARF to a lower range suitable for | ||
62 | Dwarf_Frame->REGS indexing. */ | ||
63 | extern bool ebl_dwarf_to_regno (Ebl *ebl, unsigned *regno) | ||
64 | diff --git a/libebl/libeblP.h b/libebl/libeblP.h | ||
65 | index dbd67f3..e18ace6 100644 | ||
66 | --- a/libebl/libeblP.h | ||
67 | +++ b/libebl/libeblP.h | ||
68 | @@ -70,6 +70,12 @@ struct ebl | ||
69 | otherwise it should be the actual mask to use. */ | ||
70 | GElf_Addr func_addr_mask; | ||
71 | |||
72 | + /* Mask to use to get the return address from an unwind in case the | ||
73 | + architecture adds some extra non-address bits to it. When not | ||
74 | + initialized (0) then ebl_unwind_ret_mask will return ~0, otherwise | ||
75 | + it should be the actual mask to use. */ | ||
76 | + GElf_Addr unwind_ret_mask; | ||
77 | + | ||
78 | /* Function descriptor load address and table as used by | ||
79 | ebl_resolve_sym_value if available for this arch. */ | ||
80 | GElf_Addr fd_addr; | ||
81 | -- | ||
82 | 1.9.1 | ||
83 | |||
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/fixheadercheck.patch b/meta/recipes-devtools/elfutils/elfutils-0.163/fixheadercheck.patch new file mode 100644 index 0000000000..5de3b24c85 --- /dev/null +++ b/meta/recipes-devtools/elfutils/elfutils-0.163/fixheadercheck.patch | |||
@@ -0,0 +1,23 @@ | |||
1 | For some binaries we can get a invalid section alignment, for example if | ||
2 | sh_align = 1 and sh_addralign is 0. In the case of a zero size section like | ||
3 | ".note.GNU-stack", this is irrelavent as far as I can tell and we shouldn't | ||
4 | error in this case. | ||
5 | |||
6 | RP 2014/6/11 | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | |||
10 | diff --git a/libelf/elf32_updatenull.c b/libelf/elf32_updatenull.c | ||
11 | --- a/libelf/elf32_updatenull.c | ||
12 | +++ b/libelf/elf32_updatenull.c | ||
13 | @@ -339,8 +339,8 @@ __elfw2(LIBELFBITS,updatenull_wrlock) (Elf *elf, int *change_bop, size_t shnum) | ||
14 | we test for the alignment of the section being large | ||
15 | enough for the largest alignment required by a data | ||
16 | block. */ | ||
17 | - if (unlikely (! powerof2 (shdr->sh_addralign)) | ||
18 | - || unlikely ((shdr->sh_addralign ?: 1) < sh_align)) | ||
19 | + if (shdr->sh_size && (unlikely (! powerof2 (shdr->sh_addralign)) | ||
20 | + || unlikely ((shdr->sh_addralign ?: 1) < sh_align))) | ||
21 | { | ||
22 | __libelf_seterrno (ELF_E_INVALID_ALIGN); | ||
23 | return -1; | ||
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/hppa_backend.diff b/meta/recipes-devtools/elfutils/elfutils-0.163/hppa_backend.diff new file mode 100644 index 0000000000..d51a720073 --- /dev/null +++ b/meta/recipes-devtools/elfutils/elfutils-0.163/hppa_backend.diff | |||
@@ -0,0 +1,800 @@ | |||
1 | Index: elfutils-0.158/backends/parisc_init.c | ||
2 | =================================================================== | ||
3 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
4 | +++ elfutils-0.158/backends/parisc_init.c 2014-04-21 11:12:12.228150280 +0000 | ||
5 | @@ -0,0 +1,74 @@ | ||
6 | +/* Initialization of PA-RISC specific backend library. | ||
7 | + Copyright (C) 2002, 2005, 2006 Red Hat, Inc. | ||
8 | + This file is part of Red Hat elfutils. | ||
9 | + Written by Ulrich Drepper <drepper@redhat.com>, 2002. | ||
10 | + | ||
11 | + Red Hat elfutils is free software; you can redistribute it and/or modify | ||
12 | + it under the terms of the GNU General Public License as published by the | ||
13 | + Free Software Foundation; version 2 of the License. | ||
14 | + | ||
15 | + Red Hat elfutils is distributed in the hope that it will be useful, but | ||
16 | + WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
18 | + General Public License for more details. | ||
19 | + | ||
20 | + You should have received a copy of the GNU General Public License along | ||
21 | + with Red Hat elfutils; if not, write to the Free Software Foundation, | ||
22 | + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. | ||
23 | + | ||
24 | + Red Hat elfutils is an included package of the Open Invention Network. | ||
25 | + An included package of the Open Invention Network is a package for which | ||
26 | + Open Invention Network licensees cross-license their patents. No patent | ||
27 | + license is granted, either expressly or impliedly, by designation as an | ||
28 | + included package. Should you wish to participate in the Open Invention | ||
29 | + Network licensing program, please visit www.openinventionnetwork.com | ||
30 | + <http://www.openinventionnetwork.com>. */ | ||
31 | + | ||
32 | +#ifdef HAVE_CONFIG_H | ||
33 | +# include <config.h> | ||
34 | +#endif | ||
35 | + | ||
36 | +#define BACKEND parisc_ | ||
37 | +#define RELOC_PREFIX R_PARISC_ | ||
38 | +#include "libebl_CPU.h" | ||
39 | +#include "libebl_parisc.h" | ||
40 | + | ||
41 | +/* This defines the common reloc hooks based on parisc_reloc.def. */ | ||
42 | +#include "common-reloc.c" | ||
43 | + | ||
44 | + | ||
45 | +const char * | ||
46 | +parisc_init (elf, machine, eh, ehlen) | ||
47 | + Elf *elf __attribute__ ((unused)); | ||
48 | + GElf_Half machine __attribute__ ((unused)); | ||
49 | + Ebl *eh; | ||
50 | + size_t ehlen; | ||
51 | +{ | ||
52 | + int pa64 = 0; | ||
53 | + | ||
54 | + /* Check whether the Elf_BH object has a sufficent size. */ | ||
55 | + if (ehlen < sizeof (Ebl)) | ||
56 | + return NULL; | ||
57 | + | ||
58 | + if (elf) { | ||
59 | + GElf_Ehdr ehdr_mem; | ||
60 | + GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem); | ||
61 | + if (ehdr && (ehdr->e_flags & EF_PARISC_WIDE)) | ||
62 | + pa64 = 1; | ||
63 | + } | ||
64 | + /* We handle it. */ | ||
65 | + eh->name = "PA-RISC"; | ||
66 | + parisc_init_reloc (eh); | ||
67 | + HOOK (eh, reloc_simple_type); | ||
68 | + HOOK (eh, machine_flag_check); | ||
69 | + HOOK (eh, symbol_type_name); | ||
70 | + HOOK (eh, segment_type_name); | ||
71 | + HOOK (eh, section_type_name); | ||
72 | + HOOK (eh, register_info); | ||
73 | + if (pa64) | ||
74 | + eh->return_value_location = parisc_return_value_location_64; | ||
75 | + else | ||
76 | + eh->return_value_location = parisc_return_value_location_32; | ||
77 | + | ||
78 | + return MODVERSION; | ||
79 | +} | ||
80 | Index: elfutils-0.158/backends/parisc_regs.c | ||
81 | =================================================================== | ||
82 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
83 | +++ elfutils-0.158/backends/parisc_regs.c 2014-04-21 11:12:12.228150280 +0000 | ||
84 | @@ -0,0 +1,159 @@ | ||
85 | +/* Register names and numbers for PA-RISC DWARF. | ||
86 | + Copyright (C) 2005, 2006 Red Hat, Inc. | ||
87 | + This file is part of Red Hat elfutils. | ||
88 | + | ||
89 | + Red Hat elfutils is free software; you can redistribute it and/or modify | ||
90 | + it under the terms of the GNU General Public License as published by the | ||
91 | + Free Software Foundation; version 2 of the License. | ||
92 | + | ||
93 | + Red Hat elfutils is distributed in the hope that it will be useful, but | ||
94 | + WITHOUT ANY WARRANTY; without even the implied warranty of | ||
95 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
96 | + General Public License for more details. | ||
97 | + | ||
98 | + You should have received a copy of the GNU General Public License along | ||
99 | + with Red Hat elfutils; if not, write to the Free Software Foundation, | ||
100 | + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. | ||
101 | + | ||
102 | + Red Hat elfutils is an included package of the Open Invention Network. | ||
103 | + An included package of the Open Invention Network is a package for which | ||
104 | + Open Invention Network licensees cross-license their patents. No patent | ||
105 | + license is granted, either expressly or impliedly, by designation as an | ||
106 | + included package. Should you wish to participate in the Open Invention | ||
107 | + Network licensing program, please visit www.openinventionnetwork.com | ||
108 | + <http://www.openinventionnetwork.com>. */ | ||
109 | + | ||
110 | +#ifdef HAVE_CONFIG_H | ||
111 | +# include <config.h> | ||
112 | +#endif | ||
113 | + | ||
114 | +#include <string.h> | ||
115 | +#include <dwarf.h> | ||
116 | + | ||
117 | +#define BACKEND parisc_ | ||
118 | +#include "libebl_CPU.h" | ||
119 | + | ||
120 | +ssize_t | ||
121 | +parisc_register_info (Ebl *ebl, int regno, char *name, size_t namelen, | ||
122 | + const char **prefix, const char **setname, | ||
123 | + int *bits, int *type) | ||
124 | +{ | ||
125 | + int pa64 = 0; | ||
126 | + | ||
127 | + if (ebl->elf) { | ||
128 | + GElf_Ehdr ehdr_mem; | ||
129 | + GElf_Ehdr *ehdr = gelf_getehdr (ebl->elf, &ehdr_mem); | ||
130 | + if (ehdr->e_flags & EF_PARISC_WIDE) | ||
131 | + pa64 = 1; | ||
132 | + } | ||
133 | + | ||
134 | + int nregs = pa64 ? 127 : 128; | ||
135 | + | ||
136 | + if (name == NULL) | ||
137 | + return nregs; | ||
138 | + | ||
139 | + if (regno < 0 || regno >= nregs || namelen < 6) | ||
140 | + return -1; | ||
141 | + | ||
142 | + *prefix = "%"; | ||
143 | + | ||
144 | + if (regno < 32) | ||
145 | + { | ||
146 | + *setname = "integer"; | ||
147 | + *type = DW_ATE_signed; | ||
148 | + if (pa64) | ||
149 | + { | ||
150 | + *bits = 64; | ||
151 | + } | ||
152 | + else | ||
153 | + { | ||
154 | + *bits = 32; | ||
155 | + } | ||
156 | + } | ||
157 | + else if (regno == 32) | ||
158 | + { | ||
159 | + *setname = "special"; | ||
160 | + if (pa64) | ||
161 | + { | ||
162 | + *bits = 6; | ||
163 | + } | ||
164 | + else | ||
165 | + { | ||
166 | + *bits = 5; | ||
167 | + } | ||
168 | + *type = DW_ATE_unsigned; | ||
169 | + } | ||
170 | + else | ||
171 | + { | ||
172 | + *setname = "FPU"; | ||
173 | + *type = DW_ATE_float; | ||
174 | + if (pa64) | ||
175 | + { | ||
176 | + *bits = 64; | ||
177 | + } | ||
178 | + else | ||
179 | + { | ||
180 | + *bits = 32; | ||
181 | + } | ||
182 | + } | ||
183 | + | ||
184 | + if (regno < 33) { | ||
185 | + switch (regno) | ||
186 | + { | ||
187 | + case 0 ... 9: | ||
188 | + name[0] = 'r'; | ||
189 | + name[1] = regno + '0'; | ||
190 | + namelen = 2; | ||
191 | + break; | ||
192 | + case 10 ... 31: | ||
193 | + name[0] = 'r'; | ||
194 | + name[1] = regno / 10 + '0'; | ||
195 | + name[2] = regno % 10 + '0'; | ||
196 | + namelen = 3; | ||
197 | + break; | ||
198 | + case 32: | ||
199 | + *prefix = NULL; | ||
200 | + name[0] = 'S'; | ||
201 | + name[1] = 'A'; | ||
202 | + name[2] = 'R'; | ||
203 | + namelen = 3; | ||
204 | + break; | ||
205 | + } | ||
206 | + } | ||
207 | + else { | ||
208 | + if (pa64 && ((regno - 72) % 2)) { | ||
209 | + *setname = NULL; | ||
210 | + return 0; | ||
211 | + } | ||
212 | + | ||
213 | + switch (regno) | ||
214 | + { | ||
215 | + case 72 + 0 ... 72 + 11: | ||
216 | + name[0] = 'f'; | ||
217 | + name[1] = 'r'; | ||
218 | + name[2] = (regno + 8 - 72) / 2 + '0'; | ||
219 | + namelen = 3; | ||
220 | + if ((regno + 8 - 72) % 2) { | ||
221 | + name[3] = 'R'; | ||
222 | + namelen++; | ||
223 | + } | ||
224 | + break; | ||
225 | + case 72 + 12 ... 72 + 55: | ||
226 | + name[0] = 'f'; | ||
227 | + name[1] = 'r'; | ||
228 | + name[2] = (regno + 8 - 72) / 2 / 10 + '0'; | ||
229 | + name[3] = (regno + 8 - 72) / 2 % 10 + '0'; | ||
230 | + namelen = 4; | ||
231 | + if ((regno + 8 - 72) % 2) { | ||
232 | + name[4] = 'R'; | ||
233 | + namelen++; | ||
234 | + } | ||
235 | + break; | ||
236 | + default: | ||
237 | + *setname = NULL; | ||
238 | + return 0; | ||
239 | + } | ||
240 | + } | ||
241 | + name[namelen++] = '\0'; | ||
242 | + return namelen; | ||
243 | +} | ||
244 | Index: elfutils-0.158/backends/parisc_reloc.def | ||
245 | =================================================================== | ||
246 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
247 | +++ elfutils-0.158/backends/parisc_reloc.def 2014-04-21 11:12:12.228150280 +0000 | ||
248 | @@ -0,0 +1,128 @@ | ||
249 | +/* List the relocation types for PA-RISC. -*- C -*- | ||
250 | + Copyright (C) 2005 Red Hat, Inc. | ||
251 | + This file is part of Red Hat elfutils. | ||
252 | + | ||
253 | + Red Hat elfutils is free software; you can redistribute it and/or modify | ||
254 | + it under the terms of the GNU General Public License as published by the | ||
255 | + Free Software Foundation; version 2 of the License. | ||
256 | + | ||
257 | + Red Hat elfutils is distributed in the hope that it will be useful, but | ||
258 | + WITHOUT ANY WARRANTY; without even the implied warranty of | ||
259 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
260 | + General Public License for more details. | ||
261 | + | ||
262 | + You should have received a copy of the GNU General Public License along | ||
263 | + with Red Hat elfutils; if not, write to the Free Software Foundation, | ||
264 | + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. | ||
265 | + | ||
266 | + Red Hat elfutils is an included package of the Open Invention Network. | ||
267 | + An included package of the Open Invention Network is a package for which | ||
268 | + Open Invention Network licensees cross-license their patents. No patent | ||
269 | + license is granted, either expressly or impliedly, by designation as an | ||
270 | + included package. Should you wish to participate in the Open Invention | ||
271 | + Network licensing program, please visit www.openinventionnetwork.com | ||
272 | + <http://www.openinventionnetwork.com>. */ | ||
273 | + | ||
274 | +/* NAME, REL|EXEC|DYN */ | ||
275 | + | ||
276 | +RELOC_TYPE (NONE, EXEC|DYN) | ||
277 | +RELOC_TYPE (DIR32, REL|EXEC|DYN) | ||
278 | +RELOC_TYPE (DIR21L, REL|EXEC|DYN) | ||
279 | +RELOC_TYPE (DIR17R, REL) | ||
280 | +RELOC_TYPE (DIR17F, REL) | ||
281 | +RELOC_TYPE (DIR14R, REL|DYN) | ||
282 | +RELOC_TYPE (PCREL32, REL) | ||
283 | +RELOC_TYPE (PCREL21L, REL) | ||
284 | +RELOC_TYPE (PCREL17R, REL) | ||
285 | +RELOC_TYPE (PCREL17F, REL) | ||
286 | +RELOC_TYPE (PCREL14R, REL|EXEC) | ||
287 | +RELOC_TYPE (DPREL21L, REL) | ||
288 | +RELOC_TYPE (DPREL14WR, REL) | ||
289 | +RELOC_TYPE (DPREL14DR, REL) | ||
290 | +RELOC_TYPE (DPREL14R, REL) | ||
291 | +RELOC_TYPE (GPREL21L, 0) | ||
292 | +RELOC_TYPE (GPREL14R, 0) | ||
293 | +RELOC_TYPE (LTOFF21L, REL) | ||
294 | +RELOC_TYPE (LTOFF14R, REL) | ||
295 | +RELOC_TYPE (DLTIND14F, 0) | ||
296 | +RELOC_TYPE (SETBASE, 0) | ||
297 | +RELOC_TYPE (SECREL32, REL) | ||
298 | +RELOC_TYPE (BASEREL21L, 0) | ||
299 | +RELOC_TYPE (BASEREL17R, 0) | ||
300 | +RELOC_TYPE (BASEREL14R, 0) | ||
301 | +RELOC_TYPE (SEGBASE, 0) | ||
302 | +RELOC_TYPE (SEGREL32, REL) | ||
303 | +RELOC_TYPE (PLTOFF21L, 0) | ||
304 | +RELOC_TYPE (PLTOFF14R, 0) | ||
305 | +RELOC_TYPE (PLTOFF14F, 0) | ||
306 | +RELOC_TYPE (LTOFF_FPTR32, 0) | ||
307 | +RELOC_TYPE (LTOFF_FPTR21L, 0) | ||
308 | +RELOC_TYPE (LTOFF_FPTR14R, 0) | ||
309 | +RELOC_TYPE (FPTR64, 0) | ||
310 | +RELOC_TYPE (PLABEL32, REL|DYN) | ||
311 | +RELOC_TYPE (PCREL64, 0) | ||
312 | +RELOC_TYPE (PCREL22C, 0) | ||
313 | +RELOC_TYPE (PCREL22F, 0) | ||
314 | +RELOC_TYPE (PCREL14WR, 0) | ||
315 | +RELOC_TYPE (PCREL14DR, 0) | ||
316 | +RELOC_TYPE (PCREL16F, 0) | ||
317 | +RELOC_TYPE (PCREL16WF, 0) | ||
318 | +RELOC_TYPE (PCREL16DF, 0) | ||
319 | +RELOC_TYPE (DIR64, REL|DYN) | ||
320 | +RELOC_TYPE (DIR14WR, REL) | ||
321 | +RELOC_TYPE (DIR14DR, REL) | ||
322 | +RELOC_TYPE (DIR16F, REL) | ||
323 | +RELOC_TYPE (DIR16WF, REL) | ||
324 | +RELOC_TYPE (DIR16DF, REL) | ||
325 | +RELOC_TYPE (GPREL64, 0) | ||
326 | +RELOC_TYPE (GPREL14WR, 0) | ||
327 | +RELOC_TYPE (GPREL14DR, 0) | ||
328 | +RELOC_TYPE (GPREL16F, 0) | ||
329 | +RELOC_TYPE (GPREL16WF, 0) | ||
330 | +RELOC_TYPE (GPREL16DF, 0) | ||
331 | +RELOC_TYPE (LTOFF64, 0) | ||
332 | +RELOC_TYPE (LTOFF14WR, 0) | ||
333 | +RELOC_TYPE (LTOFF14DR, 0) | ||
334 | +RELOC_TYPE (LTOFF16F, 0) | ||
335 | +RELOC_TYPE (LTOFF16WF, 0) | ||
336 | +RELOC_TYPE (LTOFF16DF, 0) | ||
337 | +RELOC_TYPE (SECREL64, 0) | ||
338 | +RELOC_TYPE (BASEREL14WR, 0) | ||
339 | +RELOC_TYPE (BASEREL14DR, 0) | ||
340 | +RELOC_TYPE (SEGREL64, 0) | ||
341 | +RELOC_TYPE (PLTOFF14WR, 0) | ||
342 | +RELOC_TYPE (PLTOFF14DR, 0) | ||
343 | +RELOC_TYPE (PLTOFF16F, 0) | ||
344 | +RELOC_TYPE (PLTOFF16WF, 0) | ||
345 | +RELOC_TYPE (PLTOFF16DF, 0) | ||
346 | +RELOC_TYPE (LTOFF_FPTR64, 0) | ||
347 | +RELOC_TYPE (LTOFF_FPTR14WR, 0) | ||
348 | +RELOC_TYPE (LTOFF_FPTR14DR, 0) | ||
349 | +RELOC_TYPE (LTOFF_FPTR16F, 0) | ||
350 | +RELOC_TYPE (LTOFF_FPTR16WF, 0) | ||
351 | +RELOC_TYPE (LTOFF_FPTR16DF, 0) | ||
352 | +RELOC_TYPE (COPY, EXEC) | ||
353 | +RELOC_TYPE (IPLT, EXEC|DYN) | ||
354 | +RELOC_TYPE (EPLT, 0) | ||
355 | +RELOC_TYPE (TPREL32, DYN) | ||
356 | +RELOC_TYPE (TPREL21L, 0) | ||
357 | +RELOC_TYPE (TPREL14R, 0) | ||
358 | +RELOC_TYPE (LTOFF_TP21L, 0) | ||
359 | +RELOC_TYPE (LTOFF_TP14R, 0) | ||
360 | +RELOC_TYPE (LTOFF_TP14F, 0) | ||
361 | +RELOC_TYPE (TPREL64, 0) | ||
362 | +RELOC_TYPE (TPREL14WR, 0) | ||
363 | +RELOC_TYPE (TPREL14DR, 0) | ||
364 | +RELOC_TYPE (TPREL16F, 0) | ||
365 | +RELOC_TYPE (TPREL16WF, 0) | ||
366 | +RELOC_TYPE (TPREL16DF, 0) | ||
367 | +RELOC_TYPE (LTOFF_TP64, 0) | ||
368 | +RELOC_TYPE (LTOFF_TP14WR, 0) | ||
369 | +RELOC_TYPE (LTOFF_TP14DR, 0) | ||
370 | +RELOC_TYPE (LTOFF_TP16F, 0) | ||
371 | +RELOC_TYPE (LTOFF_TP16WF, 0) | ||
372 | +RELOC_TYPE (LTOFF_TP16DF, 0) | ||
373 | +RELOC_TYPE (TLS_DTPMOD32, DYN) | ||
374 | +RELOC_TYPE (TLS_DTPMOD64, DYN) | ||
375 | + | ||
376 | +#define NO_RELATIVE_RELOC 1 | ||
377 | Index: elfutils-0.158/backends/parisc_retval.c | ||
378 | =================================================================== | ||
379 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
380 | +++ elfutils-0.158/backends/parisc_retval.c 2014-04-21 11:12:12.228150280 +0000 | ||
381 | @@ -0,0 +1,213 @@ | ||
382 | +/* Function return value location for Linux/PA-RISC ABI. | ||
383 | + Copyright (C) 2005 Red Hat, Inc. | ||
384 | + This file is part of Red Hat elfutils. | ||
385 | + | ||
386 | + Red Hat elfutils is free software; you can redistribute it and/or modify | ||
387 | + it under the terms of the GNU General Public License as published by the | ||
388 | + Free Software Foundation; version 2 of the License. | ||
389 | + | ||
390 | + Red Hat elfutils is distributed in the hope that it will be useful, but | ||
391 | + WITHOUT ANY WARRANTY; without even the implied warranty of | ||
392 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
393 | + General Public License for more details. | ||
394 | + | ||
395 | + You should have received a copy of the GNU General Public License along | ||
396 | + with Red Hat elfutils; if not, write to the Free Software Foundation, | ||
397 | + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. | ||
398 | + | ||
399 | + Red Hat elfutils is an included package of the Open Invention Network. | ||
400 | + An included package of the Open Invention Network is a package for which | ||
401 | + Open Invention Network licensees cross-license their patents. No patent | ||
402 | + license is granted, either expressly or impliedly, by designation as an | ||
403 | + included package. Should you wish to participate in the Open Invention | ||
404 | + Network licensing program, please visit www.openinventionnetwork.com | ||
405 | + <http://www.openinventionnetwork.com>. */ | ||
406 | + | ||
407 | +#ifdef HAVE_CONFIG_H | ||
408 | +# include <config.h> | ||
409 | +#endif | ||
410 | + | ||
411 | +#include <assert.h> | ||
412 | +#include <dwarf.h> | ||
413 | + | ||
414 | +#define BACKEND parisc_ | ||
415 | +#include "libebl_CPU.h" | ||
416 | +#include "libebl_parisc.h" | ||
417 | + | ||
418 | +/* %r28, or pair %r28, %r29. */ | ||
419 | +static const Dwarf_Op loc_intreg32[] = | ||
420 | + { | ||
421 | + { .atom = DW_OP_reg28 }, { .atom = DW_OP_piece, .number = 4 }, | ||
422 | + { .atom = DW_OP_reg29 }, { .atom = DW_OP_piece, .number = 4 }, | ||
423 | + }; | ||
424 | + | ||
425 | +static const Dwarf_Op loc_intreg[] = | ||
426 | + { | ||
427 | + { .atom = DW_OP_reg28 }, { .atom = DW_OP_piece, .number = 8 }, | ||
428 | + { .atom = DW_OP_reg29 }, { .atom = DW_OP_piece, .number = 8 }, | ||
429 | + }; | ||
430 | +#define nloc_intreg 1 | ||
431 | +#define nloc_intregpair 4 | ||
432 | + | ||
433 | +/* %fr4L, or pair %fr4L, %fr4R on pa-32 */ | ||
434 | +static const Dwarf_Op loc_fpreg32[] = | ||
435 | + { | ||
436 | + { .atom = DW_OP_regx, .number = 72 }, { .atom = DW_OP_piece, .number = 4 }, | ||
437 | + { .atom = DW_OP_regx, .number = 73 }, { .atom = DW_OP_piece, .number = 4 }, | ||
438 | + }; | ||
439 | +#define nloc_fpreg32 2 | ||
440 | +#define nloc_fpregpair32 4 | ||
441 | + | ||
442 | +/* $fr4 */ | ||
443 | +static const Dwarf_Op loc_fpreg[] = | ||
444 | + { | ||
445 | + { .atom = DW_OP_regx, .number = 72 }, | ||
446 | + }; | ||
447 | +#define nloc_fpreg 1 | ||
448 | + | ||
449 | +#if 0 | ||
450 | +/* The return value is a structure and is actually stored in stack space | ||
451 | + passed in a hidden argument by the caller. Address of the location is stored | ||
452 | + in %r28 before function call, but it may be changed by function. */ | ||
453 | +static const Dwarf_Op loc_aggregate[] = | ||
454 | + { | ||
455 | + { .atom = DW_OP_breg28 }, | ||
456 | + }; | ||
457 | +#define nloc_aggregate 1 | ||
458 | +#endif | ||
459 | + | ||
460 | +static int | ||
461 | +parisc_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp, int pa64) | ||
462 | +{ | ||
463 | + Dwarf_Word regsize = pa64 ? 8 : 4; | ||
464 | + | ||
465 | + /* Start with the function's type, and get the DW_AT_type attribute, | ||
466 | + which is the type of the return value. */ | ||
467 | + | ||
468 | + Dwarf_Attribute attr_mem; | ||
469 | + Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, &attr_mem); | ||
470 | + if (attr == NULL) | ||
471 | + /* The function has no return value, like a `void' function in C. */ | ||
472 | + return 0; | ||
473 | + | ||
474 | + Dwarf_Die die_mem; | ||
475 | + Dwarf_Die *typedie = dwarf_formref_die (attr, &die_mem); | ||
476 | + int tag = dwarf_tag (typedie); | ||
477 | + | ||
478 | + /* Follow typedefs and qualifiers to get to the actual type. */ | ||
479 | + while (tag == DW_TAG_typedef | ||
480 | + || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type | ||
481 | + || tag == DW_TAG_restrict_type) | ||
482 | + { | ||
483 | + attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); | ||
484 | + typedie = dwarf_formref_die (attr, &die_mem); | ||
485 | + tag = dwarf_tag (typedie); | ||
486 | + } | ||
487 | + | ||
488 | + switch (tag) | ||
489 | + { | ||
490 | + case -1: | ||
491 | + return -1; | ||
492 | + | ||
493 | + case DW_TAG_subrange_type: | ||
494 | + if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size)) | ||
495 | + { | ||
496 | + attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); | ||
497 | + typedie = dwarf_formref_die (attr, &die_mem); | ||
498 | + tag = dwarf_tag (typedie); | ||
499 | + } | ||
500 | + /* Fall through. */ | ||
501 | + | ||
502 | + case DW_TAG_base_type: | ||
503 | + case DW_TAG_enumeration_type: | ||
504 | + case DW_TAG_pointer_type: | ||
505 | + case DW_TAG_ptr_to_member_type: | ||
506 | + { | ||
507 | + Dwarf_Word size; | ||
508 | + if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size, | ||
509 | + &attr_mem), &size) != 0) | ||
510 | + { | ||
511 | + if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type) | ||
512 | + size = 4; | ||
513 | + else | ||
514 | + return -1; | ||
515 | + } | ||
516 | + if (tag == DW_TAG_base_type) | ||
517 | + { | ||
518 | + Dwarf_Word encoding; | ||
519 | + if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding, | ||
520 | + &attr_mem), &encoding) != 0) | ||
521 | + return -1; | ||
522 | + | ||
523 | + if (encoding == DW_ATE_float) | ||
524 | + { | ||
525 | + if (pa64) { | ||
526 | + *locp = loc_fpreg; | ||
527 | + if (size <= 8) | ||
528 | + return nloc_fpreg; | ||
529 | + } | ||
530 | + else { | ||
531 | + *locp = loc_fpreg32; | ||
532 | + if (size <= 4) | ||
533 | + return nloc_fpreg32; | ||
534 | + else if (size <= 8) | ||
535 | + return nloc_fpregpair32; | ||
536 | + } | ||
537 | + goto aggregate; | ||
538 | + } | ||
539 | + } | ||
540 | + if (pa64) | ||
541 | + *locp = loc_intreg; | ||
542 | + else | ||
543 | + *locp = loc_intreg32; | ||
544 | + if (size <= regsize) | ||
545 | + return nloc_intreg; | ||
546 | + if (size <= 2 * regsize) | ||
547 | + return nloc_intregpair; | ||
548 | + | ||
549 | + /* Else fall through. */ | ||
550 | + } | ||
551 | + | ||
552 | + case DW_TAG_structure_type: | ||
553 | + case DW_TAG_class_type: | ||
554 | + case DW_TAG_union_type: | ||
555 | + case DW_TAG_array_type: | ||
556 | + aggregate: { | ||
557 | + Dwarf_Word size; | ||
558 | + if (dwarf_aggregate_size (typedie, &size) != 0) | ||
559 | + return -1; | ||
560 | + if (pa64) | ||
561 | + *locp = loc_intreg; | ||
562 | + else | ||
563 | + *locp = loc_intreg32; | ||
564 | + if (size <= regsize) | ||
565 | + return nloc_intreg; | ||
566 | + if (size <= 2 * regsize) | ||
567 | + return nloc_intregpair; | ||
568 | +#if 0 | ||
569 | + /* there should be some way to know this location... But I do not see it. */ | ||
570 | + *locp = loc_aggregate; | ||
571 | + return nloc_aggregate; | ||
572 | +#endif | ||
573 | + /* fall through. */ | ||
574 | + } | ||
575 | + } | ||
576 | + | ||
577 | + /* XXX We don't have a good way to return specific errors from ebl calls. | ||
578 | + This value means we do not understand the type, but it is well-formed | ||
579 | + DWARF and might be valid. */ | ||
580 | + return -2; | ||
581 | +} | ||
582 | + | ||
583 | +int | ||
584 | +parisc_return_value_location_32 (Dwarf_Die *functypedie, const Dwarf_Op **locp) | ||
585 | +{ | ||
586 | + return parisc_return_value_location_ (functypedie, locp, 0); | ||
587 | +} | ||
588 | + | ||
589 | +int | ||
590 | +parisc_return_value_location_64 (Dwarf_Die *functypedie, const Dwarf_Op **locp) | ||
591 | +{ | ||
592 | + return parisc_return_value_location_ (functypedie, locp, 1); | ||
593 | +} | ||
594 | + | ||
595 | Index: elfutils-0.158/backends/parisc_symbol.c | ||
596 | =================================================================== | ||
597 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
598 | +++ elfutils-0.158/backends/parisc_symbol.c 2014-04-21 11:12:12.228150280 +0000 | ||
599 | @@ -0,0 +1,112 @@ | ||
600 | +/* PA-RISC specific symbolic name handling. | ||
601 | + Copyright (C) 2002, 2005 Red Hat, Inc. | ||
602 | + This file is part of Red Hat elfutils. | ||
603 | + Written by Ulrich Drepper <drepper@redhat.com>, 2002. | ||
604 | + | ||
605 | + Red Hat elfutils is free software; you can redistribute it and/or modify | ||
606 | + it under the terms of the GNU General Public License as published by the | ||
607 | + Free Software Foundation; version 2 of the License. | ||
608 | + | ||
609 | + Red Hat elfutils is distributed in the hope that it will be useful, but | ||
610 | + WITHOUT ANY WARRANTY; without even the implied warranty of | ||
611 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
612 | + General Public License for more details. | ||
613 | + | ||
614 | + You should have received a copy of the GNU General Public License along | ||
615 | + with Red Hat elfutils; if not, write to the Free Software Foundation, | ||
616 | + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. | ||
617 | + | ||
618 | + Red Hat elfutils is an included package of the Open Invention Network. | ||
619 | + An included package of the Open Invention Network is a package for which | ||
620 | + Open Invention Network licensees cross-license their patents. No patent | ||
621 | + license is granted, either expressly or impliedly, by designation as an | ||
622 | + included package. Should you wish to participate in the Open Invention | ||
623 | + Network licensing program, please visit www.openinventionnetwork.com | ||
624 | + <http://www.openinventionnetwork.com>. */ | ||
625 | + | ||
626 | +#ifdef HAVE_CONFIG_H | ||
627 | +# include <config.h> | ||
628 | +#endif | ||
629 | + | ||
630 | +#include <elf.h> | ||
631 | +#include <stddef.h> | ||
632 | + | ||
633 | +#define BACKEND parisc_ | ||
634 | +#include "libebl_CPU.h" | ||
635 | + | ||
636 | +const char * | ||
637 | +parisc_segment_type_name (int segment, char *buf __attribute__ ((unused)), | ||
638 | + size_t len __attribute__ ((unused))) | ||
639 | +{ | ||
640 | + switch (segment) | ||
641 | + { | ||
642 | + case PT_PARISC_ARCHEXT: | ||
643 | + return "PARISC_ARCHEXT"; | ||
644 | + case PT_PARISC_UNWIND: | ||
645 | + return "PARISC_UNWIND"; | ||
646 | + default: | ||
647 | + break; | ||
648 | + } | ||
649 | + return NULL; | ||
650 | +} | ||
651 | + | ||
652 | +/* Return symbolic representation of symbol type. */ | ||
653 | +const char * | ||
654 | +parisc_symbol_type_name(int symbol, char *buf __attribute__ ((unused)), | ||
655 | + size_t len __attribute__ ((unused))) | ||
656 | +{ | ||
657 | + if (symbol == STT_PARISC_MILLICODE) | ||
658 | + return "PARISC_MILLI"; | ||
659 | + return NULL; | ||
660 | +} | ||
661 | + | ||
662 | +/* Return symbolic representation of section type. */ | ||
663 | +const char * | ||
664 | +parisc_section_type_name (int type, | ||
665 | + char *buf __attribute__ ((unused)), | ||
666 | + size_t len __attribute__ ((unused))) | ||
667 | +{ | ||
668 | + switch (type) | ||
669 | + { | ||
670 | + case SHT_PARISC_EXT: | ||
671 | + return "PARISC_EXT"; | ||
672 | + case SHT_PARISC_UNWIND: | ||
673 | + return "PARISC_UNWIND"; | ||
674 | + case SHT_PARISC_DOC: | ||
675 | + return "PARISC_DOC"; | ||
676 | + } | ||
677 | + | ||
678 | + return NULL; | ||
679 | +} | ||
680 | + | ||
681 | +/* Check whether machine flags are valid. */ | ||
682 | +bool | ||
683 | +parisc_machine_flag_check (GElf_Word flags) | ||
684 | +{ | ||
685 | + if (flags &~ (EF_PARISC_TRAPNIL | EF_PARISC_EXT | EF_PARISC_LSB | | ||
686 | + EF_PARISC_WIDE | EF_PARISC_NO_KABP | | ||
687 | + EF_PARISC_LAZYSWAP | EF_PARISC_ARCH)) | ||
688 | + return 0; | ||
689 | + | ||
690 | + GElf_Word arch = flags & EF_PARISC_ARCH; | ||
691 | + | ||
692 | + return ((arch == EFA_PARISC_1_0) || (arch == EFA_PARISC_1_1) || | ||
693 | + (arch == EFA_PARISC_2_0)); | ||
694 | +} | ||
695 | + | ||
696 | +/* Check for the simple reloc types. */ | ||
697 | +Elf_Type | ||
698 | +parisc_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type) | ||
699 | +{ | ||
700 | + switch (type) | ||
701 | + { | ||
702 | + case R_PARISC_DIR64: | ||
703 | + case R_PARISC_SECREL64: | ||
704 | + return ELF_T_XWORD; | ||
705 | + case R_PARISC_DIR32: | ||
706 | + case R_PARISC_SECREL32: | ||
707 | + return ELF_T_WORD; | ||
708 | + default: | ||
709 | + return ELF_T_NUM; | ||
710 | + } | ||
711 | +} | ||
712 | Index: elfutils-0.158/backends/libebl_parisc.h | ||
713 | =================================================================== | ||
714 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
715 | +++ elfutils-0.158/backends/libebl_parisc.h 2014-04-21 11:12:12.228150280 +0000 | ||
716 | @@ -0,0 +1,9 @@ | ||
717 | +#ifndef _LIBEBL_HPPA_H | ||
718 | +#define _LIBEBL_HPPA_H 1 | ||
719 | + | ||
720 | +#include <libdw.h> | ||
721 | + | ||
722 | +extern int parisc_return_value_location_32(Dwarf_Die *, const Dwarf_Op **locp); | ||
723 | +extern int parisc_return_value_location_64(Dwarf_Die *, const Dwarf_Op **locp); | ||
724 | + | ||
725 | +#endif | ||
726 | Index: elfutils-0.158/backends/Makefile.am | ||
727 | =================================================================== | ||
728 | --- elfutils-0.158.orig/backends/Makefile.am 2014-04-21 11:12:12.252149737 +0000 | ||
729 | +++ elfutils-0.158/backends/Makefile.am 2014-04-21 11:13:11.910801105 +0000 | ||
730 | @@ -33,11 +33,12 @@ | ||
731 | |||
732 | |||
733 | modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \ | ||
734 | - tilegx | ||
735 | + tilegx parisc | ||
736 | libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \ | ||
737 | libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \ | ||
738 | libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \ | ||
739 | - libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a | ||
740 | + libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \ | ||
741 | + libebl_parisc_pic.a | ||
742 | noinst_LIBRARIES = $(libebl_pic) | ||
743 | noinst_DATA = $(libebl_pic:_pic.a=.so) | ||
744 | |||
745 | @@ -116,6 +117,9 @@ | ||
746 | libebl_tilegx_pic_a_SOURCES = $(tilegx_SRCS) | ||
747 | am_libebl_tilegx_pic_a_OBJECTS = $(tilegx_SRCS:.c=.os) | ||
748 | |||
749 | +parisc_SRCS = parisc_init.c parisc_symbol.c parisc_regs.c parisc_retval.c | ||
750 | +libebl_parisc_pic_a_SOURCES = $(parisc_SRCS) | ||
751 | +am_libebl_parisc_pic_a_OBJECTS = $(parisc_SRCS:.c=.os) | ||
752 | |||
753 | libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw) | ||
754 | @rm -f $(@:.so=.map) | ||
755 | Index: elfutils-0.158/libelf/elf.h | ||
756 | =================================================================== | ||
757 | --- elfutils-0.158.orig/libelf/elf.h 2014-04-21 11:12:12.252149737 +0000 | ||
758 | +++ elfutils-0.158/libelf/elf.h 2014-04-21 11:12:12.228150280 +0000 | ||
759 | @@ -1814,16 +1814,24 @@ | ||
760 | #define R_PARISC_PCREL17F 12 /* 17 bits of rel. address. */ | ||
761 | #define R_PARISC_PCREL14R 14 /* Right 14 bits of rel. address. */ | ||
762 | #define R_PARISC_DPREL21L 18 /* Left 21 bits of rel. address. */ | ||
763 | +#define R_PARISC_DPREL14WR 19 | ||
764 | +#define R_PARISC_DPREL14DR 20 | ||
765 | #define R_PARISC_DPREL14R 22 /* Right 14 bits of rel. address. */ | ||
766 | #define R_PARISC_GPREL21L 26 /* GP-relative, left 21 bits. */ | ||
767 | #define R_PARISC_GPREL14R 30 /* GP-relative, right 14 bits. */ | ||
768 | #define R_PARISC_LTOFF21L 34 /* LT-relative, left 21 bits. */ | ||
769 | #define R_PARISC_LTOFF14R 38 /* LT-relative, right 14 bits. */ | ||
770 | +#define R_PARISC_DLTIND14F 39 | ||
771 | +#define R_PARISC_SETBASE 40 | ||
772 | #define R_PARISC_SECREL32 41 /* 32 bits section rel. address. */ | ||
773 | +#define R_PARISC_BASEREL21L 42 | ||
774 | +#define R_PARISC_BASEREL17R 43 | ||
775 | +#define R_PARISC_BASEREL14R 46 | ||
776 | #define R_PARISC_SEGBASE 48 /* No relocation, set segment base. */ | ||
777 | #define R_PARISC_SEGREL32 49 /* 32 bits segment rel. address. */ | ||
778 | #define R_PARISC_PLTOFF21L 50 /* PLT rel. address, left 21 bits. */ | ||
779 | #define R_PARISC_PLTOFF14R 54 /* PLT rel. address, right 14 bits. */ | ||
780 | +#define R_PARISC_PLTOFF14F 55 | ||
781 | #define R_PARISC_LTOFF_FPTR32 57 /* 32 bits LT-rel. function pointer. */ | ||
782 | #define R_PARISC_LTOFF_FPTR21L 58 /* LT-rel. fct ptr, left 21 bits. */ | ||
783 | #define R_PARISC_LTOFF_FPTR14R 62 /* LT-rel. fct ptr, right 14 bits. */ | ||
784 | @@ -1832,6 +1840,7 @@ | ||
785 | #define R_PARISC_PLABEL21L 66 /* Left 21 bits of fdesc address. */ | ||
786 | #define R_PARISC_PLABEL14R 70 /* Right 14 bits of fdesc address. */ | ||
787 | #define R_PARISC_PCREL64 72 /* 64 bits PC-rel. address. */ | ||
788 | +#define R_PARISC_PCREL22C 73 | ||
789 | #define R_PARISC_PCREL22F 74 /* 22 bits PC-rel. address. */ | ||
790 | #define R_PARISC_PCREL14WR 75 /* PC-rel. address, right 14 bits. */ | ||
791 | #define R_PARISC_PCREL14DR 76 /* PC rel. address, right 14 bits. */ | ||
792 | @@ -1857,6 +1866,8 @@ | ||
793 | #define R_PARISC_LTOFF16WF 102 /* 16 bits LT-rel. address. */ | ||
794 | #define R_PARISC_LTOFF16DF 103 /* 16 bits LT-rel. address. */ | ||
795 | #define R_PARISC_SECREL64 104 /* 64 bits section rel. address. */ | ||
796 | +#define R_PARISC_BASEREL14WR 107 | ||
797 | +#define R_PARISC_BASEREL14DR 108 | ||
798 | #define R_PARISC_SEGREL64 112 /* 64 bits segment rel. address. */ | ||
799 | #define R_PARISC_PLTOFF14WR 115 /* PLT-rel. address, right 14 bits. */ | ||
800 | #define R_PARISC_PLTOFF14DR 116 /* PLT-rel. address, right 14 bits. */ | ||
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/m68k_backend.diff b/meta/recipes-devtools/elfutils/elfutils-0.163/m68k_backend.diff new file mode 100644 index 0000000000..f5b566f2d5 --- /dev/null +++ b/meta/recipes-devtools/elfutils/elfutils-0.163/m68k_backend.diff | |||
@@ -0,0 +1,493 @@ | |||
1 | From: Kurt Roeckx <kurt@roeckx.be> | ||
2 | From: Thorsten Glaser <tg@mirbsd.de> | ||
3 | Subject: m68k support | ||
4 | |||
5 | Written by Kurt Roeckx, except for the retval support which was written | ||
6 | by Thorsten Glaser | ||
7 | |||
8 | |||
9 | Index: elfutils-0.158/backends/m68k_init.c | ||
10 | =================================================================== | ||
11 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
12 | +++ elfutils-0.158/backends/m68k_init.c 2014-04-21 11:14:23.813175704 +0000 | ||
13 | @@ -0,0 +1,50 @@ | ||
14 | +/* Initialization of m68k specific backend library. | ||
15 | + Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be> | ||
16 | + | ||
17 | + This software is free software; you can redistribute it and/or modify | ||
18 | + it under the terms of the GNU General Public License as published by the | ||
19 | + Free Software Foundation; version 2 of the License. | ||
20 | + | ||
21 | + This softare is distributed in the hope that it will be useful, but | ||
22 | + WITHOUT ANY WARRANTY; without even the implied warranty of | ||
23 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
24 | + General Public License for more details. | ||
25 | + | ||
26 | + You should have received a copy of the GNU General Public License along | ||
27 | + with this software; if not, write to the Free Software Foundation, | ||
28 | + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. | ||
29 | + | ||
30 | +*/ | ||
31 | + | ||
32 | +#ifdef HAVE_CONFIG_H | ||
33 | +# include <config.h> | ||
34 | +#endif | ||
35 | + | ||
36 | +#define BACKEND m68k_ | ||
37 | +#define RELOC_PREFIX R_68K_ | ||
38 | +#include "libebl_CPU.h" | ||
39 | + | ||
40 | +/* This defines the common reloc hooks based on m68k_reloc.def. */ | ||
41 | +#include "common-reloc.c" | ||
42 | + | ||
43 | + | ||
44 | +const char * | ||
45 | +m68k_init (elf, machine, eh, ehlen) | ||
46 | + Elf *elf __attribute__ ((unused)); | ||
47 | + GElf_Half machine __attribute__ ((unused)); | ||
48 | + Ebl *eh; | ||
49 | + size_t ehlen; | ||
50 | +{ | ||
51 | + /* Check whether the Elf_BH object has a sufficent size. */ | ||
52 | + if (ehlen < sizeof (Ebl)) | ||
53 | + return NULL; | ||
54 | + | ||
55 | + /* We handle it. */ | ||
56 | + eh->name = "m68k"; | ||
57 | + m68k_init_reloc (eh); | ||
58 | + HOOK (eh, reloc_simple_type); | ||
59 | + HOOK (eh, return_value_location); | ||
60 | + HOOK (eh, register_info); | ||
61 | + | ||
62 | + return MODVERSION; | ||
63 | +} | ||
64 | Index: elfutils-0.158/backends/m68k_regs.c | ||
65 | =================================================================== | ||
66 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
67 | +++ elfutils-0.158/backends/m68k_regs.c 2014-04-21 11:14:23.813175704 +0000 | ||
68 | @@ -0,0 +1,106 @@ | ||
69 | +/* Register names and numbers for m68k DWARF. | ||
70 | + Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be> | ||
71 | + | ||
72 | + This software is free software; you can redistribute it and/or modify | ||
73 | + it under the terms of the GNU General Public License as published by the | ||
74 | + Free Software Foundation; version 2 of the License. | ||
75 | + | ||
76 | + This software is distributed in the hope that it will be useful, but | ||
77 | + WITHOUT ANY WARRANTY; without even the implied warranty of | ||
78 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
79 | + General Public License for more details. | ||
80 | + | ||
81 | + You should have received a copy of the GNU General Public License along | ||
82 | + with this software; if not, write to the Free Software Foundation, | ||
83 | + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. | ||
84 | + | ||
85 | + */ | ||
86 | + | ||
87 | +#ifdef HAVE_CONFIG_H | ||
88 | +# include <config.h> | ||
89 | +#endif | ||
90 | + | ||
91 | +#include <string.h> | ||
92 | +#include <dwarf.h> | ||
93 | + | ||
94 | +#define BACKEND m68k_ | ||
95 | +#include "libebl_CPU.h" | ||
96 | + | ||
97 | +ssize_t | ||
98 | +m68k_register_info (Ebl *ebl __attribute__ ((unused)), | ||
99 | + int regno, char *name, size_t namelen, | ||
100 | + const char **prefix, const char **setname, | ||
101 | + int *bits, int *type) | ||
102 | +{ | ||
103 | + if (name == NULL) | ||
104 | + return 25; | ||
105 | + | ||
106 | + if (regno < 0 || regno > 24 || namelen < 5) | ||
107 | + return -1; | ||
108 | + | ||
109 | + *prefix = "%"; | ||
110 | + *bits = 32; | ||
111 | + *type = (regno < 8 ? DW_ATE_signed | ||
112 | + : regno < 16 ? DW_ATE_address : DW_ATE_float); | ||
113 | + | ||
114 | + if (regno < 8) | ||
115 | + { | ||
116 | + *setname = "integer"; | ||
117 | + } | ||
118 | + else if (regno < 16) | ||
119 | + { | ||
120 | + *setname = "address"; | ||
121 | + } | ||
122 | + else if (regno < 24) | ||
123 | + { | ||
124 | + *setname = "FPU"; | ||
125 | + } | ||
126 | + else | ||
127 | + { | ||
128 | + *setname = "address"; | ||
129 | + *type = DW_ATE_address; | ||
130 | + } | ||
131 | + | ||
132 | + switch (regno) | ||
133 | + { | ||
134 | + case 0 ... 7: | ||
135 | + name[0] = 'd'; | ||
136 | + name[1] = regno + '0'; | ||
137 | + namelen = 2; | ||
138 | + break; | ||
139 | + | ||
140 | + case 8 ... 13: | ||
141 | + name[0] = 'a'; | ||
142 | + name[1] = regno - 8 + '0'; | ||
143 | + namelen = 2; | ||
144 | + break; | ||
145 | + | ||
146 | + case 14: | ||
147 | + name[0] = 'f'; | ||
148 | + name[1] = 'p'; | ||
149 | + namelen = 2; | ||
150 | + break; | ||
151 | + | ||
152 | + case 15: | ||
153 | + name[0] = 's'; | ||
154 | + name[1] = 'p'; | ||
155 | + namelen = 2; | ||
156 | + break; | ||
157 | + | ||
158 | + case 16 ... 23: | ||
159 | + name[0] = 'f'; | ||
160 | + name[1] = 'p'; | ||
161 | + name[2] = regno - 16 + '0'; | ||
162 | + namelen = 3; | ||
163 | + break; | ||
164 | + | ||
165 | + case 24: | ||
166 | + name[0] = 'p'; | ||
167 | + name[1] = 'c'; | ||
168 | + namelen = 2; | ||
169 | + } | ||
170 | + | ||
171 | + name[namelen++] = '\0'; | ||
172 | + return namelen; | ||
173 | +} | ||
174 | + | ||
175 | Index: elfutils-0.158/backends/m68k_reloc.def | ||
176 | =================================================================== | ||
177 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
178 | +++ elfutils-0.158/backends/m68k_reloc.def 2014-04-21 11:14:23.813175704 +0000 | ||
179 | @@ -0,0 +1,45 @@ | ||
180 | +/* List the relocation types for m68k. -*- C -*- | ||
181 | + Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be> | ||
182 | + | ||
183 | + This software is free software; you can redistribute it and/or modify | ||
184 | + it under the terms of the GNU General Public License as published by the | ||
185 | + Free Software Foundation; version 2 of the License. | ||
186 | + | ||
187 | + This software is distributed in the hope that it will be useful, but | ||
188 | + WITHOUT ANY WARRANTY; without even the implied warranty of | ||
189 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
190 | + General Public License for more details. | ||
191 | + | ||
192 | + You should have received a copy of the GNU General Public License along | ||
193 | + with this software; if not, write to the Free Software Foundation, | ||
194 | + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. | ||
195 | +*/ | ||
196 | + | ||
197 | +/* NAME, REL|EXEC|DYN */ | ||
198 | + | ||
199 | +RELOC_TYPE (NONE, 0) | ||
200 | +RELOC_TYPE (32, REL|EXEC|DYN) | ||
201 | +RELOC_TYPE (16, REL) | ||
202 | +RELOC_TYPE (8, REL) | ||
203 | +RELOC_TYPE (PC32, REL|EXEC|DYN) | ||
204 | +RELOC_TYPE (PC16, REL) | ||
205 | +RELOC_TYPE (PC8, REL) | ||
206 | +RELOC_TYPE (GOT32, REL) | ||
207 | +RELOC_TYPE (GOT16, REL) | ||
208 | +RELOC_TYPE (GOT8, REL) | ||
209 | +RELOC_TYPE (GOT32O, REL) | ||
210 | +RELOC_TYPE (GOT16O, REL) | ||
211 | +RELOC_TYPE (GOT8O, REL) | ||
212 | +RELOC_TYPE (PLT32, REL) | ||
213 | +RELOC_TYPE (PLT16, REL) | ||
214 | +RELOC_TYPE (PLT8, REL) | ||
215 | +RELOC_TYPE (PLT32O, REL) | ||
216 | +RELOC_TYPE (PLT16O, REL) | ||
217 | +RELOC_TYPE (PLT8O, REL) | ||
218 | +RELOC_TYPE (COPY, EXEC) | ||
219 | +RELOC_TYPE (GLOB_DAT, EXEC|DYN) | ||
220 | +RELOC_TYPE (JMP_SLOT, EXEC|DYN) | ||
221 | +RELOC_TYPE (RELATIVE, EXEC|DYN) | ||
222 | +RELOC_TYPE (GNU_VTINHERIT, REL) | ||
223 | +RELOC_TYPE (GNU_VTENTRY, REL) | ||
224 | + | ||
225 | Index: elfutils-0.158/libelf/elf.h | ||
226 | =================================================================== | ||
227 | --- elfutils-0.158.orig/libelf/elf.h 2014-04-21 11:14:23.813175704 +0000 | ||
228 | +++ elfutils-0.158/libelf/elf.h 2014-04-21 11:14:23.813175704 +0000 | ||
229 | @@ -1157,6 +1157,9 @@ | ||
230 | #define R_68K_GLOB_DAT 20 /* Create GOT entry */ | ||
231 | #define R_68K_JMP_SLOT 21 /* Create PLT entry */ | ||
232 | #define R_68K_RELATIVE 22 /* Adjust by program base */ | ||
233 | +/* The next 2 are GNU extensions to enable C++ vtable garbage collection. */ | ||
234 | +#define R_68K_GNU_VTINHERIT 23 | ||
235 | +#define R_68K_GNU_VTENTRY 24 | ||
236 | #define R_68K_TLS_GD32 25 /* 32 bit GOT offset for GD */ | ||
237 | #define R_68K_TLS_GD16 26 /* 16 bit GOT offset for GD */ | ||
238 | #define R_68K_TLS_GD8 27 /* 8 bit GOT offset for GD */ | ||
239 | Index: elfutils-0.158/backends/Makefile.am | ||
240 | =================================================================== | ||
241 | --- elfutils-0.158.orig/backends/Makefile.am 2014-04-21 11:14:23.813175704 +0000 | ||
242 | +++ elfutils-0.158/backends/Makefile.am 2014-04-21 11:14:48.344621167 +0000 | ||
243 | @@ -33,12 +33,12 @@ | ||
244 | |||
245 | |||
246 | modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \ | ||
247 | - tilegx parisc mips | ||
248 | + tilegx parisc mips m68k | ||
249 | libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \ | ||
250 | libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \ | ||
251 | libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \ | ||
252 | libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \ | ||
253 | - libebl_parisc_pic.a libebl_mips_pic.a | ||
254 | + libebl_parisc_pic.a libebl_mips_pic.a libebl_m68k_pic.a | ||
255 | noinst_LIBRARIES = $(libebl_pic) | ||
256 | noinst_DATA = $(libebl_pic:_pic.a=.so) | ||
257 | |||
258 | @@ -125,6 +125,10 @@ | ||
259 | libebl_mips_pic_a_SOURCES = $(mips_SRCS) | ||
260 | am_libebl_mips_pic_a_OBJECTS = $(mips_SRCS:.c=.os) | ||
261 | |||
262 | +m68k_SRCS = m68k_init.c m68k_symbol.c m68k_regs.c m68k_retval.c | ||
263 | +libebl_m68k_pic_a_SOURCES = $(m68k_SRCS) | ||
264 | +am_libebl_m68k_pic_a_OBJECTS = $(m68k_SRCS:.c=.os) | ||
265 | + | ||
266 | libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw) | ||
267 | @rm -f $(@:.so=.map) | ||
268 | echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' \ | ||
269 | Index: elfutils-0.158/backends/m68k_symbol.c | ||
270 | =================================================================== | ||
271 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
272 | +++ elfutils-0.158/backends/m68k_symbol.c 2014-04-21 11:14:23.813175704 +0000 | ||
273 | @@ -0,0 +1,43 @@ | ||
274 | +/* m68k specific symbolic name handling. | ||
275 | + Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be> | ||
276 | + | ||
277 | + This software is free software; you can redistribute it and/or modify | ||
278 | + it under the terms of the GNU General Public License as published by the | ||
279 | + Free Software Foundation; version 2 of the License. | ||
280 | + | ||
281 | + This software distributed in the hope that it will be useful, but | ||
282 | + WITHOUT ANY WARRANTY; without even the implied warranty of | ||
283 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
284 | + General Public License for more details. | ||
285 | + | ||
286 | + You should have received a copy of the GNU General Public License along | ||
287 | + with this software; if not, write to the Free Software Foundation, | ||
288 | + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. | ||
289 | +*/ | ||
290 | + | ||
291 | +#ifdef HAVE_CONFIG_H | ||
292 | +# include <config.h> | ||
293 | +#endif | ||
294 | + | ||
295 | +#include <elf.h> | ||
296 | +#include <stddef.h> | ||
297 | + | ||
298 | +#define BACKEND m68k_ | ||
299 | +#include "libebl_CPU.h" | ||
300 | + | ||
301 | +/* Check for the simple reloc types. */ | ||
302 | +Elf_Type | ||
303 | +m68k_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type) | ||
304 | +{ | ||
305 | + switch (type) | ||
306 | + { | ||
307 | + case R_68K_32: | ||
308 | + return ELF_T_SWORD; | ||
309 | + case R_68K_16: | ||
310 | + return ELF_T_HALF; | ||
311 | + case R_68K_8: | ||
312 | + return ELF_T_BYTE; | ||
313 | + default: | ||
314 | + return ELF_T_NUM; | ||
315 | + } | ||
316 | +} | ||
317 | Index: elfutils-0.158/backends/m68k_retval.c | ||
318 | =================================================================== | ||
319 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
320 | +++ elfutils-0.158/backends/m68k_retval.c 2014-04-21 11:14:23.813175704 +0000 | ||
321 | @@ -0,0 +1,172 @@ | ||
322 | +/* Function return value location for Linux/m68k ABI. | ||
323 | + Copyright (C) 2005-2010 Red Hat, Inc. | ||
324 | + Copyright (c) 2011 Thorsten Glaser, Debian. | ||
325 | + This file is part of Red Hat elfutils. | ||
326 | + | ||
327 | + Red Hat elfutils is free software; you can redistribute it and/or modify | ||
328 | + it under the terms of the GNU General Public License as published by the | ||
329 | + Free Software Foundation; version 2 of the License. | ||
330 | + | ||
331 | + Red Hat elfutils is distributed in the hope that it will be useful, but | ||
332 | + WITHOUT ANY WARRANTY; without even the implied warranty of | ||
333 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
334 | + General Public License for more details. | ||
335 | + | ||
336 | + You should have received a copy of the GNU General Public License along | ||
337 | + with Red Hat elfutils; if not, write to the Free Software Foundation, | ||
338 | + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. | ||
339 | + | ||
340 | + Red Hat elfutils is an included package of the Open Invention Network. | ||
341 | + An included package of the Open Invention Network is a package for which | ||
342 | + Open Invention Network licensees cross-license their patents. No patent | ||
343 | + license is granted, either expressly or impliedly, by designation as an | ||
344 | + included package. Should you wish to participate in the Open Invention | ||
345 | + Network licensing program, please visit www.openinventionnetwork.com | ||
346 | + <http://www.openinventionnetwork.com>. */ | ||
347 | + | ||
348 | +#ifdef HAVE_CONFIG_H | ||
349 | +# include <config.h> | ||
350 | +#endif | ||
351 | + | ||
352 | +#include <assert.h> | ||
353 | +#include <dwarf.h> | ||
354 | + | ||
355 | +#define BACKEND m68k_ | ||
356 | +#include "libebl_CPU.h" | ||
357 | + | ||
358 | + | ||
359 | +/* %d0, or pair %d0, %d1, or %a0 */ | ||
360 | +static const Dwarf_Op loc_intreg[] = | ||
361 | + { | ||
362 | + { .atom = DW_OP_reg0 }, { .atom = DW_OP_piece, .number = 4 }, | ||
363 | + { .atom = DW_OP_reg1 }, { .atom = DW_OP_piece, .number = 4 }, | ||
364 | + }; | ||
365 | +static const Dwarf_Op loc_ptrreg[] = | ||
366 | + { | ||
367 | + { .atom = DW_OP_reg8 }, | ||
368 | + }; | ||
369 | +#define nloc_intreg 1 | ||
370 | +#define nloc_intregpair 4 | ||
371 | +#define nloc_ptrreg 1 | ||
372 | + | ||
373 | +/* %f0 */ | ||
374 | +static const Dwarf_Op loc_fpreg[] = | ||
375 | + { | ||
376 | + { .atom = DW_OP_reg16 } | ||
377 | + }; | ||
378 | +#define nloc_fpreg 1 | ||
379 | + | ||
380 | +/* Structures are a bit more complicated - small structures are returned | ||
381 | + in %d0 / %d1 (-freg-struct-return which is enabled by default), large | ||
382 | + structures use %a1 (in constrast to the SYSV psABI which says %a0) as | ||
383 | + reentrant storage space indicator. */ | ||
384 | +static const Dwarf_Op loc_aggregate[] = | ||
385 | + { | ||
386 | + { .atom = DW_OP_breg9, .number = 0 } | ||
387 | + }; | ||
388 | +#define nloc_aggregate 1 | ||
389 | + | ||
390 | +int | ||
391 | +m68k_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) | ||
392 | +{ | ||
393 | + Dwarf_Word size; | ||
394 | + | ||
395 | + /* Start with the function's type, and get the DW_AT_type attribute, | ||
396 | + which is the type of the return value. */ | ||
397 | + | ||
398 | + Dwarf_Attribute attr_mem; | ||
399 | + Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, | ||
400 | + &attr_mem); | ||
401 | + if (attr == NULL) | ||
402 | + /* The function has no return value, like a `void' function in C. */ | ||
403 | + return 0; | ||
404 | + | ||
405 | + Dwarf_Die die_mem; | ||
406 | + Dwarf_Die *typedie = dwarf_formref_die (attr, &die_mem); | ||
407 | + int tag = dwarf_tag (typedie); | ||
408 | + | ||
409 | + /* Follow typedefs and qualifiers to get to the actual type. */ | ||
410 | + while (tag == DW_TAG_typedef | ||
411 | + || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type | ||
412 | + || tag == DW_TAG_restrict_type) | ||
413 | + { | ||
414 | + attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); | ||
415 | + typedie = dwarf_formref_die (attr, &die_mem); | ||
416 | + tag = dwarf_tag (typedie); | ||
417 | + } | ||
418 | + | ||
419 | + switch (tag) | ||
420 | + { | ||
421 | + case -1: | ||
422 | + return -1; | ||
423 | + | ||
424 | + case DW_TAG_subrange_type: | ||
425 | + if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size)) | ||
426 | + { | ||
427 | + attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); | ||
428 | + typedie = dwarf_formref_die (attr, &die_mem); | ||
429 | + tag = dwarf_tag (typedie); | ||
430 | + } | ||
431 | + /* Fall through. */ | ||
432 | + | ||
433 | + case DW_TAG_base_type: | ||
434 | + case DW_TAG_enumeration_type: | ||
435 | + case DW_TAG_pointer_type: | ||
436 | + case DW_TAG_ptr_to_member_type: | ||
437 | + if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size, | ||
438 | + &attr_mem), &size) != 0) | ||
439 | + { | ||
440 | + if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type) | ||
441 | + size = 4; | ||
442 | + else | ||
443 | + return -1; | ||
444 | + } | ||
445 | + if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type) | ||
446 | + { | ||
447 | + *locp = loc_ptrreg; | ||
448 | + return nloc_ptrreg; | ||
449 | + } | ||
450 | + if (tag == DW_TAG_base_type) | ||
451 | + { | ||
452 | + Dwarf_Word encoding; | ||
453 | + if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding, | ||
454 | + &attr_mem), | ||
455 | + &encoding) != 0) | ||
456 | + return -1; | ||
457 | + if (encoding == DW_ATE_float) | ||
458 | + { | ||
459 | + /* XXX really 10? */ | ||
460 | + if (size > 10) | ||
461 | + return -2; | ||
462 | + *locp = loc_fpreg; | ||
463 | + return nloc_fpreg; | ||
464 | + } | ||
465 | + } | ||
466 | + if (size <= 8) | ||
467 | + { | ||
468 | + intreg: | ||
469 | + /* XXX check endianness of dword pair, int64 vs aggregate */ | ||
470 | + *locp = loc_intreg; | ||
471 | + return size <= 4 ? nloc_intreg : nloc_intregpair; | ||
472 | + } | ||
473 | + | ||
474 | + aggregate: | ||
475 | + *locp = loc_aggregate; | ||
476 | + return nloc_aggregate; | ||
477 | + | ||
478 | + case DW_TAG_structure_type: | ||
479 | + case DW_TAG_class_type: | ||
480 | + case DW_TAG_union_type: | ||
481 | + case DW_TAG_array_type: | ||
482 | + if (dwarf_aggregate_size (typedie, &size) == 0 | ||
483 | + && size > 0 && size <= 8) | ||
484 | + /* not accurate for a struct whose only member is a float */ | ||
485 | + goto intreg; | ||
486 | + goto aggregate; | ||
487 | + } | ||
488 | + | ||
489 | + /* XXX We don't have a good way to return specific errors from ebl calls. | ||
490 | + This value means we do not understand the type, but it is well-formed | ||
491 | + DWARF and might be valid. */ | ||
492 | + return -2; | ||
493 | +} | ||
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/mips_backend.diff b/meta/recipes-devtools/elfutils/elfutils-0.163/mips_backend.diff new file mode 100644 index 0000000000..d73a3f2869 --- /dev/null +++ b/meta/recipes-devtools/elfutils/elfutils-0.163/mips_backend.diff | |||
@@ -0,0 +1,712 @@ | |||
1 | Index: elfutils-0.158/backends/mips_init.c | ||
2 | =================================================================== | ||
3 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
4 | +++ elfutils-0.158/backends/mips_init.c 2014-04-21 11:13:36.910235965 +0000 | ||
5 | @@ -0,0 +1,60 @@ | ||
6 | +/* Initialization of mips specific backend library. | ||
7 | + Copyright (C) 2006 Red Hat, Inc. | ||
8 | + This file is part of Red Hat elfutils. | ||
9 | + | ||
10 | + Red Hat elfutils is free software; you can redistribute it and/or modify | ||
11 | + it under the terms of the GNU General Public License as published by the | ||
12 | + Free Software Foundation; version 2 of the License. | ||
13 | + | ||
14 | + Red Hat elfutils is distributed in the hope that it will be useful, but | ||
15 | + WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
17 | + General Public License for more details. | ||
18 | + | ||
19 | + You should have received a copy of the GNU General Public License along | ||
20 | + with Red Hat elfutils; if not, write to the Free Software Foundation, | ||
21 | + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. | ||
22 | + | ||
23 | + Red Hat elfutils is an included package of the Open Invention Network. | ||
24 | + An included package of the Open Invention Network is a package for which | ||
25 | + Open Invention Network licensees cross-license their patents. No patent | ||
26 | + license is granted, either expressly or impliedly, by designation as an | ||
27 | + included package. Should you wish to participate in the Open Invention | ||
28 | + Network licensing program, please visit www.openinventionnetwork.com | ||
29 | + <http://www.openinventionnetwork.com>. */ | ||
30 | + | ||
31 | +#ifdef HAVE_CONFIG_H | ||
32 | +# include <config.h> | ||
33 | +#endif | ||
34 | + | ||
35 | +#define BACKEND mips_ | ||
36 | +#define RELOC_PREFIX R_MIPS_ | ||
37 | +#include "libebl_CPU.h" | ||
38 | + | ||
39 | +/* This defines the common reloc hooks based on mips_reloc.def. */ | ||
40 | +#include "common-reloc.c" | ||
41 | + | ||
42 | +const char * | ||
43 | +mips_init (elf, machine, eh, ehlen) | ||
44 | + Elf *elf __attribute__ ((unused)); | ||
45 | + GElf_Half machine __attribute__ ((unused)); | ||
46 | + Ebl *eh; | ||
47 | + size_t ehlen; | ||
48 | +{ | ||
49 | + /* Check whether the Elf_BH object has a sufficent size. */ | ||
50 | + if (ehlen < sizeof (Ebl)) | ||
51 | + return NULL; | ||
52 | + | ||
53 | + /* We handle it. */ | ||
54 | + if (machine == EM_MIPS) | ||
55 | + eh->name = "MIPS R3000 big-endian"; | ||
56 | + else if (machine == EM_MIPS_RS3_LE) | ||
57 | + eh->name = "MIPS R3000 little-endian"; | ||
58 | + | ||
59 | + mips_init_reloc (eh); | ||
60 | + HOOK (eh, reloc_simple_type); | ||
61 | + HOOK (eh, return_value_location); | ||
62 | + HOOK (eh, register_info); | ||
63 | + | ||
64 | + return MODVERSION; | ||
65 | +} | ||
66 | Index: elfutils-0.158/backends/mips_regs.c | ||
67 | =================================================================== | ||
68 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
69 | +++ elfutils-0.158/backends/mips_regs.c 2014-04-21 11:13:36.910235965 +0000 | ||
70 | @@ -0,0 +1,104 @@ | ||
71 | +/* Register names and numbers for MIPS DWARF. | ||
72 | + Copyright (C) 2006 Red Hat, Inc. | ||
73 | + This file is part of Red Hat elfutils. | ||
74 | + | ||
75 | + Red Hat elfutils is free software; you can redistribute it and/or modify | ||
76 | + it under the terms of the GNU General Public License as published by the | ||
77 | + Free Software Foundation; version 2 of the License. | ||
78 | + | ||
79 | + Red Hat elfutils is distributed in the hope that it will be useful, but | ||
80 | + WITHOUT ANY WARRANTY; without even the implied warranty of | ||
81 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
82 | + General Public License for more details. | ||
83 | + | ||
84 | + You should have received a copy of the GNU General Public License along | ||
85 | + with Red Hat elfutils; if not, write to the Free Software Foundation, | ||
86 | + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. | ||
87 | + | ||
88 | + Red Hat elfutils is an included package of the Open Invention Network. | ||
89 | + An included package of the Open Invention Network is a package for which | ||
90 | + Open Invention Network licensees cross-license their patents. No patent | ||
91 | + license is granted, either expressly or impliedly, by designation as an | ||
92 | + included package. Should you wish to participate in the Open Invention | ||
93 | + Network licensing program, please visit www.openinventionnetwork.com | ||
94 | + <http://www.openinventionnetwork.com>. */ | ||
95 | + | ||
96 | +#ifdef HAVE_CONFIG_H | ||
97 | +# include <config.h> | ||
98 | +#endif | ||
99 | + | ||
100 | +#include <string.h> | ||
101 | +#include <dwarf.h> | ||
102 | + | ||
103 | +#define BACKEND mips_ | ||
104 | +#include "libebl_CPU.h" | ||
105 | + | ||
106 | +ssize_t | ||
107 | +mips_register_info (Ebl *ebl __attribute__((unused)), | ||
108 | + int regno, char *name, size_t namelen, | ||
109 | + const char **prefix, const char **setname, | ||
110 | + int *bits, int *type) | ||
111 | +{ | ||
112 | + if (name == NULL) | ||
113 | + return 66; | ||
114 | + | ||
115 | + if (regno < 0 || regno > 65 || namelen < 4) | ||
116 | + return -1; | ||
117 | + | ||
118 | + *prefix = "$"; | ||
119 | + | ||
120 | + if (regno < 32) | ||
121 | + { | ||
122 | + *setname = "integer"; | ||
123 | + *type = DW_ATE_signed; | ||
124 | + *bits = 32; | ||
125 | + if (regno < 32 + 10) | ||
126 | + { | ||
127 | + name[0] = regno + '0'; | ||
128 | + namelen = 1; | ||
129 | + } | ||
130 | + else | ||
131 | + { | ||
132 | + name[0] = (regno / 10) + '0'; | ||
133 | + name[1] = (regno % 10) + '0'; | ||
134 | + namelen = 2; | ||
135 | + } | ||
136 | + } | ||
137 | + else if (regno < 64) | ||
138 | + { | ||
139 | + *setname = "FPU"; | ||
140 | + *type = DW_ATE_float; | ||
141 | + *bits = 32; | ||
142 | + name[0] = 'f'; | ||
143 | + if (regno < 32 + 10) | ||
144 | + { | ||
145 | + name[1] = (regno - 32) + '0'; | ||
146 | + namelen = 2; | ||
147 | + } | ||
148 | + else | ||
149 | + { | ||
150 | + name[1] = (regno - 32) / 10 + '0'; | ||
151 | + name[2] = (regno - 32) % 10 + '0'; | ||
152 | + namelen = 3; | ||
153 | + } | ||
154 | + } | ||
155 | + else if (regno == 64) | ||
156 | + { | ||
157 | + *type = DW_ATE_signed; | ||
158 | + *bits = 32; | ||
159 | + name[0] = 'h'; | ||
160 | + name[1] = 'i'; | ||
161 | + namelen = 2; | ||
162 | + } | ||
163 | + else | ||
164 | + { | ||
165 | + *type = DW_ATE_signed; | ||
166 | + *bits = 32; | ||
167 | + name[0] = 'l'; | ||
168 | + name[1] = 'o'; | ||
169 | + namelen = 2; | ||
170 | + } | ||
171 | + | ||
172 | + name[namelen++] = '\0'; | ||
173 | + return namelen; | ||
174 | +} | ||
175 | Index: elfutils-0.158/backends/mips_reloc.def | ||
176 | =================================================================== | ||
177 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
178 | +++ elfutils-0.158/backends/mips_reloc.def 2014-04-21 11:13:36.910235965 +0000 | ||
179 | @@ -0,0 +1,79 @@ | ||
180 | +/* List the relocation types for mips. -*- C -*- | ||
181 | + Copyright (C) 2006 Red Hat, Inc. | ||
182 | + This file is part of Red Hat elfutils. | ||
183 | + | ||
184 | + Red Hat elfutils is free software; you can redistribute it and/or modify | ||
185 | + it under the terms of the GNU General Public License as published by the | ||
186 | + Free Software Foundation; version 2 of the License. | ||
187 | + | ||
188 | + Red Hat elfutils is distributed in the hope that it will be useful, but | ||
189 | + WITHOUT ANY WARRANTY; without even the implied warranty of | ||
190 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
191 | + General Public License for more details. | ||
192 | + | ||
193 | + You should have received a copy of the GNU General Public License along | ||
194 | + with Red Hat elfutils; if not, write to the Free Software Foundation, | ||
195 | + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. | ||
196 | + | ||
197 | + Red Hat elfutils is an included package of the Open Invention Network. | ||
198 | + An included package of the Open Invention Network is a package for which | ||
199 | + Open Invention Network licensees cross-license their patents. No patent | ||
200 | + license is granted, either expressly or impliedly, by designation as an | ||
201 | + included package. Should you wish to participate in the Open Invention | ||
202 | + Network licensing program, please visit www.openinventionnetwork.com | ||
203 | + <http://www.openinventionnetwork.com>. */ | ||
204 | + | ||
205 | +/* NAME, REL|EXEC|DYN */ | ||
206 | + | ||
207 | +RELOC_TYPE (NONE, 0) | ||
208 | +RELOC_TYPE (16, 0) | ||
209 | +RELOC_TYPE (32, 0) | ||
210 | +RELOC_TYPE (REL32, 0) | ||
211 | +RELOC_TYPE (26, 0) | ||
212 | +RELOC_TYPE (HI16, 0) | ||
213 | +RELOC_TYPE (LO16, 0) | ||
214 | +RELOC_TYPE (GPREL16, 0) | ||
215 | +RELOC_TYPE (LITERAL, 0) | ||
216 | +RELOC_TYPE (GOT16, 0) | ||
217 | +RELOC_TYPE (PC16, 0) | ||
218 | +RELOC_TYPE (CALL16, 0) | ||
219 | +RELOC_TYPE (GPREL32, 0) | ||
220 | + | ||
221 | +RELOC_TYPE (SHIFT5, 0) | ||
222 | +RELOC_TYPE (SHIFT6, 0) | ||
223 | +RELOC_TYPE (64, 0) | ||
224 | +RELOC_TYPE (GOT_DISP, 0) | ||
225 | +RELOC_TYPE (GOT_PAGE, 0) | ||
226 | +RELOC_TYPE (GOT_OFST, 0) | ||
227 | +RELOC_TYPE (GOT_HI16, 0) | ||
228 | +RELOC_TYPE (GOT_LO16, 0) | ||
229 | +RELOC_TYPE (SUB, 0) | ||
230 | +RELOC_TYPE (INSERT_A, 0) | ||
231 | +RELOC_TYPE (INSERT_B, 0) | ||
232 | +RELOC_TYPE (DELETE, 0) | ||
233 | +RELOC_TYPE (HIGHER, 0) | ||
234 | +RELOC_TYPE (HIGHEST, 0) | ||
235 | +RELOC_TYPE (CALL_HI16, 0) | ||
236 | +RELOC_TYPE (CALL_LO16, 0) | ||
237 | +RELOC_TYPE (SCN_DISP, 0) | ||
238 | +RELOC_TYPE (REL16, 0) | ||
239 | +RELOC_TYPE (ADD_IMMEDIATE, 0) | ||
240 | +RELOC_TYPE (PJUMP, 0) | ||
241 | +RELOC_TYPE (RELGOT, 0) | ||
242 | +RELOC_TYPE (JALR, 0) | ||
243 | +RELOC_TYPE (TLS_DTPMOD32, 0) | ||
244 | +RELOC_TYPE (TLS_DTPREL32, 0) | ||
245 | +RELOC_TYPE (TLS_DTPMOD64, 0) | ||
246 | +RELOC_TYPE (TLS_DTPREL64, 0) | ||
247 | +RELOC_TYPE (TLS_GD, 0) | ||
248 | +RELOC_TYPE (TLS_LDM, 0) | ||
249 | +RELOC_TYPE (TLS_DTPREL_HI16, 0) | ||
250 | +RELOC_TYPE (TLS_DTPREL_LO16, 0) | ||
251 | +RELOC_TYPE (TLS_GOTTPREL, 0) | ||
252 | +RELOC_TYPE (TLS_TPREL32, 0) | ||
253 | +RELOC_TYPE (TLS_TPREL64, 0) | ||
254 | +RELOC_TYPE (TLS_TPREL_HI16, 0) | ||
255 | +RELOC_TYPE (TLS_TPREL_LO16, 0) | ||
256 | + | ||
257 | +#define NO_COPY_RELOC 1 | ||
258 | +#define NO_RELATIVE_RELOC 1 | ||
259 | Index: elfutils-0.158/backends/mips_retval.c | ||
260 | =================================================================== | ||
261 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
262 | +++ elfutils-0.158/backends/mips_retval.c 2014-04-21 11:13:36.910235965 +0000 | ||
263 | @@ -0,0 +1,321 @@ | ||
264 | +/* Function return value location for Linux/mips ABI. | ||
265 | + Copyright (C) 2005 Red Hat, Inc. | ||
266 | + This file is part of Red Hat elfutils. | ||
267 | + | ||
268 | + Red Hat elfutils is free software; you can redistribute it and/or modify | ||
269 | + it under the terms of the GNU General Public License as published by the | ||
270 | + Free Software Foundation; version 2 of the License. | ||
271 | + | ||
272 | + Red Hat elfutils is distributed in the hope that it will be useful, but | ||
273 | + WITHOUT ANY WARRANTY; without even the implied warranty of | ||
274 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
275 | + General Public License for more details. | ||
276 | + | ||
277 | + You should have received a copy of the GNU General Public License along | ||
278 | + with Red Hat elfutils; if not, write to the Free Software Foundation, | ||
279 | + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. | ||
280 | + | ||
281 | + Red Hat elfutils is an included package of the Open Invention Network. | ||
282 | + An included package of the Open Invention Network is a package for which | ||
283 | + Open Invention Network licensees cross-license their patents. No patent | ||
284 | + license is granted, either expressly or impliedly, by designation as an | ||
285 | + included package. Should you wish to participate in the Open Invention | ||
286 | + Network licensing program, please visit www.openinventionnetwork.com | ||
287 | + <http://www.openinventionnetwork.com>. */ | ||
288 | + | ||
289 | +#ifdef HAVE_CONFIG_H | ||
290 | +# include <config.h> | ||
291 | +#endif | ||
292 | + | ||
293 | +#include <string.h> | ||
294 | +#include <assert.h> | ||
295 | +#include <dwarf.h> | ||
296 | +#include <elf.h> | ||
297 | + | ||
298 | +#include "../libebl/libeblP.h" | ||
299 | +#include "../libdw/libdwP.h" | ||
300 | + | ||
301 | +#define BACKEND mips_ | ||
302 | +#include "libebl_CPU.h" | ||
303 | + | ||
304 | +/* The ABI of the file. Also see EF_MIPS_ABI2 above. */ | ||
305 | +#define EF_MIPS_ABI 0x0000F000 | ||
306 | + | ||
307 | +/* The original o32 abi. */ | ||
308 | +#define E_MIPS_ABI_O32 0x00001000 | ||
309 | + | ||
310 | +/* O32 extended to work on 64 bit architectures */ | ||
311 | +#define E_MIPS_ABI_O64 0x00002000 | ||
312 | + | ||
313 | +/* EABI in 32 bit mode */ | ||
314 | +#define E_MIPS_ABI_EABI32 0x00003000 | ||
315 | + | ||
316 | +/* EABI in 64 bit mode */ | ||
317 | +#define E_MIPS_ABI_EABI64 0x00004000 | ||
318 | + | ||
319 | +/* All the possible MIPS ABIs. */ | ||
320 | +enum mips_abi | ||
321 | + { | ||
322 | + MIPS_ABI_UNKNOWN = 0, | ||
323 | + MIPS_ABI_N32, | ||
324 | + MIPS_ABI_O32, | ||
325 | + MIPS_ABI_N64, | ||
326 | + MIPS_ABI_O64, | ||
327 | + MIPS_ABI_EABI32, | ||
328 | + MIPS_ABI_EABI64, | ||
329 | + MIPS_ABI_LAST | ||
330 | + }; | ||
331 | + | ||
332 | +/* Find the mips ABI of the current file */ | ||
333 | +enum mips_abi find_mips_abi(Elf *elf) | ||
334 | +{ | ||
335 | + GElf_Ehdr ehdr_mem; | ||
336 | + GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem); | ||
337 | + | ||
338 | + if (ehdr == NULL) | ||
339 | + return MIPS_ABI_LAST; | ||
340 | + | ||
341 | + GElf_Word elf_flags = ehdr->e_flags; | ||
342 | + | ||
343 | + /* Check elf_flags to see if it specifies the ABI being used. */ | ||
344 | + switch ((elf_flags & EF_MIPS_ABI)) | ||
345 | + { | ||
346 | + case E_MIPS_ABI_O32: | ||
347 | + return MIPS_ABI_O32; | ||
348 | + case E_MIPS_ABI_O64: | ||
349 | + return MIPS_ABI_O64; | ||
350 | + case E_MIPS_ABI_EABI32: | ||
351 | + return MIPS_ABI_EABI32; | ||
352 | + case E_MIPS_ABI_EABI64: | ||
353 | + return MIPS_ABI_EABI64; | ||
354 | + default: | ||
355 | + if ((elf_flags & EF_MIPS_ABI2)) | ||
356 | + return MIPS_ABI_N32; | ||
357 | + } | ||
358 | + | ||
359 | + /* GCC creates a pseudo-section whose name describes the ABI. */ | ||
360 | + size_t shstrndx; | ||
361 | + if (elf_getshdrstrndx (elf, &shstrndx) < 0) | ||
362 | + return MIPS_ABI_LAST; | ||
363 | + | ||
364 | + const char *name; | ||
365 | + Elf_Scn *scn = NULL; | ||
366 | + while ((scn = elf_nextscn (elf, scn)) != NULL) | ||
367 | + { | ||
368 | + GElf_Shdr shdr_mem; | ||
369 | + GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); | ||
370 | + if (shdr == NULL) | ||
371 | + return MIPS_ABI_LAST; | ||
372 | + | ||
373 | + name = elf_strptr (elf, shstrndx, shdr->sh_name) ?: ""; | ||
374 | + if (strncmp (name, ".mdebug.", 8) != 0) | ||
375 | + continue; | ||
376 | + | ||
377 | + if (strcmp (name, ".mdebug.abi32") == 0) | ||
378 | + return MIPS_ABI_O32; | ||
379 | + else if (strcmp (name, ".mdebug.abiN32") == 0) | ||
380 | + return MIPS_ABI_N32; | ||
381 | + else if (strcmp (name, ".mdebug.abi64") == 0) | ||
382 | + return MIPS_ABI_N64; | ||
383 | + else if (strcmp (name, ".mdebug.abiO64") == 0) | ||
384 | + return MIPS_ABI_O64; | ||
385 | + else if (strcmp (name, ".mdebug.eabi32") == 0) | ||
386 | + return MIPS_ABI_EABI32; | ||
387 | + else if (strcmp (name, ".mdebug.eabi64") == 0) | ||
388 | + return MIPS_ABI_EABI64; | ||
389 | + else | ||
390 | + return MIPS_ABI_UNKNOWN; | ||
391 | + } | ||
392 | + | ||
393 | + return MIPS_ABI_UNKNOWN; | ||
394 | +} | ||
395 | + | ||
396 | +unsigned int | ||
397 | +mips_abi_regsize (enum mips_abi abi) | ||
398 | +{ | ||
399 | + switch (abi) | ||
400 | + { | ||
401 | + case MIPS_ABI_EABI32: | ||
402 | + case MIPS_ABI_O32: | ||
403 | + return 4; | ||
404 | + case MIPS_ABI_N32: | ||
405 | + case MIPS_ABI_N64: | ||
406 | + case MIPS_ABI_O64: | ||
407 | + case MIPS_ABI_EABI64: | ||
408 | + return 8; | ||
409 | + case MIPS_ABI_UNKNOWN: | ||
410 | + case MIPS_ABI_LAST: | ||
411 | + default: | ||
412 | + return 0; | ||
413 | + } | ||
414 | +} | ||
415 | + | ||
416 | + | ||
417 | +/* $v0 or pair $v0, $v1 */ | ||
418 | +static const Dwarf_Op loc_intreg_o32[] = | ||
419 | + { | ||
420 | + { .atom = DW_OP_reg2 }, { .atom = DW_OP_piece, .number = 4 }, | ||
421 | + { .atom = DW_OP_reg3 }, { .atom = DW_OP_piece, .number = 4 }, | ||
422 | + }; | ||
423 | + | ||
424 | +static const Dwarf_Op loc_intreg[] = | ||
425 | + { | ||
426 | + { .atom = DW_OP_reg2 }, { .atom = DW_OP_piece, .number = 8 }, | ||
427 | + { .atom = DW_OP_reg3 }, { .atom = DW_OP_piece, .number = 8 }, | ||
428 | + }; | ||
429 | +#define nloc_intreg 1 | ||
430 | +#define nloc_intregpair 4 | ||
431 | + | ||
432 | +/* $f0 (float), or pair $f0, $f1 (double). | ||
433 | + * f2/f3 are used for COMPLEX (= 2 doubles) returns in Fortran */ | ||
434 | +static const Dwarf_Op loc_fpreg_o32[] = | ||
435 | + { | ||
436 | + { .atom = DW_OP_regx, .number = 32 }, { .atom = DW_OP_piece, .number = 4 }, | ||
437 | + { .atom = DW_OP_regx, .number = 33 }, { .atom = DW_OP_piece, .number = 4 }, | ||
438 | + { .atom = DW_OP_regx, .number = 34 }, { .atom = DW_OP_piece, .number = 4 }, | ||
439 | + { .atom = DW_OP_regx, .number = 35 }, { .atom = DW_OP_piece, .number = 4 }, | ||
440 | + }; | ||
441 | + | ||
442 | +/* $f0, or pair $f0, $f2. */ | ||
443 | +static const Dwarf_Op loc_fpreg[] = | ||
444 | + { | ||
445 | + { .atom = DW_OP_regx, .number = 32 }, { .atom = DW_OP_piece, .number = 8 }, | ||
446 | + { .atom = DW_OP_regx, .number = 34 }, { .atom = DW_OP_piece, .number = 8 }, | ||
447 | + }; | ||
448 | +#define nloc_fpreg 1 | ||
449 | +#define nloc_fpregpair 4 | ||
450 | +#define nloc_fpregquad 8 | ||
451 | + | ||
452 | +/* The return value is a structure and is actually stored in stack space | ||
453 | + passed in a hidden argument by the caller. But, the compiler | ||
454 | + helpfully returns the address of that space in $v0. */ | ||
455 | +static const Dwarf_Op loc_aggregate[] = | ||
456 | + { | ||
457 | + { .atom = DW_OP_breg2, .number = 0 } | ||
458 | + }; | ||
459 | +#define nloc_aggregate 1 | ||
460 | + | ||
461 | +int | ||
462 | +mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) | ||
463 | +{ | ||
464 | + /* First find the ABI used by the elf object */ | ||
465 | + enum mips_abi abi = find_mips_abi(functypedie->cu->dbg->elf); | ||
466 | + | ||
467 | + /* Something went seriously wrong while trying to figure out the ABI */ | ||
468 | + if (abi == MIPS_ABI_LAST) | ||
469 | + return -1; | ||
470 | + | ||
471 | + /* We couldn't identify the ABI, but the file seems valid */ | ||
472 | + if (abi == MIPS_ABI_UNKNOWN) | ||
473 | + return -2; | ||
474 | + | ||
475 | + /* Can't handle EABI variants */ | ||
476 | + if ((abi == MIPS_ABI_EABI32) || (abi == MIPS_ABI_EABI64)) | ||
477 | + return -2; | ||
478 | + | ||
479 | + unsigned int regsize = mips_abi_regsize (abi); | ||
480 | + if (!regsize) | ||
481 | + return -2; | ||
482 | + | ||
483 | + /* Start with the function's type, and get the DW_AT_type attribute, | ||
484 | + which is the type of the return value. */ | ||
485 | + | ||
486 | + Dwarf_Attribute attr_mem; | ||
487 | + Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, &attr_mem); | ||
488 | + if (attr == NULL) | ||
489 | + /* The function has no return value, like a `void' function in C. */ | ||
490 | + return 0; | ||
491 | + | ||
492 | + Dwarf_Die die_mem; | ||
493 | + Dwarf_Die *typedie = dwarf_formref_die (attr, &die_mem); | ||
494 | + int tag = dwarf_tag (typedie); | ||
495 | + | ||
496 | + /* Follow typedefs and qualifiers to get to the actual type. */ | ||
497 | + while (tag == DW_TAG_typedef | ||
498 | + || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type | ||
499 | + || tag == DW_TAG_restrict_type) | ||
500 | + { | ||
501 | + attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); | ||
502 | + typedie = dwarf_formref_die (attr, &die_mem); | ||
503 | + tag = dwarf_tag (typedie); | ||
504 | + } | ||
505 | + | ||
506 | + switch (tag) | ||
507 | + { | ||
508 | + case -1: | ||
509 | + return -1; | ||
510 | + | ||
511 | + case DW_TAG_subrange_type: | ||
512 | + if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size)) | ||
513 | + { | ||
514 | + attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); | ||
515 | + typedie = dwarf_formref_die (attr, &die_mem); | ||
516 | + tag = dwarf_tag (typedie); | ||
517 | + } | ||
518 | + /* Fall through. */ | ||
519 | + | ||
520 | + case DW_TAG_base_type: | ||
521 | + case DW_TAG_enumeration_type: | ||
522 | + case DW_TAG_pointer_type: | ||
523 | + case DW_TAG_ptr_to_member_type: | ||
524 | + { | ||
525 | + Dwarf_Word size; | ||
526 | + if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size, | ||
527 | + &attr_mem), &size) != 0) | ||
528 | + { | ||
529 | + if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type) | ||
530 | + size = regsize; | ||
531 | + else | ||
532 | + return -1; | ||
533 | + } | ||
534 | + if (tag == DW_TAG_base_type) | ||
535 | + { | ||
536 | + Dwarf_Word encoding; | ||
537 | + if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding, | ||
538 | + &attr_mem), &encoding) != 0) | ||
539 | + return -1; | ||
540 | + | ||
541 | +#define ABI_LOC(loc, regsize) ((regsize) == 4 ? (loc ## _o32) : (loc)) | ||
542 | + | ||
543 | + if (encoding == DW_ATE_float) | ||
544 | + { | ||
545 | + *locp = ABI_LOC(loc_fpreg, regsize); | ||
546 | + if (size <= regsize) | ||
547 | + return nloc_fpreg; | ||
548 | + | ||
549 | + if (size <= 2*regsize) | ||
550 | + return nloc_fpregpair; | ||
551 | + | ||
552 | + if (size <= 4*regsize && abi == MIPS_ABI_O32) | ||
553 | + return nloc_fpregquad; | ||
554 | + | ||
555 | + goto aggregate; | ||
556 | + } | ||
557 | + } | ||
558 | + *locp = ABI_LOC(loc_intreg, regsize); | ||
559 | + if (size <= regsize) | ||
560 | + return nloc_intreg; | ||
561 | + if (size <= 2*regsize) | ||
562 | + return nloc_intregpair; | ||
563 | + | ||
564 | + /* Else fall through. Shouldn't happen though (at least with gcc) */ | ||
565 | + } | ||
566 | + | ||
567 | + case DW_TAG_structure_type: | ||
568 | + case DW_TAG_class_type: | ||
569 | + case DW_TAG_union_type: | ||
570 | + case DW_TAG_array_type: | ||
571 | + aggregate: | ||
572 | + /* XXX TODO: Can't handle structure return with other ABI's yet :-/ */ | ||
573 | + if ((abi != MIPS_ABI_O32) && (abi != MIPS_ABI_O64)) | ||
574 | + return -2; | ||
575 | + | ||
576 | + *locp = loc_aggregate; | ||
577 | + return nloc_aggregate; | ||
578 | + } | ||
579 | + | ||
580 | + /* XXX We don't have a good way to return specific errors from ebl calls. | ||
581 | + This value means we do not understand the type, but it is well-formed | ||
582 | + DWARF and might be valid. */ | ||
583 | + return -2; | ||
584 | +} | ||
585 | Index: elfutils-0.158/backends/mips_symbol.c | ||
586 | =================================================================== | ||
587 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
588 | +++ elfutils-0.158/backends/mips_symbol.c 2014-04-21 11:13:36.910235965 +0000 | ||
589 | @@ -0,0 +1,52 @@ | ||
590 | +/* MIPS specific symbolic name handling. | ||
591 | + Copyright (C) 2002, 2003, 2005 Red Hat, Inc. | ||
592 | + This file is part of Red Hat elfutils. | ||
593 | + Written by Jakub Jelinek <jakub@redhat.com>, 2002. | ||
594 | + | ||
595 | + Red Hat elfutils is free software; you can redistribute it and/or modify | ||
596 | + it under the terms of the GNU General Public License as published by the | ||
597 | + Free Software Foundation; version 2 of the License. | ||
598 | + | ||
599 | + Red Hat elfutils is distributed in the hope that it will be useful, but | ||
600 | + WITHOUT ANY WARRANTY; without even the implied warranty of | ||
601 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
602 | + General Public License for more details. | ||
603 | + | ||
604 | + You should have received a copy of the GNU General Public License along | ||
605 | + with Red Hat elfutils; if not, write to the Free Software Foundation, | ||
606 | + Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. | ||
607 | + | ||
608 | + Red Hat elfutils is an included package of the Open Invention Network. | ||
609 | + An included package of the Open Invention Network is a package for which | ||
610 | + Open Invention Network licensees cross-license their patents. No patent | ||
611 | + license is granted, either expressly or impliedly, by designation as an | ||
612 | + included package. Should you wish to participate in the Open Invention | ||
613 | + Network licensing program, please visit www.openinventionnetwork.com | ||
614 | + <http://www.openinventionnetwork.com>. */ | ||
615 | + | ||
616 | +#ifdef HAVE_CONFIG_H | ||
617 | +# include <config.h> | ||
618 | +#endif | ||
619 | + | ||
620 | +#include <elf.h> | ||
621 | +#include <stddef.h> | ||
622 | + | ||
623 | +#define BACKEND mips_ | ||
624 | +#include "libebl_CPU.h" | ||
625 | + | ||
626 | +/* Check for the simple reloc types. */ | ||
627 | +Elf_Type | ||
628 | +mips_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type) | ||
629 | +{ | ||
630 | + switch (type) | ||
631 | + { | ||
632 | + case R_MIPS_16: | ||
633 | + return ELF_T_HALF; | ||
634 | + case R_MIPS_32: | ||
635 | + return ELF_T_WORD; | ||
636 | + case R_MIPS_64: | ||
637 | + return ELF_T_XWORD; | ||
638 | + default: | ||
639 | + return ELF_T_NUM; | ||
640 | + } | ||
641 | +} | ||
642 | Index: elfutils-0.158/libebl/eblopenbackend.c | ||
643 | =================================================================== | ||
644 | --- elfutils-0.158.orig/libebl/eblopenbackend.c 2014-04-21 11:13:36.914235875 +0000 | ||
645 | +++ elfutils-0.158/libebl/eblopenbackend.c 2014-04-21 11:13:36.910235965 +0000 | ||
646 | @@ -71,6 +71,8 @@ | ||
647 | { "sparc", "elf_sparc", "sparc", 5, EM_SPARC, 0, 0 }, | ||
648 | { "sparc", "elf_sparcv8plus", "sparc", 5, EM_SPARC32PLUS, 0, 0 }, | ||
649 | { "s390", "ebl_s390", "s390", 4, EM_S390, 0, 0 }, | ||
650 | + { "mips", "elf_mips", "mips", 4, EM_MIPS, 0, 0 }, | ||
651 | + { "mips", "elf_mipsel", "mipsel", 4, EM_MIPS_RS3_LE, 0, 0 }, | ||
652 | |||
653 | { "m32", "elf_m32", "m32", 3, EM_M32, 0, 0 }, | ||
654 | { "m68k", "elf_m68k", "m68k", 4, EM_68K, 0, 0 }, | ||
655 | Index: elfutils-0.158/backends/common-reloc.c | ||
656 | =================================================================== | ||
657 | --- elfutils-0.158.orig/backends/common-reloc.c 2014-04-21 11:13:36.914235875 +0000 | ||
658 | +++ elfutils-0.158/backends/common-reloc.c 2014-04-21 11:13:36.910235965 +0000 | ||
659 | @@ -112,11 +112,13 @@ | ||
660 | } | ||
661 | |||
662 | |||
663 | +#ifndef NO_COPY_RELOC | ||
664 | bool | ||
665 | EBLHOOK(copy_reloc_p) (int reloc) | ||
666 | { | ||
667 | return reloc == R_TYPE (COPY); | ||
668 | } | ||
669 | +#endif | ||
670 | |||
671 | bool | ||
672 | EBLHOOK(none_reloc_p) (int reloc) | ||
673 | @@ -138,7 +140,9 @@ | ||
674 | ebl->reloc_type_name = EBLHOOK(reloc_type_name); | ||
675 | ebl->reloc_type_check = EBLHOOK(reloc_type_check); | ||
676 | ebl->reloc_valid_use = EBLHOOK(reloc_valid_use); | ||
677 | +#ifndef NO_COPY_RELOC | ||
678 | ebl->copy_reloc_p = EBLHOOK(copy_reloc_p); | ||
679 | +#endif | ||
680 | ebl->none_reloc_p = EBLHOOK(none_reloc_p); | ||
681 | #ifndef NO_RELATIVE_RELOC | ||
682 | ebl->relative_reloc_p = EBLHOOK(relative_reloc_p); | ||
683 | Index: elfutils-0.158/backends/Makefile.am | ||
684 | =================================================================== | ||
685 | --- elfutils-0.158.orig/backends/Makefile.am 2014-04-21 11:13:36.914235875 +0000 | ||
686 | +++ elfutils-0.158/backends/Makefile.am 2014-04-21 11:14:10.841468934 +0000 | ||
687 | @@ -33,12 +33,12 @@ | ||
688 | |||
689 | |||
690 | modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \ | ||
691 | - tilegx parisc | ||
692 | + tilegx parisc mips | ||
693 | libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \ | ||
694 | libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \ | ||
695 | libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \ | ||
696 | libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \ | ||
697 | - libebl_parisc_pic.a | ||
698 | + libebl_parisc_pic.a libebl_mips_pic.a | ||
699 | noinst_LIBRARIES = $(libebl_pic) | ||
700 | noinst_DATA = $(libebl_pic:_pic.a=.so) | ||
701 | |||
702 | @@ -121,6 +121,10 @@ | ||
703 | libebl_parisc_pic_a_SOURCES = $(parisc_SRCS) | ||
704 | am_libebl_parisc_pic_a_OBJECTS = $(parisc_SRCS:.c=.os) | ||
705 | |||
706 | +mips_SRCS = mips_init.c mips_symbol.c mips_regs.c mips_retval.c | ||
707 | +libebl_mips_pic_a_SOURCES = $(mips_SRCS) | ||
708 | +am_libebl_mips_pic_a_OBJECTS = $(mips_SRCS:.c=.os) | ||
709 | + | ||
710 | libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw) | ||
711 | @rm -f $(@:.so=.map) | ||
712 | echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' \ | ||
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/mips_readelf_w.patch b/meta/recipes-devtools/elfutils/elfutils-0.163/mips_readelf_w.patch new file mode 100644 index 0000000000..8e669e7199 --- /dev/null +++ b/meta/recipes-devtools/elfutils/elfutils-0.163/mips_readelf_w.patch | |||
@@ -0,0 +1,22 @@ | |||
1 | From: Kurt Roeckx <kurt@roeckx.be> | ||
2 | Subject: Make readelf -w output debug information on mips | ||
3 | Bug-Debian: http://bugs.debian.org/662041 | ||
4 | Forwarded: not-needed | ||
5 | |||
6 | Upstreams wants a change where this is handled by a hook that needs | ||
7 | to be filled in by the backend for the arch. | ||
8 | |||
9 | Index: elfutils-0.153/src/readelf.c | ||
10 | =================================================================== | ||
11 | --- elfutils-0.153.orig/src/readelf.c 2012-08-10 22:01:55.000000000 +0200 | ||
12 | +++ elfutils-0.153/src/readelf.c 2012-09-18 21:46:27.000000000 +0200 | ||
13 | @@ -7364,7 +7364,8 @@ | ||
14 | GElf_Shdr shdr_mem; | ||
15 | GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); | ||
16 | |||
17 | - if (shdr != NULL && shdr->sh_type == SHT_PROGBITS) | ||
18 | + if (shdr != NULL && ( | ||
19 | + (shdr->sh_type == SHT_PROGBITS) || (shdr->sh_type == SHT_MIPS_DWARF))) | ||
20 | { | ||
21 | static const struct | ||
22 | { | ||
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/non_linux.patch b/meta/recipes-devtools/elfutils/elfutils-0.163/non_linux.patch new file mode 100644 index 0000000000..35b1b389fb --- /dev/null +++ b/meta/recipes-devtools/elfutils/elfutils-0.163/non_linux.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | Index: elfutils-0.159/libdwfl/linux-pid-attach.c | ||
2 | =================================================================== | ||
3 | --- elfutils-0.159.orig/libdwfl/linux-pid-attach.c | ||
4 | +++ elfutils-0.159/libdwfl/linux-pid-attach.c | ||
5 | @@ -393,6 +393,16 @@ pid_getthread (Dwfl *dwfl __attribute__ | ||
6 | return false; | ||
7 | } | ||
8 | |||
9 | +bool | ||
10 | +internal_function | ||
11 | +__libdwfl_ptrace_attach (pid_t tid __attribute__ ((unused)), | ||
12 | + bool *tid_was_stoppedp __attribute__ ((unused))) | ||
13 | +{ | ||
14 | + errno = ENOSYS; | ||
15 | + __libdwfl_seterrno (DWFL_E_ERRNO); | ||
16 | + return false; | ||
17 | +} | ||
18 | + | ||
19 | static bool | ||
20 | pid_memory_read (Dwfl *dwfl __attribute__ ((unused)), | ||
21 | Dwarf_Addr addr __attribute__ ((unused)), | ||
22 | @@ -419,6 +429,13 @@ pid_detach (Dwfl *dwfl __attribute__ ((u | ||
23 | { | ||
24 | } | ||
25 | |||
26 | +void | ||
27 | +internal_function | ||
28 | +__libdwfl_ptrace_detach (pid_t tid __attribute__ ((unused)), | ||
29 | + bool tid_was_stopped __attribute__ ((unused))) | ||
30 | +{ | ||
31 | +} | ||
32 | + | ||
33 | static void | ||
34 | pid_thread_detach (Dwfl_Thread *thread __attribute__ ((unused)), | ||
35 | void *thread_arg __attribute__ ((unused))) | ||
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/redhat-portability.diff b/meta/recipes-devtools/elfutils/elfutils-0.163/redhat-portability.diff new file mode 100644 index 0000000000..a0ff07d397 --- /dev/null +++ b/meta/recipes-devtools/elfutils/elfutils-0.163/redhat-portability.diff | |||
@@ -0,0 +1,1021 @@ | |||
1 | Rebase to 1.162 | ||
2 | |||
3 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
4 | --- | ||
5 | ChangeLog | 30 +++++++++++++++++++++ | ||
6 | backends/ChangeLog | 12 +++++++++ | ||
7 | backends/Makefile.am | 2 +- | ||
8 | config/ChangeLog | 4 +++ | ||
9 | config/eu.am | 14 +++++++--- | ||
10 | configure.ac | 61 +++++++++++++++++++++++++++++++++++++++++-- | ||
11 | lib/ChangeLog | 8 ++++++ | ||
12 | lib/eu-config.h | 10 +++++++ | ||
13 | libasm/ChangeLog | 5 ++++ | ||
14 | libcpu/ChangeLog | 8 ++++++ | ||
15 | libcpu/i386_disasm.c | 1 + | ||
16 | libdw/ChangeLog | 13 +++++++++ | ||
17 | libdw/dwarf_begin_elf.c | 8 ++++++ | ||
18 | libdw/libdw.h | 2 +- | ||
19 | libdwfl/ChangeLog | 20 ++++++++++++++ | ||
20 | libdwfl/linux-core-attach.c | 29 ++++++++++++++++++++ | ||
21 | libdwfl/linux-pid-attach.c | 14 ++++++++++ | ||
22 | libebl/ChangeLog | 5 ++++ | ||
23 | libelf/ChangeLog | 10 +++++++ | ||
24 | libelf/common.h | 4 +-- | ||
25 | libelf/gnuhash_xlate.h | 6 +++-- | ||
26 | src/ChangeLog | 30 +++++++++++++++++++++ | ||
27 | src/Makefile.am | 5 ++++ | ||
28 | src/addr2line.c | 4 +-- | ||
29 | src/findtextrel.c | 6 ++++- | ||
30 | src/ld.h | 2 ++ | ||
31 | src/readelf.c | 15 +++++++---- | ||
32 | src/strings.c | 11 ++++++++ | ||
33 | src/strip.c | 6 +++++ | ||
34 | tests/ChangeLog | 14 ++++++++++ | ||
35 | tests/Makefile.am | 1 + | ||
36 | tests/backtrace.c | 1 + | ||
37 | tests/line2addr.c | 2 +- | ||
38 | 33 files changed, 343 insertions(+), 20 deletions(-) | ||
39 | |||
40 | diff --git a/ChangeLog b/ChangeLog | ||
41 | index d829783..89bfd24 100644 | ||
42 | --- a/ChangeLog | ||
43 | +++ b/ChangeLog | ||
44 | @@ -253,6 +253,8 @@ | ||
45 | |||
46 | 2012-01-24 Mark Wielaard <mjw@redhat.com> | ||
47 | |||
48 | + * configure.ac: Wrap AC_COMPILE_IFELSE sources in AC_LANG_SOURCE. | ||
49 | + | ||
50 | * COPYING: Fix address. Updated version from gnulib. | ||
51 | |||
52 | 2012-01-23 Mark Wielaard <mjw@redhat.com> | ||
53 | @@ -271,6 +273,9 @@ | ||
54 | |||
55 | 2011-10-08 Mike Frysinger <vapier@gentoo.org> | ||
56 | |||
57 | + * configure.ac (--disable-werror): Handle it, controlling BUILD_WERROR | ||
58 | + automake option. | ||
59 | + | ||
60 | * configure.ac: Fix use of AC_ARG_ENABLE to handle $enableval correctly. | ||
61 | |||
62 | 2011-10-02 Ulrich Drepper <drepper@gmail.com> | ||
63 | @@ -292,6 +297,10 @@ | ||
64 | |||
65 | * configure.ac (LOCALEDIR, DATADIRNAME): Removed. | ||
66 | |||
67 | +2009-11-22 Roland McGrath <roland@redhat.com> | ||
68 | + | ||
69 | + * configure.ac: Use sed and expr instead of modern bash extensions. | ||
70 | + | ||
71 | 2009-09-21 Ulrich Drepper <drepper@redhat.com> | ||
72 | |||
73 | * configure.ac: Update for more modern autoconf. | ||
74 | @@ -300,6 +309,10 @@ | ||
75 | |||
76 | * configure.ac (zip_LIBS): Check for liblzma too. | ||
77 | |||
78 | +2009-08-17 Roland McGrath <roland@redhat.com> | ||
79 | + | ||
80 | + * configure.ac: Check for -fgnu89-inline; add it to WEXTRA if it works. | ||
81 | + | ||
82 | 2009-04-19 Roland McGrath <roland@redhat.com> | ||
83 | |||
84 | * configure.ac (eu_version): Round down here, not in version.h macros. | ||
85 | @@ -311,6 +324,8 @@ | ||
86 | |||
87 | 2009-01-23 Roland McGrath <roland@redhat.com> | ||
88 | |||
89 | + * configure.ac: Check for __builtin_popcount. | ||
90 | + | ||
91 | * configure.ac (zlib check): Check for gzdirect, need zlib >= 1.2.2.3. | ||
92 | |||
93 | * configure.ac (__thread check): Use AC_LINK_IFELSE, in case of | ||
94 | @@ -391,6 +406,10 @@ | ||
95 | * configure.ac: Add dummy automake conditional to get dependencies | ||
96 | for non-generic linker right. See src/Makefile.am. | ||
97 | |||
98 | +2005-11-22 Roland McGrath <roland@redhat.com> | ||
99 | + | ||
100 | + * configure.ac: Check for --as-needed linker option. | ||
101 | + | ||
102 | 2005-11-18 Roland McGrath <roland@redhat.com> | ||
103 | |||
104 | * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable. | ||
105 | @@ -438,6 +457,17 @@ | ||
106 | * Makefile.am (all_SUBDIRS): Add libdwfl. | ||
107 | * configure.ac: Write libdwfl/Makefile. | ||
108 | |||
109 | +2005-05-31 Roland McGrath <roland@redhat.com> | ||
110 | + | ||
111 | + * configure.ac (WEXTRA): Check for -Wextra and set this substitution. | ||
112 | + | ||
113 | + * configure.ac: Check for struct stat st_?tim members. | ||
114 | + * src/strip.c (process_file): Use st_?time if st_?tim are not there. | ||
115 | + | ||
116 | + * configure.ac: Check for futimes function. | ||
117 | + * src/strip.c (handle_elf) [! HAVE_FUTIMES]: Use utimes instead. | ||
118 | + (handle_ar) [! HAVE_FUTIMES]: Likewise. | ||
119 | + | ||
120 | 2005-05-19 Roland McGrath <roland@redhat.com> | ||
121 | |||
122 | * configure.ac [AH_BOTTOM] (INTDECL, _INTDECL): New macros. | ||
123 | diff --git a/backends/ChangeLog b/backends/ChangeLog | ||
124 | index fe61d9c..9599623 100644 | ||
125 | --- a/backends/ChangeLog | ||
126 | +++ b/backends/ChangeLog | ||
127 | @@ -498,6 +498,10 @@ | ||
128 | * ppc_attrs.c (ppc_check_object_attribute): Handle tag | ||
129 | GNU_Power_ABI_Struct_Return. | ||
130 | |||
131 | +2009-01-23 Roland McGrath <roland@redhat.com> | ||
132 | + | ||
133 | + * Makefile.am (libebl_%.so): Use $(LD_AS_NEEDED). | ||
134 | + | ||
135 | 2008-10-04 Ulrich Drepper <drepper@redhat.com> | ||
136 | |||
137 | * i386_reloc.def: Fix entries for TLS_GOTDESC, TLS_DESC_CALL, and | ||
138 | @@ -825,6 +829,11 @@ | ||
139 | * sparc_init.c: Likewise. | ||
140 | * x86_64_init.c: Likewise. | ||
141 | |||
142 | +2005-11-22 Roland McGrath <roland@redhat.com> | ||
143 | + | ||
144 | + * Makefile.am (LD_AS_NEEDED): New variable, substituted by configure. | ||
145 | + (libebl_%.so rule): Use it in place of -Wl,--as-needed. | ||
146 | + | ||
147 | 2005-11-19 Roland McGrath <roland@redhat.com> | ||
148 | |||
149 | * ppc64_reloc.def: REL30 -> ADDR30. | ||
150 | @@ -847,6 +856,9 @@ | ||
151 | * Makefile.am (uninstall): Don't try to remove $(pkgincludedir). | ||
152 | (CLEANFILES): Add libebl_$(m).so. | ||
153 | |||
154 | + * Makefile.am (WEXTRA): New variable, substituted by configure. | ||
155 | + (AM_CFLAGS): Use it in place of -Wextra. | ||
156 | + | ||
157 | * ppc_reloc.def: Update bits per Alan Modra <amodra@bigpond.net.au>. | ||
158 | * ppc64_reloc.def: Likewise. | ||
159 | |||
160 | diff --git a/backends/Makefile.am b/backends/Makefile.am | ||
161 | index 21d7bd2..fe920c9 100644 | ||
162 | --- a/backends/Makefile.am | ||
163 | +++ b/backends/Makefile.am | ||
164 | @@ -119,7 +119,7 @@ libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw) | ||
165 | $(LINK) -shared -o $(@:.map=.so) \ | ||
166 | -Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \ | ||
167 | -Wl,--version-script,$(@:.so=.map) \ | ||
168 | - -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) | ||
169 | + -Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) | ||
170 | @$(textrel_check) | ||
171 | |||
172 | libebl_i386.so: $(cpu_i386) | ||
173 | diff --git a/config/ChangeLog b/config/ChangeLog | ||
174 | index 64b58e1..63b3e90 100644 | ||
175 | --- a/config/ChangeLog | ||
176 | +++ b/config/ChangeLog | ||
177 | @@ -106,6 +106,10 @@ | ||
178 | |||
179 | * known-dwarf.awk: Use gawk. | ||
180 | |||
181 | +2011-10-08 Mike Frysinger <vapier@gentoo.org> | ||
182 | + | ||
183 | + * eu.am [BUILD_WERROR]: Conditionalize -Werror use on this. | ||
184 | + | ||
185 | 2010-07-02 Ulrich Drepper <drepper@redhat.com> | ||
186 | |||
187 | * elfutils.spec.in: Add more BuildRequires. | ||
188 | diff --git a/config/eu.am b/config/eu.am | ||
189 | index 70d32de..65af085 100644 | ||
190 | --- a/config/eu.am | ||
191 | +++ b/config/eu.am | ||
192 | @@ -1,6 +1,6 @@ | ||
193 | ## Common automake fragments for elfutils subdirectory makefiles. | ||
194 | ## | ||
195 | -## Copyright (C) 2010, 2014 Red Hat, Inc. | ||
196 | +## Copyright (C) 2010-2011, 2014 Red Hat, Inc. | ||
197 | ## | ||
198 | ## This file is part of elfutils. | ||
199 | ## | ||
200 | @@ -29,6 +29,9 @@ | ||
201 | ## not, see <http://www.gnu.org/licenses/>. | ||
202 | ## | ||
203 | |||
204 | +WEXTRA = @WEXTRA@ | ||
205 | +LD_AS_NEEDED = @LD_AS_NEEDED@ | ||
206 | + | ||
207 | DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"' | ||
208 | AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. | ||
209 | |||
210 | @@ -38,12 +41,17 @@ STACK_USAGE_WARNING=-Wstack-usage=262144 | ||
211 | else | ||
212 | STACK_USAGE_WARNING= | ||
213 | endif | ||
214 | -AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \ | ||
215 | +AM_CFLAGS = -std=gnu99 -Wall -Wshadow \ | ||
216 | $(if $($(*F)_no_Werror),,-Werror) \ | ||
217 | - $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \ | ||
218 | + $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \ | ||
219 | + $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \ | ||
220 | $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \ | ||
221 | $($(*F)_CFLAGS) | ||
222 | |||
223 | +if BUILD_WERROR | ||
224 | +AM_CFLAGS += $(if $($(*F)_no_Werror),,-Werror) | ||
225 | +endif | ||
226 | + | ||
227 | COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE)) | ||
228 | |||
229 | DEFS.os = -DPIC -DSHARED | ||
230 | diff --git a/configure.ac b/configure.ac | ||
231 | index bc9ff56..27a1ef3 100644 | ||
232 | --- a/configure.ac | ||
233 | +++ b/configure.ac | ||
234 | @@ -106,6 +106,55 @@ CFLAGS="$old_CFLAGS"]) | ||
235 | AS_IF([test "x$ac_cv_c99" != xyes], | ||
236 | AC_MSG_ERROR([gcc with GNU99 support required])) | ||
237 | |||
238 | +AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra, [dnl | ||
239 | +old_CFLAGS="$CFLAGS" | ||
240 | +CFLAGS="$CFLAGS -Wextra" | ||
241 | +AC_COMPILE_IFELSE([AC_LANG_SOURCE([void foo (void) { }])], | ||
242 | + ac_cv_cc_wextra=yes, ac_cv_cc_wextra=no) | ||
243 | +CFLAGS="$old_CFLAGS"]) | ||
244 | +AC_SUBST(WEXTRA) | ||
245 | +AS_IF([test "x$ac_cv_cc_wextra" = xyes], [WEXTRA=-Wextra], [WEXTRA=-W]) | ||
246 | + | ||
247 | +AC_CACHE_CHECK([for -fgnu89-inline option to $CC], ac_cv_cc_gnu89_inline, [dnl | ||
248 | +old_CFLAGS="$CFLAGS" | ||
249 | +CFLAGS="$CFLAGS -fgnu89-inline -Werror" | ||
250 | +AC_COMPILE_IFELSE([AC_LANG_SOURCE([ | ||
251 | +void foo (void) | ||
252 | +{ | ||
253 | + inline void bar (void) {} | ||
254 | + bar (); | ||
255 | +} | ||
256 | +extern inline void baz (void) {} | ||
257 | +])], ac_cv_cc_gnu89_inline=yes, ac_cv_cc_gnu89_inline=no) | ||
258 | +CFLAGS="$old_CFLAGS"]) | ||
259 | +AS_IF([test "x$ac_cv_cc_gnu89_inline" = xyes], | ||
260 | + [WEXTRA="${WEXTRA:+$WEXTRA }-fgnu89-inline"]) | ||
261 | + | ||
262 | +AC_CACHE_CHECK([for --as-needed linker option], | ||
263 | + ac_cv_as_needed, [dnl | ||
264 | +cat > conftest.c <<EOF | ||
265 | +int main (void) { return 0; } | ||
266 | +EOF | ||
267 | +if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS | ||
268 | + -fPIC -shared -o conftest.so conftest.c | ||
269 | + -Wl,--as-needed 1>&AS_MESSAGE_LOG_FD]) | ||
270 | +then | ||
271 | + ac_cv_as_needed=yes | ||
272 | +else | ||
273 | + ac_cv_as_needed=no | ||
274 | +fi | ||
275 | +rm -f conftest*]) | ||
276 | +AS_IF([test "x$ac_cv_as_needed" = xyes], | ||
277 | + [LD_AS_NEEDED=-Wl,--as-needed], [LD_AS_NEEDED=]) | ||
278 | +AC_SUBST(LD_AS_NEEDED) | ||
279 | + | ||
280 | +AC_CACHE_CHECK([for __builtin_popcount], ac_cv_popcount, [dnl | ||
281 | +AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[exit (__builtin_popcount (127));]])], | ||
282 | + ac_cv_popcount=yes, ac_cv_popcount=no)]) | ||
283 | +AS_IF([test "x$ac_cv_popcount" = xyes], | ||
284 | + [AC_DEFINE([HAVE_BUILTIN_POPCOUNT], [1], [Have __builtin_popcount.])]) | ||
285 | + | ||
286 | + | ||
287 | AC_CACHE_CHECK([for __thread support], ac_cv_tls, [dnl | ||
288 | # Use the same flags that we use for our DSOs, so the test is representative. | ||
289 | # Some old compiler/linker/libc combinations fail some ways and not others. | ||
290 | @@ -122,7 +171,10 @@ static __thread int a; int foo (int b) { return a + b; }]], | ||
291 | CFLAGS="$save_CFLAGS" | ||
292 | LDFLAGS="$save_LDFLAGS"]) | ||
293 | AS_IF([test "x$ac_cv_tls" != xyes], | ||
294 | - AC_MSG_ERROR([__thread support required])) | ||
295 | + [AS_IF([test "$use_locks" = yes], | ||
296 | + [AC_MSG_ERROR([--enable-thread-safety requires __thread support])], | ||
297 | + [AC_DEFINE([__thread], [/* empty: no multi-thread support */], | ||
298 | + [Stubbed out if missing compiler support.])])]) | ||
299 | |||
300 | dnl This test must come as early as possible after the compiler configuration | ||
301 | dnl tests, because the choice of the file model can (in principle) affect | ||
302 | @@ -224,6 +276,11 @@ AM_CONDITIONAL(USE_VALGRIND, test "$use_valgrind" = yes) | ||
303 | AM_CONDITIONAL(BUILD_STATIC, [dnl | ||
304 | test "$use_gprof" = yes -o "$use_gcov" = yes]) | ||
305 | |||
306 | +AC_ARG_ENABLE([werror], | ||
307 | +AS_HELP_STRING([--disable-werror],[do not build with -Werror]), | ||
308 | + [enable_werror=$enableval], [enable_werror=yes]) | ||
309 | +AM_CONDITIONAL(BUILD_WERROR, test "$enable_werror" = yes) | ||
310 | + | ||
311 | AC_ARG_ENABLE([tests-rpath], | ||
312 | AS_HELP_STRING([--enable-tests-rpath],[build $ORIGIN-using rpath into tests]), | ||
313 | [tests_use_rpath=$enableval], [tests_use_rpath=no]) | ||
314 | @@ -388,7 +445,7 @@ case "$eu_version" in | ||
315 | esac | ||
316 | |||
317 | # Round up to the next release API (x.y) version. | ||
318 | -eu_version=$(( (eu_version + 999) / 1000 )) | ||
319 | +eu_version=`expr \( $eu_version + 999 \) / 1000` | ||
320 | |||
321 | dnl Unique ID for this build. | ||
322 | MODVERSION="Build for ${LIBEBL_SUBDIR} ${eu_version} ${ac_cv_build}" | ||
323 | diff --git a/lib/ChangeLog b/lib/ChangeLog | ||
324 | index d04bf17..720c98d 100644 | ||
325 | --- a/lib/ChangeLog | ||
326 | +++ b/lib/ChangeLog | ||
327 | @@ -73,6 +73,9 @@ | ||
328 | |||
329 | 2009-01-23 Roland McGrath <roland@redhat.com> | ||
330 | |||
331 | + * eu-config.h [! HAVE_BUILTIN_POPCOUNT] | ||
332 | + (__builtin_popcount): New inline function. | ||
333 | + | ||
334 | * eu-config.h: Add multiple inclusion protection. | ||
335 | |||
336 | 2009-01-17 Ulrich Drepper <drepper@redhat.com> | ||
337 | @@ -129,6 +132,11 @@ | ||
338 | * Makefile.am (libeu_a_SOURCES): Add it. | ||
339 | * system.h: Declare crc32_file. | ||
340 | |||
341 | +2005-02-07 Roland McGrath <roland@redhat.com> | ||
342 | + | ||
343 | + * Makefile.am (WEXTRA): New variable, substituted by configure. | ||
344 | + (AM_CFLAGS): Use it in place of -Wextra. | ||
345 | + | ||
346 | 2005-04-30 Ulrich Drepper <drepper@redhat.com> | ||
347 | |||
348 | * Makefile.am: Use -ffunction-sections for xmalloc.c. | ||
349 | diff --git a/lib/eu-config.h b/lib/eu-config.h | ||
350 | index 400cdc6..872f6bc 100644 | ||
351 | --- a/lib/eu-config.h | ||
352 | +++ b/lib/eu-config.h | ||
353 | @@ -163,6 +163,16 @@ asm (".section predict_data, \"aw\"; .previous\n" | ||
354 | /* This macro is used by the tests conditionalize for standalone building. */ | ||
355 | #define ELFUTILS_HEADER(name) <lib##name.h> | ||
356 | |||
357 | +#ifndef HAVE_BUILTIN_POPCOUNT | ||
358 | +# define __builtin_popcount hakmem_popcount | ||
359 | +static inline unsigned int __attribute__ ((unused)) | ||
360 | +hakmem_popcount (unsigned int x) | ||
361 | +{ | ||
362 | + /* HAKMEM 169 */ | ||
363 | + unsigned int n = x - ((x >> 1) & 033333333333) - ((x >> 2) & 011111111111); | ||
364 | + return ((n + (n >> 3)) & 030707070707) % 63; | ||
365 | +} | ||
366 | +#endif /* HAVE_BUILTIN_POPCOUNT */ | ||
367 | |||
368 | #ifdef SYMBOL_VERSIONING | ||
369 | # define OLD_VERSION(name, version) \ | ||
370 | diff --git a/libasm/ChangeLog b/libasm/ChangeLog | ||
371 | index 9b25af9..32b9fd0 100644 | ||
372 | --- a/libasm/ChangeLog | ||
373 | +++ b/libasm/ChangeLog | ||
374 | @@ -87,6 +87,11 @@ | ||
375 | * asm_error.c: Add new error ASM_E_IOERROR. | ||
376 | * libasmP.h: Add ASM_E_IOERROR definition. | ||
377 | |||
378 | +2005-05-31 Roland McGrath <roland@redhat.com> | ||
379 | + | ||
380 | + * Makefile.am (WEXTRA): New variable, substituted by configure. | ||
381 | + (AM_CFLAGS): Use it in place of -Wextra. | ||
382 | + | ||
383 | 2005-02-15 Ulrich Drepper <drepper@redhat.com> | ||
384 | |||
385 | * Makefile.am (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2. | ||
386 | diff --git a/libcpu/ChangeLog b/libcpu/ChangeLog | ||
387 | index a20f440..5ea23b7 100644 | ||
388 | --- a/libcpu/ChangeLog | ||
389 | +++ b/libcpu/ChangeLog | ||
390 | @@ -51,6 +51,9 @@ | ||
391 | |||
392 | 2009-01-23 Roland McGrath <roland@redhat.com> | ||
393 | |||
394 | + * i386_disasm.c (i386_disasm): Add abort after assert-constant for old | ||
395 | + compilers that don't realize it's noreturn. | ||
396 | + | ||
397 | * Makefile.am (i386_parse_CFLAGS): Use quotes around command | ||
398 | substitution that can produce leading whitespace. | ||
399 | |||
400 | @@ -380,6 +383,11 @@ | ||
401 | * defs/i386.doc: New file. | ||
402 | * defs/x86_64: New file. | ||
403 | |||
404 | +2005-04-04 Roland McGrath <roland@redhat.com> | ||
405 | + | ||
406 | + * Makefile.am (WEXTRA): New variable, substituted by configure. | ||
407 | + (AM_CFLAGS): Use it instead of -Wextra. | ||
408 | + | ||
409 | 2005-02-15 Ulrich Drepper <drepper@redhat.com> | ||
410 | |||
411 | * Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2. | ||
412 | diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c | ||
413 | index 832241f..c7a0df0 100644 | ||
414 | --- a/libcpu/i386_disasm.c | ||
415 | +++ b/libcpu/i386_disasm.c | ||
416 | @@ -822,6 +822,7 @@ i386_disasm (const uint8_t **startp, const uint8_t *end, GElf_Addr addr, | ||
417 | |||
418 | default: | ||
419 | assert (! "INVALID not handled"); | ||
420 | + abort (); | ||
421 | } | ||
422 | } | ||
423 | else | ||
424 | diff --git a/libdw/ChangeLog b/libdw/ChangeLog | ||
425 | index 487e34a..06c737b 100644 | ||
426 | --- a/libdw/ChangeLog | ||
427 | +++ b/libdw/ChangeLog | ||
428 | @@ -889,6 +889,10 @@ | ||
429 | |||
430 | * Makefile.am (known-dwarf.h): Run gawk on config/known-dwarf.awk. | ||
431 | |||
432 | +2011-07-20 Mark Wielaard <mjw@redhat.com> | ||
433 | + | ||
434 | + * dwarf_begin_elf.c: Add fallback for be64toh if not defined. | ||
435 | + | ||
436 | 2011-07-14 Mark Wielaard <mjw@redhat.com> | ||
437 | |||
438 | * libdw.h (dwarf_offdie): Fix documentation to mention .debug_info. | ||
439 | @@ -1248,6 +1252,10 @@ | ||
440 | |||
441 | * dwarf_hasattr_integrate.c: Integrate DW_AT_specification too. | ||
442 | |||
443 | +2009-08-17 Roland McGrath <roland@redhat.com> | ||
444 | + | ||
445 | + * libdw.h: Disable extern inlines for GCC 4.2. | ||
446 | + | ||
447 | 2009-08-10 Roland McGrath <roland@redhat.com> | ||
448 | |||
449 | * dwarf_getscopevar.c: Use dwarf_diename. | ||
450 | @@ -2016,6 +2024,11 @@ | ||
451 | |||
452 | 2005-05-31 Roland McGrath <roland@redhat.com> | ||
453 | |||
454 | + * Makefile.am (WEXTRA): New variable, substituted by configure. | ||
455 | + (AM_CFLAGS): Use it in place of -Wextra. | ||
456 | + | ||
457 | +2005-05-31 Roland McGrath <roland@redhat.com> | ||
458 | + | ||
459 | * dwarf_formref_die.c (dwarf_formref_die): Add CU header offset to | ||
460 | formref offset. | ||
461 | |||
462 | diff --git a/libdw/dwarf_begin_elf.c b/libdw/dwarf_begin_elf.c | ||
463 | index 4e0d590..a6616a1 100644 | ||
464 | --- a/libdw/dwarf_begin_elf.c | ||
465 | +++ b/libdw/dwarf_begin_elf.c | ||
466 | @@ -47,6 +47,14 @@ | ||
467 | #if USE_ZLIB | ||
468 | # include <endian.h> | ||
469 | # define crc32 loser_crc32 | ||
470 | +# ifndef be64toh | ||
471 | +# include <byteswap.h> | ||
472 | +# if __BYTE_ORDER == __LITTLE_ENDIAN | ||
473 | +# define be64toh(x) bswap_64 (x) | ||
474 | +# else | ||
475 | +# define be64toh(x) (x) | ||
476 | +# endif | ||
477 | +# endif | ||
478 | # include <zlib.h> | ||
479 | # undef crc32 | ||
480 | #endif | ||
481 | diff --git a/libdw/libdw.h b/libdw/libdw.h | ||
482 | index 473e1a2..5a511cd 100644 | ||
483 | --- a/libdw/libdw.h | ||
484 | +++ b/libdw/libdw.h | ||
485 | @@ -1004,7 +1004,7 @@ extern Dwarf_OOM dwarf_new_oom_handler (Dwarf *dbg, Dwarf_OOM handler); | ||
486 | |||
487 | |||
488 | /* Inline optimizations. */ | ||
489 | -#ifdef __OPTIMIZE__ | ||
490 | +#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2) | ||
491 | /* Return attribute code of given attribute. */ | ||
492 | __libdw_extern_inline unsigned int | ||
493 | dwarf_whatattr (Dwarf_Attribute *attr) | ||
494 | diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog | ||
495 | index a5253e2..59abfac 100644 | ||
496 | --- a/libdwfl/ChangeLog | ||
497 | +++ b/libdwfl/ChangeLog | ||
498 | @@ -704,6 +704,21 @@ | ||
499 | (dwfl_module_addrsym) (i_to_symfile): New function. | ||
500 | (dwfl_module_addrsym) (search_table): Use it. | ||
501 | |||
502 | +2013-11-09 Jan Kratochvil <jan.kratochvil@redhat.com> | ||
503 | + | ||
504 | + Older OS compatibility bits. | ||
505 | + * linux-core-attach.c (be64toh, le64toh, be32toh, le32toh): Provide | ||
506 | + fallbacks if not defined by system. | ||
507 | + | ||
508 | +2013-11-09 Jan Kratochvil <jan.kratochvil@redhat.com> | ||
509 | + | ||
510 | + Handle T-stopped detach for old kernels. | ||
511 | + * linux-pid-attach.c (struct pid_arg): New field stopped. | ||
512 | + (ptrace_attach): New parameter stoppedp. Set it appropriately. | ||
513 | + (pid_set_initial_registers): Pass the new field. | ||
514 | + (pid_thread_detach): Handle the case of STOPPED for old kernels. | ||
515 | + (__libdwfl_attach_state_for_pid): Initialize STOPPED. | ||
516 | + | ||
517 | 2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com> | ||
518 | Mark Wielaard <mjw@redhat.com> | ||
519 | |||
520 | @@ -2469,6 +2484,11 @@ | ||
521 | |||
522 | 2005-07-21 Roland McGrath <roland@redhat.com> | ||
523 | |||
524 | + * Makefile.am (WEXTRA): New variable, substituted by configure. | ||
525 | + (AM_CFLAGS): Use it in place of -Wextra. | ||
526 | + | ||
527 | +2005-07-21 Roland McGrath <roland@redhat.com> | ||
528 | + | ||
529 | * Makefile.am (noinst_HEADERS): Add loc2c.c. | ||
530 | |||
531 | * test2.c (main): Check sscanf result to quiet warning. | ||
532 | diff --git a/libdwfl/linux-core-attach.c b/libdwfl/linux-core-attach.c | ||
533 | index 5a7b3b3..d05ac7e 100644 | ||
534 | --- a/libdwfl/linux-core-attach.c | ||
535 | +++ b/libdwfl/linux-core-attach.c | ||
536 | @@ -29,6 +29,35 @@ | ||
537 | #include "libdwflP.h" | ||
538 | #include <fcntl.h> | ||
539 | #include "system.h" | ||
540 | +#include <endian.h> | ||
541 | +#include <byteswap.h> | ||
542 | +#if __BYTE_ORDER == __LITTLE_ENDIAN | ||
543 | +# ifndef be64toh | ||
544 | +# define be64toh(x) bswap_64 (x) | ||
545 | +# endif | ||
546 | +# ifndef le64toh | ||
547 | +# define le64toh(x) (x) | ||
548 | +# endif | ||
549 | +# ifndef be32toh | ||
550 | +# define be32toh(x) bswap_32 (x) | ||
551 | +# endif | ||
552 | +# ifndef le32toh | ||
553 | +# define le32toh(x) (x) | ||
554 | +# endif | ||
555 | +#else | ||
556 | +# ifndef be64toh | ||
557 | +# define be64toh(x) (x) | ||
558 | +# endif | ||
559 | +# ifndef le64toh | ||
560 | +# define le64toh(x) bswap_64 (x) | ||
561 | +# endif | ||
562 | +# ifndef be32toh | ||
563 | +# define be32toh(x) (x) | ||
564 | +# endif | ||
565 | +# ifndef le32toh | ||
566 | +# define le32toh(x) bswap_32 (x) | ||
567 | +# endif | ||
568 | +#endif | ||
569 | |||
570 | #include "../libdw/memory-access.h" | ||
571 | |||
572 | diff --git a/libdwfl/linux-pid-attach.c b/libdwfl/linux-pid-attach.c | ||
573 | index ae71702..076b2c3 100644 | ||
574 | --- a/libdwfl/linux-pid-attach.c | ||
575 | +++ b/libdwfl/linux-pid-attach.c | ||
576 | @@ -255,6 +255,11 @@ void | ||
577 | internal_function | ||
578 | __libdwfl_ptrace_detach (pid_t tid, bool tid_was_stopped) | ||
579 | { | ||
580 | + // Older kernels (tested kernel-2.6.18-348.12.1.el5.x86_64) need special | ||
581 | + // handling of the detachment to keep the process State: T (stopped). | ||
582 | + if (tid_was_stopped) | ||
583 | + syscall (__NR_tkill, tid, SIGSTOP); | ||
584 | + | ||
585 | /* This handling is needed only on older Linux kernels such as | ||
586 | 2.6.32-358.23.2.el6.ppc64. Later kernels such as | ||
587 | 3.11.7-200.fc19.x86_64 remember the T (stopped) state | ||
588 | @@ -262,6 +267,15 @@ __libdwfl_ptrace_detach (pid_t tid, bool tid_was_stopped) | ||
589 | PTRACE_DETACH. */ | ||
590 | ptrace (PTRACE_DETACH, tid, NULL, | ||
591 | (void *) (intptr_t) (tid_was_stopped ? SIGSTOP : 0)); | ||
592 | + | ||
593 | + if (tid_was_stopped) | ||
594 | + { | ||
595 | + // Wait till the SIGSTOP settles down. | ||
596 | + int i; | ||
597 | + for (i = 0; i < 100000; i++) | ||
598 | + if (linux_proc_pid_is_stopped (tid)) | ||
599 | + break; | ||
600 | + } | ||
601 | } | ||
602 | |||
603 | static void | ||
604 | diff --git a/libebl/ChangeLog b/libebl/ChangeLog | ||
605 | index 51ae60f..aee0217 100644 | ||
606 | --- a/libebl/ChangeLog | ||
607 | +++ b/libebl/ChangeLog | ||
608 | @@ -780,6 +780,11 @@ | ||
609 | * Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency | ||
610 | tracking works right. | ||
611 | |||
612 | +2005-05-31 Roland McGrath <roland@redhat.com> | ||
613 | + | ||
614 | + * Makefile.am (WEXTRA): New variable, substituted by configure. | ||
615 | + (AM_CFLAGS): Use it in place of -Wextra. | ||
616 | + | ||
617 | 2005-05-21 Ulrich Drepper <drepper@redhat.com> | ||
618 | |||
619 | * libebl_x86_64.map: Add x86_64_core_note. | ||
620 | diff --git a/libelf/ChangeLog b/libelf/ChangeLog | ||
621 | index 30017cd..9ca9c73 100644 | ||
622 | --- a/libelf/ChangeLog | ||
623 | +++ b/libelf/ChangeLog | ||
624 | @@ -398,6 +398,11 @@ | ||
625 | |||
626 | * elf-knowledge.h (SECTION_STRIP_P): Remove < SHT_NUM check. | ||
627 | |||
628 | +2011-03-10 Roland McGrath <roland@redhat.com> | ||
629 | + | ||
630 | + * gnuhash_xlate.h (elf_cvt_gnuhash): Avoid post-increment in bswap_32 | ||
631 | + argument, since some implementations are buggy macros. | ||
632 | + | ||
633 | 2011-02-26 Mark Wielaard <mjw@redhat.com> | ||
634 | |||
635 | * elf_end.c (elf_end): Call rwlock_unlock before rwlock_fini. | ||
636 | @@ -1075,6 +1080,11 @@ | ||
637 | |||
638 | * elf.h: Update from glibc. | ||
639 | |||
640 | +2005-05-31 Roland McGrath <roland@redhat.com> | ||
641 | + | ||
642 | + * Makefile.am (WEXTRA): New variable, substituted by configure. | ||
643 | + (AM_CFLAGS): Use it in place of -Wextra. | ||
644 | + | ||
645 | 2005-05-08 Roland McGrath <roland@redhat.com> | ||
646 | |||
647 | * elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now. | ||
648 | diff --git a/libelf/common.h b/libelf/common.h | ||
649 | index 744f1bb..185ea59 100644 | ||
650 | --- a/libelf/common.h | ||
651 | +++ b/libelf/common.h | ||
652 | @@ -139,7 +139,7 @@ libelf_release_all (Elf *elf) | ||
653 | (Var) = (sizeof (Var) == 1 \ | ||
654 | ? (unsigned char) (Var) \ | ||
655 | : (sizeof (Var) == 2 \ | ||
656 | - ? bswap_16 (Var) \ | ||
657 | + ? (unsigned short int) bswap_16 (Var) \ | ||
658 | : (sizeof (Var) == 4 \ | ||
659 | ? bswap_32 (Var) \ | ||
660 | : bswap_64 (Var)))) | ||
661 | @@ -148,7 +148,7 @@ libelf_release_all (Elf *elf) | ||
662 | (Dst) = (sizeof (Var) == 1 \ | ||
663 | ? (unsigned char) (Var) \ | ||
664 | : (sizeof (Var) == 2 \ | ||
665 | - ? bswap_16 (Var) \ | ||
666 | + ? (unsigned short int) bswap_16 (Var) \ | ||
667 | : (sizeof (Var) == 4 \ | ||
668 | ? bswap_32 (Var) \ | ||
669 | : bswap_64 (Var)))) | ||
670 | diff --git a/libelf/gnuhash_xlate.h b/libelf/gnuhash_xlate.h | ||
671 | index 04d9ca1..3e25936 100644 | ||
672 | --- a/libelf/gnuhash_xlate.h | ||
673 | +++ b/libelf/gnuhash_xlate.h | ||
674 | @@ -1,5 +1,5 @@ | ||
675 | /* Conversion functions for versioning information. | ||
676 | - Copyright (C) 2006, 2007 Red Hat, Inc. | ||
677 | + Copyright (C) 2006-2011 Red Hat, Inc. | ||
678 | This file is part of elfutils. | ||
679 | Written by Ulrich Drepper <drepper@redhat.com>, 2006. | ||
680 | |||
681 | @@ -69,7 +69,9 @@ elf_cvt_gnuhash (void *dest, const void *src, size_t len, int encode) | ||
682 | dest32 = (Elf32_Word *) &dest64[bitmask_words]; | ||
683 | while (len >= 4) | ||
684 | { | ||
685 | - *dest32++ = bswap_32 (*src32++); | ||
686 | + *dest32 = bswap_32 (*src32); | ||
687 | + ++dest32; | ||
688 | + ++src32; | ||
689 | len -= 4; | ||
690 | } | ||
691 | } | ||
692 | diff --git a/src/ChangeLog b/src/ChangeLog | ||
693 | index 15e6fae..78535c8 100644 | ||
694 | --- a/src/ChangeLog | ||
695 | +++ b/src/ChangeLog | ||
696 | @@ -1598,8 +1598,16 @@ | ||
697 | * readelf.c (attr_callback): Use print_block only when we don't use | ||
698 | print_ops. | ||
699 | |||
700 | +2009-08-17 Roland McGrath <roland@redhat.com> | ||
701 | + | ||
702 | + * ld.h: Disable extern inlines for GCC 4.2. | ||
703 | + | ||
704 | 2009-08-14 Roland McGrath <roland@redhat.com> | ||
705 | |||
706 | + * strings.c (read_block): Conditionalize posix_fadvise use | ||
707 | + on [POSIX_FADV_SEQUENTIAL]. | ||
708 | + From Petr Salinger <Petr.Salinger@seznam.cz>. | ||
709 | + | ||
710 | * ar.c (do_oper_extract): Use pathconf instead of statfs. | ||
711 | |||
712 | 2009-08-01 Ulrich Drepper <drepper@redhat.com> | ||
713 | @@ -1763,6 +1771,8 @@ | ||
714 | * readelf.c (print_debug_frame_section): Use t instead of j formats | ||
715 | for ptrdiff_t OFFSET. | ||
716 | |||
717 | + * addr2line.c (handle_address): Use %a instead of %m for compatibility. | ||
718 | + | ||
719 | 2009-01-21 Ulrich Drepper <drepper@redhat.com> | ||
720 | |||
721 | * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section | ||
722 | @@ -1946,6 +1956,11 @@ | ||
723 | that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really | ||
724 | is valid in RELRO. | ||
725 | |||
726 | +2008-03-01 Roland McGrath <roland@redhat.com> | ||
727 | + | ||
728 | + * readelf.c (dump_archive_index): Tweak portability hack | ||
729 | + to match [__GNUC__ < 4] too. | ||
730 | + | ||
731 | 2008-02-29 Roland McGrath <roland@redhat.com> | ||
732 | |||
733 | * readelf.c (print_attributes): Add a cast. | ||
734 | @@ -2197,6 +2212,8 @@ | ||
735 | |||
736 | * readelf.c (hex_dump): Fix rounding error in whitespace calculation. | ||
737 | |||
738 | + * Makefile.am (readelf_no_Werror): New variable. | ||
739 | + | ||
740 | 2007-10-15 Roland McGrath <roland@redhat.com> | ||
741 | |||
742 | * make-debug-archive.in: New file. | ||
743 | @@ -2636,6 +2653,10 @@ | ||
744 | * elflint.c (valid_e_machine): Add EM_ALPHA. | ||
745 | Reported by Christian Aichinger <Greek0@gmx.net>. | ||
746 | |||
747 | + * strings.c (map_file): Define POSIX_MADV_SEQUENTIAL to | ||
748 | + MADV_SEQUENTIAL if undefined. Don't call posix_madvise | ||
749 | + if neither is defined. | ||
750 | + | ||
751 | 2006-08-08 Ulrich Drepper <drepper@redhat.com> | ||
752 | |||
753 | * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB. | ||
754 | @@ -2712,6 +2733,10 @@ | ||
755 | * Makefile.am: Add hacks to create dependency files for non-generic | ||
756 | linker. | ||
757 | |||
758 | +2006-04-05 Roland McGrath <roland@redhat.com> | ||
759 | + | ||
760 | + * strings.c (MAP_POPULATE): Define to 0 if undefined. | ||
761 | + | ||
762 | 2006-06-12 Ulrich Drepper <drepper@redhat.com> | ||
763 | |||
764 | * ldgeneric.c (ld_generic_generate_sections): Don't create .interp | ||
765 | @@ -3060,6 +3085,11 @@ | ||
766 | * readelf.c (print_debug_loc_section): Fix indentation for larger | ||
767 | address size. | ||
768 | |||
769 | +2005-05-31 Roland McGrath <roland@redhat.com> | ||
770 | + | ||
771 | + * Makefile.am (WEXTRA): New variable, substituted by configure. | ||
772 | + (AM_CFLAGS): Use it in place of -Wextra. | ||
773 | + | ||
774 | 2005-05-30 Roland McGrath <roland@redhat.com> | ||
775 | |||
776 | * readelf.c (print_debug_line_section): Print section offset of each | ||
777 | diff --git a/src/Makefile.am b/src/Makefile.am | ||
778 | index dbac3eb..9028aa1 100644 | ||
779 | --- a/src/Makefile.am | ||
780 | +++ b/src/Makefile.am | ||
781 | @@ -90,6 +90,11 @@ endif | ||
782 | ldgeneric_no_Wunused = yes | ||
783 | ldgeneric_no_Wstack_usage = yes | ||
784 | |||
785 | +# Buggy old compilers or libc headers. | ||
786 | +readelf_no_Werror = yes | ||
787 | +strings_no_Werror = yes | ||
788 | +addr2line_no_Wformat = yes | ||
789 | + | ||
790 | # Bad, bad stack usage... | ||
791 | readelf_no_Wstack_usage = yes | ||
792 | nm_no_Wstack_usage = yes | ||
793 | diff --git a/src/addr2line.c b/src/addr2line.c | ||
794 | index 0ce854f..d2d0c8c 100644 | ||
795 | --- a/src/addr2line.c | ||
796 | +++ b/src/addr2line.c | ||
797 | @@ -622,10 +622,10 @@ handle_address (const char *string, Dwfl *dwfl) | ||
798 | bool parsed = false; | ||
799 | int i, j; | ||
800 | char *name = NULL; | ||
801 | - if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2 | ||
802 | + if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2 | ||
803 | && string[i] == '\0') | ||
804 | parsed = adjust_to_section (name, &addr, dwfl); | ||
805 | - switch (sscanf (string, "%m[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j)) | ||
806 | + switch (sscanf (string, "%a[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j)) | ||
807 | { | ||
808 | default: | ||
809 | break; | ||
810 | diff --git a/src/findtextrel.c b/src/findtextrel.c | ||
811 | index 264a06b..d7de202 100644 | ||
812 | --- a/src/findtextrel.c | ||
813 | +++ b/src/findtextrel.c | ||
814 | @@ -502,7 +502,11 @@ ptrcompare (const void *p1, const void *p2) | ||
815 | |||
816 | |||
817 | static void | ||
818 | -check_rel (size_t nsegments, struct segments segments[nsegments], | ||
819 | +check_rel (size_t nsegments, struct segments segments[ | ||
820 | +#if __GNUC__ >= 4 | ||
821 | + nsegments | ||
822 | +#endif | ||
823 | + ], | ||
824 | GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw, | ||
825 | const char *fname, bool more_than_one, void **knownsrcs) | ||
826 | { | ||
827 | diff --git a/src/ld.h b/src/ld.h | ||
828 | index 29f4031..8695c31 100644 | ||
829 | --- a/src/ld.h | ||
830 | +++ b/src/ld.h | ||
831 | @@ -1114,6 +1114,7 @@ extern bool dynamically_linked_p (void); | ||
832 | |||
833 | /* Checked whether the symbol is undefined and referenced from a DSO. */ | ||
834 | extern bool linked_from_dso_p (struct scninfo *scninfo, size_t symidx); | ||
835 | +#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2) | ||
836 | #ifdef __GNUC_STDC_INLINE__ | ||
837 | __attribute__ ((__gnu_inline__)) | ||
838 | #endif | ||
839 | @@ -1131,5 +1132,6 @@ linked_from_dso_p (struct scninfo *scninfo, size_t symidx) | ||
840 | |||
841 | return sym->defined && sym->in_dso; | ||
842 | } | ||
843 | +#endif /* Optimizing and not GCC 4.2. */ | ||
844 | |||
845 | #endif /* ld.h */ | ||
846 | diff --git a/src/readelf.c b/src/readelf.c | ||
847 | index b4cb3a8..606d220 100644 | ||
848 | --- a/src/readelf.c | ||
849 | +++ b/src/readelf.c | ||
850 | @@ -4364,10 +4364,12 @@ listptr_base (struct listptr *p) | ||
851 | return base; | ||
852 | } | ||
853 | |||
854 | +static const char *listptr_name; | ||
855 | + | ||
856 | static int | ||
857 | -compare_listptr (const void *a, const void *b, void *arg) | ||
858 | +compare_listptr (const void *a, const void *b) | ||
859 | { | ||
860 | - const char *name = arg; | ||
861 | + const char *const name = listptr_name; | ||
862 | struct listptr *p1 = (void *) a; | ||
863 | struct listptr *p2 = (void *) b; | ||
864 | |||
865 | @@ -4463,8 +4465,11 @@ static void | ||
866 | sort_listptr (struct listptr_table *table, const char *name) | ||
867 | { | ||
868 | if (table->n > 0) | ||
869 | - qsort_r (table->table, table->n, sizeof table->table[0], | ||
870 | - &compare_listptr, (void *) name); | ||
871 | + { | ||
872 | + listptr_name = name; | ||
873 | + qsort (table->table, table->n, sizeof table->table[0], | ||
874 | + &compare_listptr); | ||
875 | + } | ||
876 | } | ||
877 | |||
878 | static bool | ||
879 | @@ -9561,7 +9566,7 @@ dump_archive_index (Elf *elf, const char *fname) | ||
880 | if (unlikely (elf_rand (elf, as_off) == 0) | ||
881 | || unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf)) | ||
882 | == NULL)) | ||
883 | -#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7) | ||
884 | +#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7) || __GNUC__ < 4 | ||
885 | while (1) | ||
886 | #endif | ||
887 | error (EXIT_FAILURE, 0, | ||
888 | diff --git a/src/strings.c b/src/strings.c | ||
889 | index b2bce7b..fe0ab6c 100644 | ||
890 | --- a/src/strings.c | ||
891 | +++ b/src/strings.c | ||
892 | @@ -43,6 +43,10 @@ | ||
893 | |||
894 | #include <system.h> | ||
895 | |||
896 | +#ifndef MAP_POPULATE | ||
897 | +# define MAP_POPULATE 0 | ||
898 | +#endif | ||
899 | + | ||
900 | |||
901 | /* Prototypes of local functions. */ | ||
902 | static int read_fd (int fd, const char *fname, off64_t fdlen); | ||
903 | @@ -489,8 +493,13 @@ map_file (int fd, off64_t start_off, off64_t fdlen, size_t *map_sizep) | ||
904 | fd, start_off); | ||
905 | if (mem != MAP_FAILED) | ||
906 | { | ||
907 | +#if !defined POSIX_MADV_SEQUENTIAL && defined MADV_SEQUENTIAL | ||
908 | +# define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL | ||
909 | +#endif | ||
910 | +#ifdef POSIX_MADV_SEQUENTIAL | ||
911 | /* We will go through the mapping sequentially. */ | ||
912 | (void) posix_madvise (mem, map_size, POSIX_MADV_SEQUENTIAL); | ||
913 | +#endif | ||
914 | break; | ||
915 | } | ||
916 | if (errno != EINVAL && errno != ENOMEM) | ||
917 | @@ -581,9 +590,11 @@ read_block (int fd, const char *fname, off64_t fdlen, off64_t from, off64_t to) | ||
918 | elfmap_off = from & ~(ps - 1); | ||
919 | elfmap_base = elfmap = map_file (fd, elfmap_off, fdlen, &elfmap_size); | ||
920 | |||
921 | +#ifdef POSIX_FADV_SEQUENTIAL | ||
922 | if (unlikely (elfmap == MAP_FAILED)) | ||
923 | /* Let the kernel know we are going to read everything in sequence. */ | ||
924 | (void) posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL); | ||
925 | +#endif | ||
926 | } | ||
927 | |||
928 | if (unlikely (elfmap == MAP_FAILED)) | ||
929 | diff --git a/src/strip.c b/src/strip.c | ||
930 | index 5e69334..8bd1790 100644 | ||
931 | --- a/src/strip.c | ||
932 | +++ b/src/strip.c | ||
933 | @@ -44,6 +44,12 @@ | ||
934 | #include <libebl.h> | ||
935 | #include <system.h> | ||
936 | |||
937 | +#ifdef HAVE_FUTIMES | ||
938 | +# define FUTIMES(fd, fname, tvp) futimes (fd, tvp) | ||
939 | +#else | ||
940 | +# define FUTIMES(fd, fname, tvp) utimes (fname, tvp) | ||
941 | +#endif | ||
942 | + | ||
943 | typedef uint8_t GElf_Byte; | ||
944 | |||
945 | /* Name and version of program. */ | ||
946 | diff --git a/tests/ChangeLog b/tests/ChangeLog | ||
947 | index 19878ac..6815028 100644 | ||
948 | --- a/tests/ChangeLog | ||
949 | +++ b/tests/ChangeLog | ||
950 | @@ -609,6 +609,13 @@ | ||
951 | |||
952 | 2013-12-02 Jan Kratochvil <jan.kratochvil@redhat.com> | ||
953 | |||
954 | + Handle T-stopped detach for old kernels. | ||
955 | + * backtrace.c: Include sys/syscall.h. | ||
956 | + (linux_proc_pid_is_stopped): New function. | ||
957 | + (ptrace_detach_stopped): Handle old kernels. | ||
958 | + | ||
959 | +2013-12-02 Jan Kratochvil <jan.kratochvil@redhat.com> | ||
960 | + | ||
961 | * Makefile.am (check_PROGRAMS): Add backtrace, backtrace-child, | ||
962 | backtrace-data and backtrace-dwarf. | ||
963 | (BUILT_SOURCES, clean-local, backtrace-child-biarch): New. | ||
964 | @@ -1473,6 +1480,8 @@ | ||
965 | |||
966 | 2008-01-21 Roland McGrath <roland@redhat.com> | ||
967 | |||
968 | + * line2addr.c (main): Revert last change. | ||
969 | + | ||
970 | * testfile45.S.bz2: Add tests for cltq, cqto. | ||
971 | * testfile45.expect.bz2: Adjust. | ||
972 | |||
973 | @@ -2181,6 +2190,11 @@ | ||
974 | * Makefile.am (TESTS): Add run-elflint-test.sh. | ||
975 | (EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2. | ||
976 | |||
977 | +2005-05-31 Roland McGrath <roland@redhat.com> | ||
978 | + | ||
979 | + * Makefile.am (WEXTRA): New variable, substituted by configure. | ||
980 | + (AM_CFLAGS): Use it in place of -Wextra. | ||
981 | + | ||
982 | 2005-05-24 Ulrich Drepper <drepper@redhat.com> | ||
983 | |||
984 | * get-files.c (main): Use correct format specifier. | ||
985 | diff --git a/tests/Makefile.am b/tests/Makefile.am | ||
986 | index 425f8cd..69760a4 100644 | ||
987 | --- a/tests/Makefile.am | ||
988 | +++ b/tests/Makefile.am | ||
989 | @@ -382,6 +382,7 @@ get_lines_LDADD = $(libdw) $(libelf) | ||
990 | get_files_LDADD = $(libdw) $(libelf) | ||
991 | get_aranges_LDADD = $(libdw) $(libelf) | ||
992 | allfcts_LDADD = $(libdw) $(libelf) | ||
993 | +line2addr_no_Wformat = yes | ||
994 | line2addr_LDADD = $(libdw) $(argp_LDADD) | ||
995 | addrscopes_LDADD = $(libdw) $(argp_LDADD) | ||
996 | funcscopes_LDADD = $(libdw) $(argp_LDADD) | ||
997 | diff --git a/tests/backtrace.c b/tests/backtrace.c | ||
998 | index abd56ab..6a7c661 100644 | ||
999 | --- a/tests/backtrace.c | ||
1000 | +++ b/tests/backtrace.c | ||
1001 | @@ -36,6 +36,7 @@ | ||
1002 | #include <fcntl.h> | ||
1003 | #include <string.h> | ||
1004 | #include <argp.h> | ||
1005 | +#include <sys/syscall.h> | ||
1006 | #include ELFUTILS_HEADER(dwfl) | ||
1007 | |||
1008 | #ifndef __linux__ | ||
1009 | diff --git a/tests/line2addr.c b/tests/line2addr.c | ||
1010 | index e0d65d3..7c171b9 100644 | ||
1011 | --- a/tests/line2addr.c | ||
1012 | +++ b/tests/line2addr.c | ||
1013 | @@ -124,7 +124,7 @@ main (int argc, char *argv[]) | ||
1014 | { | ||
1015 | struct args a = { .arg = argv[cnt] }; | ||
1016 | |||
1017 | - switch (sscanf (a.arg, "%m[^:]:%d", &a.file, &a.line)) | ||
1018 | + switch (sscanf (a.arg, "%a[^:]:%d", &a.file, &a.line)) | ||
1019 | { | ||
1020 | default: | ||
1021 | case 0: | ||
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/scanf-format.patch b/meta/recipes-devtools/elfutils/elfutils-0.163/scanf-format.patch new file mode 100644 index 0000000000..c08519cf53 --- /dev/null +++ b/meta/recipes-devtools/elfutils/elfutils-0.163/scanf-format.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | From: Kurt Roeckx <kurt@roeckx.be> | ||
2 | Subject: Use %m[ instead of %a[ in scanf() | ||
3 | |||
4 | %a was a gnu extention, but C99 made this a float. So it got | ||
5 | changed to %m (supported by glibc 2.7), but %a[ and %as are | ||
6 | still supported by glibc. The portability branch changed this | ||
7 | from %m to %a again since that's supported by more versions of | ||
8 | glibc. However gcc gives a warning about this using -Wformat | ||
9 | and we have a new enough libc to use %m. | ||
10 | |||
11 | Index: elfutils-0.153/src/addr2line.c | ||
12 | =================================================================== | ||
13 | --- elfutils-0.153.orig/src/addr2line.c 2012-02-24 22:29:50.000000000 +0000 | ||
14 | +++ elfutils-0.153/src/addr2line.c 2012-02-24 22:29:52.000000000 +0000 | ||
15 | @@ -455,10 +455,10 @@ | ||
16 | bool parsed = false; | ||
17 | int i, j; | ||
18 | char *name = NULL; | ||
19 | - if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2 | ||
20 | + if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2 | ||
21 | && string[i] == '\0') | ||
22 | parsed = adjust_to_section (name, &addr, dwfl); | ||
23 | - switch (sscanf (string, "%a[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j)) | ||
24 | + switch (sscanf (string, "%m[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j)) | ||
25 | { | ||
26 | default: | ||
27 | break; | ||
28 | Index: elfutils-0.153/tests/line2addr.c | ||
29 | =================================================================== | ||
30 | --- elfutils-0.153.orig/tests/line2addr.c 2012-02-24 22:29:50.000000000 +0000 | ||
31 | +++ elfutils-0.153/tests/line2addr.c 2012-02-24 22:29:52.000000000 +0000 | ||
32 | @@ -132,7 +132,7 @@ | ||
33 | { | ||
34 | struct args a = { .arg = argv[cnt] }; | ||
35 | |||
36 | - switch (sscanf (a.arg, "%a[^:]:%d", &a.file, &a.line)) | ||
37 | + switch (sscanf (a.arg, "%m[^:]:%d", &a.file, &a.line)) | ||
38 | { | ||
39 | default: | ||
40 | case 0: | ||
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/testsuite-ignore-elflint.diff b/meta/recipes-devtools/elfutils/elfutils-0.163/testsuite-ignore-elflint.diff new file mode 100644 index 0000000000..eae5796de3 --- /dev/null +++ b/meta/recipes-devtools/elfutils/elfutils-0.163/testsuite-ignore-elflint.diff | |||
@@ -0,0 +1,39 @@ | |||
1 | On many architectures this test fails because binaries/libs produced by | ||
2 | binutils don't pass elflint. However elfutils shouldn't FTBFS because of this. | ||
3 | |||
4 | So we run the tests on all archs to see what breaks, but if it breaks we ignore | ||
5 | the result (exitcode 77 means: this test was skipped). | ||
6 | |||
7 | Index: elfutils-0.156/tests/run-elflint-self.sh | ||
8 | =================================================================== | ||
9 | --- elfutils-0.156.orig/tests/run-elflint-self.sh 2013-07-28 14:35:36.000000000 +0200 | ||
10 | +++ elfutils-0.156/tests/run-elflint-self.sh 2013-07-28 14:36:10.000000000 +0200 | ||
11 | @@ -18,4 +18,4 @@ | ||
12 | |||
13 | . $srcdir/test-subr.sh | ||
14 | |||
15 | -testrun_on_self ${abs_top_builddir}/src/elflint --quiet --gnu-ld | ||
16 | +testrun_on_self_skip ${abs_top_builddir}/src/elflint --quiet --gnu-ld | ||
17 | Index: elfutils-0.156/tests/test-subr.sh | ||
18 | =================================================================== | ||
19 | --- elfutils-0.156.orig/tests/test-subr.sh 2013-07-28 14:35:36.000000000 +0200 | ||
20 | +++ elfutils-0.156/tests/test-subr.sh 2013-07-28 14:35:36.000000000 +0200 | ||
21 | @@ -149,3 +149,18 @@ | ||
22 | # Only exit if something failed | ||
23 | if test $exit_status != 0; then exit $exit_status; fi | ||
24 | } | ||
25 | + | ||
26 | +# Same as testrun_on_self(), but skip on failure. | ||
27 | +testrun_on_self_skip() | ||
28 | +{ | ||
29 | + exit_status=0 | ||
30 | + | ||
31 | + for file in $self_test_files; do | ||
32 | + testrun $* $file \ | ||
33 | + || { echo "*** failure in $* $file"; exit_status=77; } | ||
34 | + done | ||
35 | + | ||
36 | + # Only exit if something failed | ||
37 | + if test $exit_status != 0; then exit $exit_status; fi | ||
38 | +} | ||
39 | + | ||
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/uclibc-support-for-elfutils-0.161.patch b/meta/recipes-devtools/elfutils/elfutils-0.163/uclibc-support-for-elfutils-0.161.patch new file mode 100644 index 0000000000..f1533bfd38 --- /dev/null +++ b/meta/recipes-devtools/elfutils/elfutils-0.163/uclibc-support-for-elfutils-0.161.patch | |||
@@ -0,0 +1,106 @@ | |||
1 | From 3daec2dd11a04955f95e8f65a48820103d84dbec Mon Sep 17 00:00:00 2001 | ||
2 | From: Junling Zheng <zhengjunling@huawei.com> | ||
3 | Date: Thu, 9 Apr 2015 12:12:49 +0000 | ||
4 | Subject: [PATCH] uclibc support for elfutils 0.161 | ||
5 | |||
6 | on uclibc systems libintl and libuargp are separate from libc. | ||
7 | so they need to be specified on commandline when we use proxy-libintl | ||
8 | then libintl is a static archive so it should be listed last since | ||
9 | elfutils does not respect disable-nls we need to link in libintl | ||
10 | |||
11 | We add a new option --enable-uclibc which will be used to control | ||
12 | the uclibc specific configurations during build. | ||
13 | |||
14 | Upstream-Status: Inappropriate [uclibc specific] | ||
15 | |||
16 | Signed-off-by: Khem Raj <raj.khem> | ||
17 | Signed-off-by: Junling Zheng <zhengjunling@huawei.com> | ||
18 | [Junling Zheng: | ||
19 | - adjust context | ||
20 | ] | ||
21 | --- | ||
22 | configure.ac | 8 ++++++++ | ||
23 | libcpu/Makefile.am | 4 ++++ | ||
24 | libdw/Makefile.am | 7 ++++++- | ||
25 | libelf/Makefile.am | 5 +++++ | ||
26 | 4 files changed, 23 insertions(+), 1 deletion(-) | ||
27 | |||
28 | diff --git a/configure.ac b/configure.ac | ||
29 | index a1ad6db..81fc33f 100644 | ||
30 | --- a/configure.ac | ||
31 | +++ b/configure.ac | ||
32 | @@ -70,6 +70,14 @@ AS_IF([test "$use_locks" = yes], | ||
33 | |||
34 | AH_TEMPLATE([USE_LOCKS], [Defined if libraries should be thread-safe.]) | ||
35 | |||
36 | +AC_ARG_ENABLE([uclibc], | ||
37 | +AS_HELP_STRING([--enable-uclibc], [Use uclibc for system libraries]), | ||
38 | +use_uclibc=yes, use_uclibc=no) | ||
39 | +AM_CONDITIONAL(USE_UCLIBC, test "$use_uclibc" = yes) | ||
40 | +AS_IF([test "$use_uclibc" = yes], [AC_DEFINE(USE_UCLIBC)]) | ||
41 | + | ||
42 | +AH_TEMPLATE([USE_UCLIBC], [Defined if uclibc libraries are used.]) | ||
43 | + | ||
44 | AC_PROG_CC | ||
45 | AC_PROG_RANLIB | ||
46 | AC_PROG_YACC | ||
47 | diff --git a/libcpu/Makefile.am b/libcpu/Makefile.am | ||
48 | index 3beccf3..9ba6c04 100644 | ||
49 | --- a/libcpu/Makefile.am | ||
50 | +++ b/libcpu/Makefile.am | ||
51 | @@ -80,6 +80,10 @@ i386_parse_CFLAGS = -DNMNES="`wc -l < i386.mnemonics`" | ||
52 | i386_lex.o: i386_parse.h | ||
53 | i386_gendis_LDADD = $(libeu) -lm | ||
54 | |||
55 | +if USE_UCLIBC | ||
56 | +i386_gendis_LDADD += -luargp -lintl | ||
57 | +endif | ||
58 | + | ||
59 | i386_parse.h: i386_parse.c ; | ||
60 | |||
61 | EXTRA_DIST = defs/i386 | ||
62 | diff --git a/libdw/Makefile.am b/libdw/Makefile.am | ||
63 | index 887da6b..d31b428 100644 | ||
64 | --- a/libdw/Makefile.am | ||
65 | +++ b/libdw/Makefile.am | ||
66 | @@ -102,6 +102,11 @@ endif | ||
67 | libdw_pic_a_SOURCES = | ||
68 | am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os) | ||
69 | |||
70 | +libdw_so_LDLIBS = | ||
71 | +if USE_UCLIBC | ||
72 | +libdw_so_LDLIBS += -lintl -luargp | ||
73 | +endif | ||
74 | + | ||
75 | libdw_so_SOURCES = | ||
76 | libdw.so$(EXEEXT): $(srcdir)/libdw.map libdw_pic.a ../libdwelf/libdwelf_pic.a \ | ||
77 | ../libdwfl/libdwfl_pic.a ../libebl/libebl.a \ | ||
78 | @@ -112,7 +117,7 @@ libdw.so$(EXEEXT): $(srcdir)/libdw.map libdw_pic.a ../libdwelf/libdwelf_pic.a \ | ||
79 | -Wl,--enable-new-dtags,-rpath,$(pkglibdir) \ | ||
80 | -Wl,--version-script,$<,--no-undefined \ | ||
81 | -Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\ | ||
82 | - -ldl $(zip_LIBS) | ||
83 | + -ldl $(zip_LIBS) $(libdw_so_LDLIBS) | ||
84 | @$(textrel_check) | ||
85 | ln -fs $@ $@.$(VERSION) | ||
86 | |||
87 | diff --git a/libelf/Makefile.am b/libelf/Makefile.am | ||
88 | index afcb2aa..02836a1 100644 | ||
89 | --- a/libelf/Makefile.am | ||
90 | +++ b/libelf/Makefile.am | ||
91 | @@ -93,7 +93,12 @@ libelf_a_SOURCES = elf_version.c elf_hash.c elf_error.c elf_fill.c \ | ||
92 | libelf_pic_a_SOURCES = | ||
93 | am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os) | ||
94 | |||
95 | + | ||
96 | libelf_so_LDLIBS = | ||
97 | +if USE_UCLIBC | ||
98 | +libelf_so_LDLIBS += -lintl -luargp | ||
99 | +endif | ||
100 | + | ||
101 | if USE_LOCKS | ||
102 | libelf_so_LDLIBS += -lpthread | ||
103 | endif | ||
104 | -- | ||
105 | 1.8.3.4 | ||
106 | |||