1 https://sourceware.org/bugzilla/show_bug.cgi?id=21002
5 @@ -140,6 +140,19 @@ pread_retry (int fd, void *buf, size_t l
13 +#define error(status, errno, ...) \
15 + warn(__VA_ARGS__); \
16 + if (status) exit(status)
20 +#define canonicalize_file_name(name) realpath(name,NULL)
23 /* We need define two variables, argp_program_version_hook and
24 argp_program_bug_address, in all programs. argp.h declares these
40 /* Prototype for option handler. */
105 #include <byteswap.h>
110 #include <inttypes.h>
111 --- a/src/findtextrel.c
112 +++ b/src/findtextrel.c
130 #include <inttypes.h>
139 #include <inttypes.h>
160 #include <inttypes.h>
170 #include <inttypes.h>
179 #include <inttypes.h>
190 #include <inttypes.h>
195 #include <byteswap.h>
211 --- a/tests/addrscopes.c
212 +++ b/tests/addrscopes.c
214 #include <stdio_ext.h>
221 --- a/tests/allregs.c
222 +++ b/tests/allregs.c
231 --- a/tests/backtrace.c
232 +++ b/tests/backtrace.c
241 --- a/tests/backtrace-data.c
242 +++ b/tests/backtrace-data.c
250 #if defined(__x86_64__) && defined(__linux__)
251 --- a/tests/buildid.c
252 +++ b/tests/buildid.c
254 #include ELFUTILS_HEADER(elf)
255 #include ELFUTILS_HEADER(dwelf)
260 #include <sys/types.h>
261 --- a/tests/debugaltlink.c
262 +++ b/tests/debugaltlink.c
264 #include ELFUTILS_HEADER(dw)
265 #include ELFUTILS_HEADER(dwelf)
270 #include <sys/types.h>
271 --- a/tests/debuglink.c
272 +++ b/tests/debuglink.c
275 #include ELFUTILS_HEADER(dwelf)
280 #include <sys/types.h>
281 --- a/tests/dwfl-addr-sect.c
282 +++ b/tests/dwfl-addr-sect.c
284 #include <stdio_ext.h>
290 #include ELFUTILS_HEADER(dwfl)
291 --- a/tests/dwfl-bug-addr-overflow.c
292 +++ b/tests/dwfl-bug-addr-overflow.c
294 #include <inttypes.h>
296 #include <stdio_ext.h>
299 #include ELFUTILS_HEADER(dwfl)
301 --- a/tests/dwfl-bug-fd-leak.c
302 +++ b/tests/dwfl-bug-fd-leak.c
311 --- a/tests/dwfl-bug-getmodules.c
312 +++ b/tests/dwfl-bug-getmodules.c
315 #include ELFUTILS_HEADER(dwfl)
319 static const Dwfl_Callbacks callbacks =
321 --- a/tests/dwfllines.c
322 +++ b/tests/dwfllines.c
330 main (int argc, char *argv[])
331 --- a/tests/dwflmodtest.c
332 +++ b/tests/dwflmodtest.c
334 #include <stdio_ext.h>
340 #include ELFUTILS_HEADER(dwfl)
341 --- a/tests/dwfl-report-elf-align.c
342 +++ b/tests/dwfl-report-elf-align.c
344 #include <inttypes.h>
346 #include <stdio_ext.h>
351 --- a/tests/dwflsyms.c
352 +++ b/tests/dwflsyms.c
355 #include <stdio_ext.h>
361 --- a/tests/early-offscn.c
362 +++ b/tests/early-offscn.c
381 --- a/tests/find-prologues.c
382 +++ b/tests/find-prologues.c
384 #include <stdio_ext.h>
391 --- a/tests/funcretval.c
392 +++ b/tests/funcretval.c
394 #include <stdio_ext.h>
401 --- a/tests/funcscopes.c
402 +++ b/tests/funcscopes.c
404 #include <stdio_ext.h>
411 --- a/tests/line2addr.c
412 +++ b/tests/line2addr.c
421 --- a/tests/low_high_pc.c
422 +++ b/tests/low_high_pc.c
424 #include <stdio_ext.h>
431 --- a/tests/md5-sha1-test.c
432 +++ b/tests/md5-sha1-test.c
441 --- a/tests/rdwrmmap.c
442 +++ b/tests/rdwrmmap.c
461 --- a/tests/sectiondump.c
462 +++ b/tests/sectiondump.c
470 #include <inttypes.h>
471 --- a/tests/varlocs.c
472 +++ b/tests/varlocs.c
479 #include <sys/types.h>
480 #include <sys/stat.h>
481 --- a/libasm/asm_end.c
482 +++ b/libasm/asm_end.c
491 --- a/libasm/asm_newscn.c
492 +++ b/libasm/asm_newscn.c
501 --- a/libcpu/i386_gendis.c
502 +++ b/libcpu/i386_gendis.c
511 --- a/libcpu/i386_lex.c
512 +++ b/libcpu/i386_lex.c
513 @@ -592,7 +592,6 @@ char *i386_text;
521 --- a/libcpu/i386_lex.l
522 +++ b/libcpu/i386_lex.l
531 --- a/libcpu/i386_parse.c
532 +++ b/libcpu/i386_parse.c
538 #include <inttypes.h>
541 --- a/libdw/libdw_alloc.c
542 +++ b/libdw/libdw_alloc.c
551 @@ -74,5 +73,5 @@ __attribute ((noreturn, visibility ("hid
555 - error (EXIT_FAILURE, ENOMEM, "libdw");
556 + error (EXIT_FAILURE, errno, gettext ("cannot allocate memory"));
558 --- a/libebl/eblopenbackend.c
559 +++ b/libebl/eblopenbackend.c
568 --- a/libdwfl/dwfl_error.c
569 +++ b/libdwfl/dwfl_error.c
570 @@ -140,6 +140,7 @@ __libdwfl_seterrno (Dwfl_Error error)
572 dwfl_errmsg (int error)
574 + static __thread char s[64] = "";
575 if (error == 0 || error == -1)
577 int last_error = global_error;
578 @@ -154,7 +155,8 @@ dwfl_errmsg (int error)
579 switch (error &~ 0xffff)
581 case OTHER_ERROR (ERRNO):
582 - return strerror_r (error & 0xffff, "bad", 0);
583 + strerror_r (error & 0xffff, s, sizeof(s));
585 case OTHER_ERROR (LIBELF):
586 return elf_errmsg (error & 0xffff);
587 case OTHER_ERROR (LIBDW):