1 https://sourceware.org/bugzilla/show_bug.cgi?id=21002
3 Index: elfutils-0.169/lib/system.h
4 ===================================================================
5 --- elfutils-0.169.orig/lib/system.h
6 +++ elfutils-0.169/lib/system.h
17 +#define error(status, errno, ...) \
19 + warn(__VA_ARGS__); \
20 + if (status) exit(status)
25 #include <sys/param.h>
31 +#define canonicalize_file_name(name) realpath(name,NULL)
34 #if __BYTE_ORDER == __LITTLE_ENDIAN
37 Index: elfutils-0.169/lib/color.c
38 ===================================================================
39 --- elfutils-0.169.orig/lib/color.c
40 +++ elfutils-0.169/lib/color.c
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
68 Index: elfutils-0.169/src/addr2line.c
69 ===================================================================
70 --- elfutils-0.169.orig/src/addr2line.c
71 +++ elfutils-0.169/src/addr2line.c
80 Index: elfutils-0.169/src/ar.c
81 ===================================================================
82 --- elfutils-0.169.orig/src/ar.c
83 +++ elfutils-0.169/src/ar.c
92 Index: elfutils-0.169/src/arlib2.c
93 ===================================================================
94 --- elfutils-0.169.orig/src/arlib2.c
95 +++ elfutils-0.169/src/arlib2.c
104 Index: elfutils-0.169/src/arlib.c
105 ===================================================================
106 --- elfutils-0.169.orig/src/arlib.c
107 +++ elfutils-0.169/src/arlib.c
114 #include <inttypes.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
128 Index: elfutils-0.169/src/elflint.c
129 ===================================================================
130 --- elfutils-0.169.orig/src/elflint.c
131 +++ elfutils-0.169/src/elflint.c
134 #include <byteswap.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
152 Index: elfutils-0.169/src/nm.c
153 ===================================================================
154 --- elfutils-0.169.orig/src/nm.c
155 +++ elfutils-0.169/src/nm.c
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
174 #include <inttypes.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
188 Index: elfutils-0.169/src/readelf.c
189 ===================================================================
190 --- elfutils-0.169.orig/src/readelf.c
191 +++ elfutils-0.169/src/readelf.c
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
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
222 #include <inttypes.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
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
242 #include <byteswap.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
260 Index: elfutils-0.169/tests/addrscopes.c
261 ===================================================================
262 --- elfutils-0.169.orig/tests/addrscopes.c
263 +++ elfutils-0.169/tests/addrscopes.c
265 #include <stdio_ext.h>
272 Index: elfutils-0.169/tests/allregs.c
273 ===================================================================
274 --- elfutils-0.169.orig/tests/allregs.c
275 +++ elfutils-0.169/tests/allregs.c
284 Index: elfutils-0.169/tests/backtrace.c
285 ===================================================================
286 --- elfutils-0.169.orig/tests/backtrace.c
287 +++ elfutils-0.169/tests/backtrace.c
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
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
313 #include ELFUTILS_HEADER(elf)
314 #include ELFUTILS_HEADER(dwelf)
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
325 #include ELFUTILS_HEADER(dw)
326 #include ELFUTILS_HEADER(dwelf)
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
338 #include ELFUTILS_HEADER(dwelf)
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
349 #include <stdio_ext.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
361 #include <inttypes.h>
363 #include <stdio_ext.h>
366 #include ELFUTILS_HEADER(dwfl)
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
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
386 #include ELFUTILS_HEADER(dwfl)
390 static const Dwfl_Callbacks callbacks =
392 Index: elfutils-0.169/tests/dwfllines.c
393 ===================================================================
394 --- elfutils-0.169.orig/tests/dwfllines.c
395 +++ elfutils-0.169/tests/dwfllines.c
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
409 #include <stdio_ext.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
421 #include <inttypes.h>
423 #include <stdio_ext.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
434 #include <stdio_ext.h>
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
452 Index: elfutils-0.169/tests/ecp.c
453 ===================================================================
454 --- elfutils-0.169.orig/tests/ecp.c
455 +++ elfutils-0.169/tests/ecp.c
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
469 #include <stdio_ext.h>
476 Index: elfutils-0.169/tests/funcretval.c
477 ===================================================================
478 --- elfutils-0.169.orig/tests/funcretval.c
479 +++ elfutils-0.169/tests/funcretval.c
481 #include <stdio_ext.h>
488 Index: elfutils-0.169/tests/funcscopes.c
489 ===================================================================
490 --- elfutils-0.169.orig/tests/funcscopes.c
491 +++ elfutils-0.169/tests/funcscopes.c
493 #include <stdio_ext.h>
500 Index: elfutils-0.169/tests/line2addr.c
501 ===================================================================
502 --- elfutils-0.169.orig/tests/line2addr.c
503 +++ elfutils-0.169/tests/line2addr.c
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
517 #include <stdio_ext.h>
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
536 Index: elfutils-0.169/tests/rdwrmmap.c
537 ===================================================================
538 --- elfutils-0.169.orig/tests/rdwrmmap.c
539 +++ elfutils-0.169/tests/rdwrmmap.c
548 Index: elfutils-0.169/tests/saridx.c
549 ===================================================================
550 --- elfutils-0.169.orig/tests/saridx.c
551 +++ elfutils-0.169/tests/saridx.c
560 Index: elfutils-0.169/tests/sectiondump.c
561 ===================================================================
562 --- elfutils-0.169.orig/tests/sectiondump.c
563 +++ elfutils-0.169/tests/sectiondump.c
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
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
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
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
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;
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
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
653 #include <inttypes.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
668 @@ -74,5 +73,5 @@ __attribute ((noreturn, visibility ("hid
672 - error (EXIT_FAILURE, ENOMEM, "libdw");
673 + error (EXIT_FAILURE, errno, gettext ("cannot allocate memory"));
675 Index: elfutils-0.169/libebl/eblopenbackend.c
676 ===================================================================
677 --- elfutils-0.169.orig/libebl/eblopenbackend.c
678 +++ elfutils-0.169/libebl/eblopenbackend.c
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)
693 dwfl_errmsg (int error)
695 + static __thread char s[64] = "";
696 if (error == 0 || error == -1)
698 int last_error = global_error;
699 @@ -154,7 +155,8 @@ dwfl_errmsg (int error)
700 switch (error &~ 0xffff)
702 case OTHER_ERROR (ERRNO):
703 - return strerror_r (error & 0xffff, "bad", 0);
704 + strerror_r (error & 0xffff, s, sizeof(s));
706 case OTHER_ERROR (LIBELF):
707 return elf_errmsg (error & 0xffff);
708 case OTHER_ERROR (LIBDW):