elfutils: bump to 0.169
[openwrt/openwrt.git] / package / libs / elfutils / patches / 100-musl-compat.patch
1 https://sourceware.org/bugzilla/show_bug.cgi?id=21002
2
3 Index: elfutils-0.169/lib/system.h
4 ===================================================================
5 --- elfutils-0.169.orig/lib/system.h
6 +++ elfutils-0.169/lib/system.h
7 @@ -29,7 +29,18 @@
8 #ifndef LIB_SYSTEM_H
9 #define LIB_SYSTEM_H 1
10
11 +#ifdef HAVE_ERROR_H
12 +#include "error.h"
13 +#else
14 +#include "err.h"
15 #include <errno.h>
16 +#include <stdio.h>
17 +#define error(status, errno, ...) \
18 + fflush(stdout); \
19 + warn(__VA_ARGS__); \
20 + if (status) exit(status)
21 +#endif
22 +
23 #include <stddef.h>
24 #include <stdint.h>
25 #include <sys/param.h>
26 @@ -37,6 +48,10 @@
27 #include <byteswap.h>
28 #include <unistd.h>
29
30 +#ifndef __GLIBC__
31 +#define canonicalize_file_name(name) realpath(name,NULL)
32 +#endif
33 +
34 #if __BYTE_ORDER == __LITTLE_ENDIAN
35 # define LE32(n) (n)
36 # define LE64(n) (n)
37 Index: elfutils-0.169/lib/color.c
38 ===================================================================
39 --- elfutils-0.169.orig/lib/color.c
40 +++ elfutils-0.169/lib/color.c
41 @@ -32,13 +32,13 @@
42 #endif
43
44 #include <argp.h>
45 -#include <error.h>
46 #include <libintl.h>
47 #include <stdlib.h>
48 #include <string.h>
49 #include <unistd.h>
50 #include "libeu.h"
51 #include "color.h"
52 +#include "system.h"
53
54 /* Prototype for option handler. */
55 static error_t parse_opt (int key, char *arg, struct argp_state *state);
56 Index: elfutils-0.169/lib/xmalloc.c
57 ===================================================================
58 --- elfutils-0.169.orig/lib/xmalloc.c
59 +++ elfutils-0.169/lib/xmalloc.c
60 @@ -30,7 +30,6 @@
61 # include <config.h>
62 #endif
63
64 -#include <error.h>
65 #include <libintl.h>
66 #include <stddef.h>
67 #include <stdlib.h>
68 Index: elfutils-0.169/src/addr2line.c
69 ===================================================================
70 --- elfutils-0.169.orig/src/addr2line.c
71 +++ elfutils-0.169/src/addr2line.c
72 @@ -23,7 +23,6 @@
73 #include <argp.h>
74 #include <assert.h>
75 #include <errno.h>
76 -#include <error.h>
77 #include <fcntl.h>
78 #include <inttypes.h>
79 #include <libdwfl.h>
80 Index: elfutils-0.169/src/ar.c
81 ===================================================================
82 --- elfutils-0.169.orig/src/ar.c
83 +++ elfutils-0.169/src/ar.c
84 @@ -22,7 +22,6 @@
85
86 #include <argp.h>
87 #include <assert.h>
88 -#include <error.h>
89 #include <fcntl.h>
90 #include <gelf.h>
91 #include <libintl.h>
92 Index: elfutils-0.169/src/arlib2.c
93 ===================================================================
94 --- elfutils-0.169.orig/src/arlib2.c
95 +++ elfutils-0.169/src/arlib2.c
96 @@ -20,7 +20,6 @@
97 # include <config.h>
98 #endif
99
100 -#include <error.h>
101 #include <libintl.h>
102 #include <limits.h>
103 #include <string.h>
104 Index: elfutils-0.169/src/arlib.c
105 ===================================================================
106 --- elfutils-0.169.orig/src/arlib.c
107 +++ elfutils-0.169/src/arlib.c
108 @@ -21,7 +21,6 @@
109 #endif
110
111 #include <assert.h>
112 -#include <error.h>
113 #include <gelf.h>
114 #include <inttypes.h>
115 #include <libintl.h>
116 Index: elfutils-0.169/src/elfcmp.c
117 ===================================================================
118 --- elfutils-0.169.orig/src/elfcmp.c
119 +++ elfutils-0.169/src/elfcmp.c
120 @@ -23,7 +23,6 @@
121 #include <argp.h>
122 #include <assert.h>
123 #include <errno.h>
124 -#include <error.h>
125 #include <fcntl.h>
126 #include <locale.h>
127 #include <libintl.h>
128 Index: elfutils-0.169/src/elflint.c
129 ===================================================================
130 --- elfutils-0.169.orig/src/elflint.c
131 +++ elfutils-0.169/src/elflint.c
132 @@ -24,7 +24,6 @@
133 #include <assert.h>
134 #include <byteswap.h>
135 #include <endian.h>
136 -#include <error.h>
137 #include <fcntl.h>
138 #include <gelf.h>
139 #include <inttypes.h>
140 Index: elfutils-0.169/src/findtextrel.c
141 ===================================================================
142 --- elfutils-0.169.orig/src/findtextrel.c
143 +++ elfutils-0.169/src/findtextrel.c
144 @@ -23,7 +23,6 @@
145 #include <argp.h>
146 #include <assert.h>
147 #include <errno.h>
148 -#include <error.h>
149 #include <fcntl.h>
150 #include <gelf.h>
151 #include <libdw.h>
152 Index: elfutils-0.169/src/nm.c
153 ===================================================================
154 --- elfutils-0.169.orig/src/nm.c
155 +++ elfutils-0.169/src/nm.c
156 @@ -26,7 +26,6 @@
157 #include <ctype.h>
158 #include <dwarf.h>
159 #include <errno.h>
160 -#include <error.h>
161 #include <fcntl.h>
162 #include <gelf.h>
163 #include <inttypes.h>
164 Index: elfutils-0.169/src/objdump.c
165 ===================================================================
166 --- elfutils-0.169.orig/src/objdump.c
167 +++ elfutils-0.169/src/objdump.c
168 @@ -21,7 +21,6 @@
169 #endif
170
171 #include <argp.h>
172 -#include <error.h>
173 #include <fcntl.h>
174 #include <inttypes.h>
175 #include <libintl.h>
176 Index: elfutils-0.169/src/ranlib.c
177 ===================================================================
178 --- elfutils-0.169.orig/src/ranlib.c
179 +++ elfutils-0.169/src/ranlib.c
180 @@ -24,7 +24,6 @@
181 #include <argp.h>
182 #include <assert.h>
183 #include <errno.h>
184 -#include <error.h>
185 #include <fcntl.h>
186 #include <gelf.h>
187 #include <libintl.h>
188 Index: elfutils-0.169/src/readelf.c
189 ===================================================================
190 --- elfutils-0.169.orig/src/readelf.c
191 +++ elfutils-0.169/src/readelf.c
192 @@ -25,7 +25,6 @@
193 #include <ctype.h>
194 #include <dwarf.h>
195 #include <errno.h>
196 -#include <error.h>
197 #include <fcntl.h>
198 #include <gelf.h>
199 #include <inttypes.h>
200 Index: elfutils-0.169/src/size.c
201 ===================================================================
202 --- elfutils-0.169.orig/src/size.c
203 +++ elfutils-0.169/src/size.c
204 @@ -21,7 +21,6 @@
205 #endif
206
207 #include <argp.h>
208 -#include <error.h>
209 #include <fcntl.h>
210 #include <gelf.h>
211 #include <inttypes.h>
212 Index: elfutils-0.169/src/stack.c
213 ===================================================================
214 --- elfutils-0.169.orig/src/stack.c
215 +++ elfutils-0.169/src/stack.c
216 @@ -18,7 +18,6 @@
217 #include <config.h>
218 #include <assert.h>
219 #include <argp.h>
220 -#include <error.h>
221 #include <stdlib.h>
222 #include <inttypes.h>
223 #include <stdio.h>
224 Index: elfutils-0.169/src/strings.c
225 ===================================================================
226 --- elfutils-0.169.orig/src/strings.c
227 +++ elfutils-0.169/src/strings.c
228 @@ -25,7 +25,6 @@
229 #include <ctype.h>
230 #include <endian.h>
231 #include <errno.h>
232 -#include <error.h>
233 #include <fcntl.h>
234 #include <gelf.h>
235 #include <inttypes.h>
236 Index: elfutils-0.169/src/strip.c
237 ===================================================================
238 --- elfutils-0.169.orig/src/strip.c
239 +++ elfutils-0.169/src/strip.c
240 @@ -24,7 +24,6 @@
241 #include <assert.h>
242 #include <byteswap.h>
243 #include <endian.h>
244 -#include <error.h>
245 #include <fcntl.h>
246 #include <gelf.h>
247 #include <libelf.h>
248 Index: elfutils-0.169/src/unstrip.c
249 ===================================================================
250 --- elfutils-0.169.orig/src/unstrip.c
251 +++ elfutils-0.169/src/unstrip.c
252 @@ -31,7 +31,6 @@
253 #include <argp.h>
254 #include <assert.h>
255 #include <errno.h>
256 -#include <error.h>
257 #include <fcntl.h>
258 #include <fnmatch.h>
259 #include <libintl.h>
260 Index: elfutils-0.169/tests/addrscopes.c
261 ===================================================================
262 --- elfutils-0.169.orig/tests/addrscopes.c
263 +++ elfutils-0.169/tests/addrscopes.c
264 @@ -25,7 +25,6 @@
265 #include <stdio_ext.h>
266 #include <locale.h>
267 #include <stdlib.h>
268 -#include <error.h>
269 #include <string.h>
270
271
272 Index: elfutils-0.169/tests/allregs.c
273 ===================================================================
274 --- elfutils-0.169.orig/tests/allregs.c
275 +++ elfutils-0.169/tests/allregs.c
276 @@ -21,7 +21,6 @@
277 #include <stdio.h>
278 #include <stdlib.h>
279 #include <string.h>
280 -#include <error.h>
281 #include <locale.h>
282 #include <argp.h>
283 #include <assert.h>
284 Index: elfutils-0.169/tests/backtrace.c
285 ===================================================================
286 --- elfutils-0.169.orig/tests/backtrace.c
287 +++ elfutils-0.169/tests/backtrace.c
288 @@ -24,7 +24,6 @@
289 #include <dirent.h>
290 #include <stdlib.h>
291 #include <errno.h>
292 -#include <error.h>
293 #include <unistd.h>
294 #include <dwarf.h>
295 #ifdef __linux__
296 Index: elfutils-0.169/tests/backtrace-data.c
297 ===================================================================
298 --- elfutils-0.169.orig/tests/backtrace-data.c
299 +++ elfutils-0.169/tests/backtrace-data.c
300 @@ -27,7 +27,6 @@
301 #include <dirent.h>
302 #include <stdlib.h>
303 #include <errno.h>
304 -#include <error.h>
305 #include <unistd.h>
306 #include <dwarf.h>
307 #if defined(__x86_64__) && defined(__linux__)
308 Index: elfutils-0.169/tests/buildid.c
309 ===================================================================
310 --- elfutils-0.169.orig/tests/buildid.c
311 +++ elfutils-0.169/tests/buildid.c
312 @@ -23,7 +23,6 @@
313 #include ELFUTILS_HEADER(elf)
314 #include ELFUTILS_HEADER(dwelf)
315 #include <stdio.h>
316 -#include <error.h>
317 #include <string.h>
318 #include <stdlib.h>
319 #include <sys/types.h>
320 Index: elfutils-0.169/tests/debugaltlink.c
321 ===================================================================
322 --- elfutils-0.169.orig/tests/debugaltlink.c
323 +++ elfutils-0.169/tests/debugaltlink.c
324 @@ -23,7 +23,6 @@
325 #include ELFUTILS_HEADER(dw)
326 #include ELFUTILS_HEADER(dwelf)
327 #include <stdio.h>
328 -#include <error.h>
329 #include <string.h>
330 #include <stdlib.h>
331 #include <sys/types.h>
332 Index: elfutils-0.169/tests/debuglink.c
333 ===================================================================
334 --- elfutils-0.169.orig/tests/debuglink.c
335 +++ elfutils-0.169/tests/debuglink.c
336 @@ -21,7 +21,6 @@
337 #include <errno.h>
338 #include ELFUTILS_HEADER(dwelf)
339 #include <stdio.h>
340 -#include <error.h>
341 #include <string.h>
342 #include <stdlib.h>
343 #include <sys/types.h>
344 Index: elfutils-0.169/tests/dwfl-addr-sect.c
345 ===================================================================
346 --- elfutils-0.169.orig/tests/dwfl-addr-sect.c
347 +++ elfutils-0.169/tests/dwfl-addr-sect.c
348 @@ -23,7 +23,6 @@
349 #include <stdio_ext.h>
350 #include <stdlib.h>
351 #include <string.h>
352 -#include <error.h>
353 #include <locale.h>
354 #include <argp.h>
355 #include ELFUTILS_HEADER(dwfl)
356 Index: elfutils-0.169/tests/dwfl-bug-addr-overflow.c
357 ===================================================================
358 --- elfutils-0.169.orig/tests/dwfl-bug-addr-overflow.c
359 +++ elfutils-0.169/tests/dwfl-bug-addr-overflow.c
360 @@ -20,7 +20,6 @@
361 #include <inttypes.h>
362 #include <stdio.h>
363 #include <stdio_ext.h>
364 -#include <error.h>
365 #include <locale.h>
366 #include ELFUTILS_HEADER(dwfl)
367
368 Index: elfutils-0.169/tests/dwfl-bug-fd-leak.c
369 ===================================================================
370 --- elfutils-0.169.orig/tests/dwfl-bug-fd-leak.c
371 +++ elfutils-0.169/tests/dwfl-bug-fd-leak.c
372 @@ -24,7 +24,6 @@
373 #include <dirent.h>
374 #include <stdlib.h>
375 #include <errno.h>
376 -#include <error.h>
377 #include <unistd.h>
378 #include <dwarf.h>
379
380 Index: elfutils-0.169/tests/dwfl-bug-getmodules.c
381 ===================================================================
382 --- elfutils-0.169.orig/tests/dwfl-bug-getmodules.c
383 +++ elfutils-0.169/tests/dwfl-bug-getmodules.c
384 @@ -18,7 +18,6 @@
385 #include <config.h>
386 #include ELFUTILS_HEADER(dwfl)
387
388 -#include <error.h>
389
390 static const Dwfl_Callbacks callbacks =
391 {
392 Index: elfutils-0.169/tests/dwfllines.c
393 ===================================================================
394 --- elfutils-0.169.orig/tests/dwfllines.c
395 +++ elfutils-0.169/tests/dwfllines.c
396 @@ -27,7 +27,6 @@
397 #include <stdio.h>
398 #include <stdlib.h>
399 #include <string.h>
400 -#include <error.h>
401
402 int
403 main (int argc, char *argv[])
404 Index: elfutils-0.169/tests/dwflmodtest.c
405 ===================================================================
406 --- elfutils-0.169.orig/tests/dwflmodtest.c
407 +++ elfutils-0.169/tests/dwflmodtest.c
408 @@ -23,7 +23,6 @@
409 #include <stdio_ext.h>
410 #include <stdlib.h>
411 #include <string.h>
412 -#include <error.h>
413 #include <locale.h>
414 #include <argp.h>
415 #include ELFUTILS_HEADER(dwfl)
416 Index: elfutils-0.169/tests/dwfl-report-elf-align.c
417 ===================================================================
418 --- elfutils-0.169.orig/tests/dwfl-report-elf-align.c
419 +++ elfutils-0.169/tests/dwfl-report-elf-align.c
420 @@ -20,7 +20,6 @@
421 #include <inttypes.h>
422 #include <stdio.h>
423 #include <stdio_ext.h>
424 -#include <error.h>
425 #include <locale.h>
426 #include <string.h>
427 #include <stdlib.h>
428 Index: elfutils-0.169/tests/dwflsyms.c
429 ===================================================================
430 --- elfutils-0.169.orig/tests/dwflsyms.c
431 +++ elfutils-0.169/tests/dwflsyms.c
432 @@ -25,7 +25,6 @@
433 #include <stdio.h>
434 #include <stdio_ext.h>
435 #include <stdlib.h>
436 -#include <error.h>
437 #include <string.h>
438
439 static const char *
440 Index: elfutils-0.169/tests/early-offscn.c
441 ===================================================================
442 --- elfutils-0.169.orig/tests/early-offscn.c
443 +++ elfutils-0.169/tests/early-offscn.c
444 @@ -19,7 +19,6 @@
445 #endif
446
447 #include <errno.h>
448 -#include <error.h>
449 #include <fcntl.h>
450 #include <gelf.h>
451 #include <stdio.h>
452 Index: elfutils-0.169/tests/ecp.c
453 ===================================================================
454 --- elfutils-0.169.orig/tests/ecp.c
455 +++ elfutils-0.169/tests/ecp.c
456 @@ -20,7 +20,6 @@
457 #endif
458
459 #include <errno.h>
460 -#include <error.h>
461 #include <fcntl.h>
462 #include <gelf.h>
463 #include <stdlib.h>
464 Index: elfutils-0.169/tests/find-prologues.c
465 ===================================================================
466 --- elfutils-0.169.orig/tests/find-prologues.c
467 +++ elfutils-0.169/tests/find-prologues.c
468 @@ -25,7 +25,6 @@
469 #include <stdio_ext.h>
470 #include <locale.h>
471 #include <stdlib.h>
472 -#include <error.h>
473 #include <string.h>
474 #include <fnmatch.h>
475
476 Index: elfutils-0.169/tests/funcretval.c
477 ===================================================================
478 --- elfutils-0.169.orig/tests/funcretval.c
479 +++ elfutils-0.169/tests/funcretval.c
480 @@ -25,7 +25,6 @@
481 #include <stdio_ext.h>
482 #include <locale.h>
483 #include <stdlib.h>
484 -#include <error.h>
485 #include <string.h>
486 #include <fnmatch.h>
487
488 Index: elfutils-0.169/tests/funcscopes.c
489 ===================================================================
490 --- elfutils-0.169.orig/tests/funcscopes.c
491 +++ elfutils-0.169/tests/funcscopes.c
492 @@ -25,7 +25,6 @@
493 #include <stdio_ext.h>
494 #include <locale.h>
495 #include <stdlib.h>
496 -#include <error.h>
497 #include <string.h>
498 #include <fnmatch.h>
499
500 Index: elfutils-0.169/tests/line2addr.c
501 ===================================================================
502 --- elfutils-0.169.orig/tests/line2addr.c
503 +++ elfutils-0.169/tests/line2addr.c
504 @@ -26,7 +26,6 @@
505 #include <locale.h>
506 #include <stdlib.h>
507 #include <string.h>
508 -#include <error.h>
509
510
511 static void
512 Index: elfutils-0.169/tests/low_high_pc.c
513 ===================================================================
514 --- elfutils-0.169.orig/tests/low_high_pc.c
515 +++ elfutils-0.169/tests/low_high_pc.c
516 @@ -25,7 +25,6 @@
517 #include <stdio_ext.h>
518 #include <locale.h>
519 #include <stdlib.h>
520 -#include <error.h>
521 #include <string.h>
522 #include <fnmatch.h>
523
524 Index: elfutils-0.169/tests/md5-sha1-test.c
525 ===================================================================
526 --- elfutils-0.169.orig/tests/md5-sha1-test.c
527 +++ elfutils-0.169/tests/md5-sha1-test.c
528 @@ -19,7 +19,6 @@
529 #endif
530
531 #include <string.h>
532 -#include <error.h>
533
534 #include "md5.h"
535 #include "sha1.h"
536 Index: elfutils-0.169/tests/rdwrmmap.c
537 ===================================================================
538 --- elfutils-0.169.orig/tests/rdwrmmap.c
539 +++ elfutils-0.169/tests/rdwrmmap.c
540 @@ -19,7 +19,6 @@
541 #endif
542
543 #include <errno.h>
544 -#include <error.h>
545 #include <stdio.h>
546 #include <fcntl.h>
547 #include <unistd.h>
548 Index: elfutils-0.169/tests/saridx.c
549 ===================================================================
550 --- elfutils-0.169.orig/tests/saridx.c
551 +++ elfutils-0.169/tests/saridx.c
552 @@ -17,7 +17,6 @@
553
554 #include <config.h>
555
556 -#include <error.h>
557 #include <fcntl.h>
558 #include <gelf.h>
559 #include <stdio.h>
560 Index: elfutils-0.169/tests/sectiondump.c
561 ===================================================================
562 --- elfutils-0.169.orig/tests/sectiondump.c
563 +++ elfutils-0.169/tests/sectiondump.c
564 @@ -18,7 +18,6 @@
565 #include <config.h>
566
567 #include <errno.h>
568 -#include <error.h>
569 #include <fcntl.h>
570 #include <gelf.h>
571 #include <inttypes.h>
572 Index: elfutils-0.169/tests/varlocs.c
573 ===================================================================
574 --- elfutils-0.169.orig/tests/varlocs.c
575 +++ elfutils-0.169/tests/varlocs.c
576 @@ -25,7 +25,6 @@
577 #include <dwarf.h>
578 #include <stdio.h>
579 #include <stdlib.h>
580 -#include <error.h>
581 #include <string.h>
582 #include <sys/types.h>
583 #include <sys/stat.h>
584 Index: elfutils-0.169/libasm/asm_end.c
585 ===================================================================
586 --- elfutils-0.169.orig/libasm/asm_end.c
587 +++ elfutils-0.169/libasm/asm_end.c
588 @@ -32,7 +32,6 @@
589 #endif
590
591 #include <assert.h>
592 -#include <error.h>
593 #include <libintl.h>
594 #include <stdio.h>
595 #include <stdlib.h>
596 Index: elfutils-0.169/libasm/asm_newscn.c
597 ===================================================================
598 --- elfutils-0.169.orig/libasm/asm_newscn.c
599 +++ elfutils-0.169/libasm/asm_newscn.c
600 @@ -32,7 +32,6 @@
601 #endif
602
603 #include <assert.h>
604 -#include <error.h>
605 #include <libintl.h>
606 #include <stdlib.h>
607 #include <string.h>
608 Index: elfutils-0.169/libcpu/i386_gendis.c
609 ===================================================================
610 --- elfutils-0.169.orig/libcpu/i386_gendis.c
611 +++ elfutils-0.169/libcpu/i386_gendis.c
612 @@ -31,7 +31,6 @@
613 # include <config.h>
614 #endif
615
616 -#include <error.h>
617 #include <errno.h>
618 #include <stdio.h>
619 #include <stdlib.h>
620 Index: elfutils-0.169/libcpu/i386_lex.c
621 ===================================================================
622 --- elfutils-0.169.orig/libcpu/i386_lex.c
623 +++ elfutils-0.169/libcpu/i386_lex.c
624 @@ -592,7 +592,6 @@ char *i386_text;
625 #endif
626
627 #include <ctype.h>
628 -#include <error.h>
629 #include <libintl.h>
630
631 #include <libeu.h>
632 Index: elfutils-0.169/libcpu/i386_lex.l
633 ===================================================================
634 --- elfutils-0.169.orig/libcpu/i386_lex.l
635 +++ elfutils-0.169/libcpu/i386_lex.l
636 @@ -31,7 +31,6 @@
637 #endif
638
639 #include <ctype.h>
640 -#include <error.h>
641 #include <libintl.h>
642
643 #include <libeu.h>
644 Index: elfutils-0.169/libcpu/i386_parse.c
645 ===================================================================
646 --- elfutils-0.169.orig/libcpu/i386_parse.c
647 +++ elfutils-0.169/libcpu/i386_parse.c
648 @@ -107,7 +107,6 @@
649 #include <assert.h>
650 #include <ctype.h>
651 #include <errno.h>
652 -#include <error.h>
653 #include <inttypes.h>
654 #include <libintl.h>
655 #include <math.h>
656 Index: elfutils-0.169/libdw/libdw_alloc.c
657 ===================================================================
658 --- elfutils-0.169.orig/libdw/libdw_alloc.c
659 +++ elfutils-0.169/libdw/libdw_alloc.c
660 @@ -31,7 +31,6 @@
661 # include <config.h>
662 #endif
663
664 -#include <error.h>
665 #include <errno.h>
666 #include <stdlib.h>
667 #include "libdwP.h"
668 @@ -74,5 +73,5 @@ __attribute ((noreturn, visibility ("hid
669 __libdw_oom (void)
670 {
671 while (1)
672 - error (EXIT_FAILURE, ENOMEM, "libdw");
673 + error (EXIT_FAILURE, errno, gettext ("cannot allocate memory"));
674 }
675 Index: elfutils-0.169/libebl/eblopenbackend.c
676 ===================================================================
677 --- elfutils-0.169.orig/libebl/eblopenbackend.c
678 +++ elfutils-0.169/libebl/eblopenbackend.c
679 @@ -32,7 +32,6 @@
680
681 #include <assert.h>
682 #include <dlfcn.h>
683 -#include <error.h>
684 #include <libelfP.h>
685 #include <dwarf.h>
686 #include <stdlib.h>
687 Index: elfutils-0.169/libdwfl/dwfl_error.c
688 ===================================================================
689 --- elfutils-0.169.orig/libdwfl/dwfl_error.c
690 +++ elfutils-0.169/libdwfl/dwfl_error.c
691 @@ -140,6 +140,7 @@ __libdwfl_seterrno (Dwfl_Error error)
692 const char *
693 dwfl_errmsg (int error)
694 {
695 + static __thread char s[64] = "";
696 if (error == 0 || error == -1)
697 {
698 int last_error = global_error;
699 @@ -154,7 +155,8 @@ dwfl_errmsg (int error)
700 switch (error &~ 0xffff)
701 {
702 case OTHER_ERROR (ERRNO):
703 - return strerror_r (error & 0xffff, "bad", 0);
704 + strerror_r (error & 0xffff, s, sizeof(s));
705 + return s;
706 case OTHER_ERROR (LIBELF):
707 return elf_errmsg (error & 0xffff);
708 case OTHER_ERROR (LIBDW):