1 diff -Naur elfutils-0.152.orig/lib/xmalloc.c elfutils-0.152/lib/xmalloc.c
2 --- elfutils-0.152.orig/lib/xmalloc.c 2010-06-29 04:09:31.000000000 +0000
3 +++ elfutils-0.152/lib/xmalloc.c 2012-05-29 07:20:04.012448966 +0000
17 - error (EXIT_FAILURE, 0, _("memory exhausted"));
18 + err (EXIT_FAILURE, _("memory exhausted"));
26 - error (EXIT_FAILURE, 0, _("memory exhausted"));
27 + err (EXIT_FAILURE, _("memory exhausted"));
35 - error (EXIT_FAILURE, 0, _("memory exhausted"));
36 + err (EXIT_FAILURE, _("memory exhausted"));
39 diff -Naur elfutils-0.152.orig/libcpu/i386_gendis.c elfutils-0.152/libcpu/i386_gendis.c
40 --- elfutils-0.152.orig/libcpu/i386_gendis.c 2010-06-29 04:09:31.000000000 +0000
41 +++ elfutils-0.152/libcpu/i386_gendis.c 2012-05-29 07:25:01.733156774 +0000
52 main (int argc, char *argv[argc])
58 - error (EXIT_FAILURE, 0, "usage: %s <MNEDEFFILE>", argv[0]);
60 + err (EXIT_FAILURE, "usage: %s <MNEDEFFILE>", argv[0]);
69 i386_in = fopen (infname, "r");
70 - if (i386_in == NULL)
71 - error (EXIT_FAILURE, errno, "cannot open %s", argv[1]);
72 + if (i386_in == NULL) {
73 + err (EXIT_FAILURE, "cannot open %s", argv[1]);
80 - return error_message_count != 0;
83 diff -Naur elfutils-0.152.orig/libcpu/i386_lex.c elfutils-0.152/libcpu/i386_lex.c
84 --- elfutils-0.152.orig/libcpu/i386_lex.c 2011-02-15 14:28:54.000000000 +0000
85 +++ elfutils-0.152/libcpu/i386_lex.c 2012-05-29 07:34:45.432057642 +0000
99 - error (0, 0, (isascii (ch)
100 + err (0, (isascii (ch)
101 ? gettext ("invalid character '%c' at line %d; ignored")
102 : gettext ("invalid character '\\%o' at line %d; ignored")),
104 diff -Naur elfutils-0.152.orig/libcpu/i386_lex.l elfutils-0.152/libcpu/i386_lex.l
105 --- elfutils-0.152.orig/libcpu/i386_lex.l 2010-06-29 04:09:31.000000000 +0000
106 +++ elfutils-0.152/libcpu/i386_lex.l 2012-05-29 07:26:26.040059610 +0000
118 invalid_char (int ch)
120 - error (0, 0, (isascii (ch)
121 + err (0, (isascii (ch)
122 ? gettext ("invalid character '%c' at line %d; ignored")
123 : gettext ("invalid character '\\%o' at line %d; ignored")),
125 diff -Naur elfutils-0.152.orig/libcpu/i386_parse.c elfutils-0.152/libcpu/i386_parse.c
126 --- elfutils-0.152.orig/libcpu/i386_parse.c 2011-02-15 14:28:54.000000000 +0000
127 +++ elfutils-0.152/libcpu/i386_parse.c 2012-05-29 07:39:24.822057670 +0000
134 #include <inttypes.h>
137 @@ -1607,9 +1607,6 @@
138 /* Line 1464 of yacc.c */
139 #line 245 "i386_parse.y"
141 - if (error_message_count != 0)
142 - error (EXIT_FAILURE, 0,
143 - "terminated due to previous error");
147 @@ -1645,11 +1642,11 @@
148 newp->from = (yyvsp[(2) - (3)].str);
149 newp->to = (yyvsp[(3) - (3)].str);
150 if (tfind (newp, &synonyms, compare_syn) != NULL)
153 "%d: duplicate definition for synonym '%s'",
154 i386_lineno, (yyvsp[(2) - (3)].str));
155 else if (tsearch ( newp, &synonyms, compare_syn) == NULL)
156 - error (EXIT_FAILURE, 0, "tsearch");
157 + err (EXIT_FAILURE, "tsearch");
161 @@ -1661,7 +1658,7 @@
162 if ((yyvsp[(3) - (6)].field) != NULL && strcmp ((yyvsp[(3) - (6)].field)->name, "RE") != 0
163 && strcmp ((yyvsp[(3) - (6)].field)->name, "R") != 0)
165 - error (0, 0, "%d: only 'R' and 'RE' prefix allowed",
166 + err (0, "%d: only 'R' and 'RE' prefix allowed",
169 if (check_duplicates ((yyvsp[(1) - (6)].bit)) == 0
170 @@ -1686,7 +1683,7 @@
172 if (tsearch ((yyvsp[(4) - (6)].str), &mnemonics,
173 (comparison_fn_t) strcmp) == NULL)
174 - error (EXIT_FAILURE, errno, "tsearch");
175 + err (EXIT_FAILURE, "tsearch");
179 @@ -1707,7 +1704,7 @@
180 else if (strcmp ((yyvsp[(5) - (6)].field)->name, "D") == 0)
181 newp->suffix = suffix_D;
183 - error (EXIT_FAILURE, 0,
185 "%s: %d: unknown suffix '%s'",
186 infname, i386_lineno - 1, (yyvsp[(5) - (6)].field)->name);
188 @@ -1720,7 +1717,7 @@
189 ns->idx = ++nsuffixes;
190 if (tsearch (ns, &suffixes, compare_suf)
192 - error (EXIT_FAILURE, errno, "tsearch");
193 + err (EXIT_FAILURE, "tsearch");
197 @@ -1752,7 +1749,7 @@
198 res = tfind (&search, &bitfields, bitfield_compare);
201 - error (0, 0, "%d: unknown bitfield '%s'",
202 + err (0, "%d: unknown bitfield '%s'",
203 i386_lineno, search.name);
204 (yyval.field) = NULL;
206 @@ -1849,7 +1846,7 @@
207 res = tfind (&search, &bitfields, bitfield_compare);
210 - error (0, 0, "%d: unknown bitfield '%s'",
211 + err (0, "%d: unknown bitfield '%s'",
212 i386_lineno, search.name);
213 (yyval.bit)->type = failure;
215 @@ -1949,7 +1946,7 @@
216 (yyval.name)->field = &bx_reg;
219 - error (0, 0, "%d: unknown bitfield '%s'",
220 + err (0, "%d: unknown bitfield '%s'",
221 i386_lineno, search.name);
222 (yyval.name)->field = NULL;
224 @@ -2220,7 +2217,7 @@
226 yyerror (const char *s)
228 - error (0, 0, gettext ("while reading i386 CPU description: %s at line %d"),
229 + err (0, gettext ("while reading i386 CPU description: %s at line %d"),
230 gettext (s), i386_lineno);
233 @@ -2245,14 +2242,14 @@
235 if (tfind (newp, &bitfields, bitfield_compare) != NULL)
237 - error (0, 0, "%d: duplicated definition of bitfield '%s'",
238 + err (0, "%d: duplicated definition of bitfield '%s'",
244 if (tsearch (newp, &bitfields, bitfield_compare) == NULL)
245 - error (EXIT_FAILURE, errno, "%d: cannot insert new bitfield '%s'",
246 + err (EXIT_FAILURE, "%d: cannot insert new bitfield '%s'",
250 @@ -2292,7 +2289,7 @@
252 obstack_1grow (&os, '\0');
254 - error (0, 0, "%d: field '%s' not a multiple of 8 bits in size",
255 + err (0, "%d: field '%s' not a multiple of 8 bits in size",
256 i386_lineno, (char *) obstack_finish (&os));
258 obstack_free (&os, NULL);
259 @@ -2313,7 +2310,7 @@
261 if (val->field->tmp == testcnt)
263 - error (0, 0, "%d: bitfield '%s' used more than once",
264 + err (0, "%d: bitfield '%s' used more than once",
265 i386_lineno - 1, val->field->name);
268 @@ -2350,7 +2347,7 @@
272 - error (0, 0, "%d: unknown bitfield '%s' used in output format",
273 + err (0, "%d: unknown bitfield '%s' used in output format",
274 i386_lineno - 1, name->field->name);
277 @@ -2394,7 +2391,7 @@
281 - error (0, 0, "%d: bitfield '%s' not used",
282 + err (0, "%d: bitfield '%s' not used",
283 i386_lineno - 1, bitval->field->name);
286 @@ -2457,7 +2454,7 @@
287 if (runp->type == string)
289 if (instr->operands[n].str != NULL)
290 - error (EXIT_FAILURE, 0,
292 "%d: cannot have more than one string parameter",
295 @@ -2511,7 +2508,7 @@
296 else if (instr->operands[n].off3 == 0)
297 instr->operands[n].off3 = bitoff;
299 - error (EXIT_FAILURE, 0,
301 "%d: cannot have more than three fields in parameter",
304 @@ -2587,7 +2584,7 @@
305 newp->str = runp->operands[i].fct;
307 if (tsearch (newp, &fct_names[i], compare_argstring) == NULL)
308 - error (EXIT_FAILURE, errno, "tsearch");
309 + err (EXIT_FAILURE, "tsearch");
313 @@ -2600,7 +2597,7 @@
314 newp->str = runp->operands[i].str;
316 if (tsearch (newp, &strs[i], compare_argstring) == NULL)
317 - error (EXIT_FAILURE, errno, "tsearch");
318 + err (EXIT_FAILURE, "tsearch");
322 diff -Naur elfutils-0.152.orig/libcpu/i386_parse.y elfutils-0.152/libcpu/i386_parse.y
323 --- elfutils-0.152.orig/libcpu/i386_parse.y 2010-06-29 04:09:31.000000000 +0000
324 +++ elfutils-0.152/libcpu/i386_parse.y 2012-05-29 07:34:21.204144089 +0000
331 #include <inttypes.h>
336 spec: masks kPERCPERC '\n' instrs
338 - if (error_message_count != 0)
339 - error (EXIT_FAILURE, 0,
340 - "terminated due to previous error");
345 @@ -267,11 +263,11 @@
348 if (tfind (newp, &synonyms, compare_syn) != NULL)
351 "%d: duplicate definition for synonym '%s'",
353 else if (tsearch ( newp, &synonyms, compare_syn) == NULL)
354 - error (EXIT_FAILURE, 0, "tsearch");
355 + err (EXIT_FAILURE, "tsearch");
360 if ($3 != NULL && strcmp ($3->name, "RE") != 0
361 && strcmp ($3->name, "R") != 0)
363 - error (0, 0, "%d: only 'R' and 'RE' prefix allowed",
364 + err (0, "%d: only 'R' and 'RE' prefix allowed",
367 if (check_duplicates ($1) == 0
370 if (tsearch ($4, &mnemonics,
371 (comparison_fn_t) strcmp) == NULL)
372 - error (EXIT_FAILURE, errno, "tsearch");
373 + err (EXIT_FAILURE, "tsearch");
378 else if (strcmp ($5->name, "D") == 0)
379 newp->suffix = suffix_D;
381 - error (EXIT_FAILURE, 0,
383 "%s: %d: unknown suffix '%s'",
384 infname, i386_lineno - 1, $5->name);
387 ns->idx = ++nsuffixes;
388 if (tsearch (ns, &suffixes, compare_suf)
390 - error (EXIT_FAILURE, errno, "tsearch");
391 + err (EXIT_FAILURE, "tsearch");
396 res = tfind (&search, &bitfields, bitfield_compare);
399 - error (0, 0, "%d: unknown bitfield '%s'",
400 + err (0, "%d: unknown bitfield '%s'",
401 i386_lineno, search.name);
405 res = tfind (&search, &bitfields, bitfield_compare);
408 - error (0, 0, "%d: unknown bitfield '%s'",
409 + err (0, "%d: unknown bitfield '%s'",
410 i386_lineno, search.name);
417 - error (0, 0, "%d: unknown bitfield '%s'",
418 + err (0, "%d: unknown bitfield '%s'",
419 i386_lineno, search.name);
424 yyerror (const char *s)
426 - error (0, 0, gettext ("while reading i386 CPU description: %s at line %d"),
427 + err (0, gettext ("while reading i386 CPU description: %s at line %d"),
428 gettext (s), i386_lineno);
431 @@ -574,14 +570,14 @@
433 if (tfind (newp, &bitfields, bitfield_compare) != NULL)
435 - error (0, 0, "%d: duplicated definition of bitfield '%s'",
436 + err (0, "%d: duplicated definition of bitfield '%s'",
442 if (tsearch (newp, &bitfields, bitfield_compare) == NULL)
443 - error (EXIT_FAILURE, errno, "%d: cannot insert new bitfield '%s'",
444 + err (EXIT_FAILURE, "%d: cannot insert new bitfield '%s'",
450 obstack_1grow (&os, '\0');
452 - error (0, 0, "%d: field '%s' not a multiple of 8 bits in size",
453 + err (0, "%d: field '%s' not a multiple of 8 bits in size",
454 i386_lineno, (char *) obstack_finish (&os));
456 obstack_free (&os, NULL);
459 if (val->field->tmp == testcnt)
461 - error (0, 0, "%d: bitfield '%s' used more than once",
462 + err (0, "%d: bitfield '%s' used more than once",
463 i386_lineno - 1, val->field->name);
470 - error (0, 0, "%d: unknown bitfield '%s' used in output format",
471 + err (0, "%d: unknown bitfield '%s' used in output format",
472 i386_lineno - 1, name->field->name);
479 - error (0, 0, "%d: bitfield '%s' not used",
480 + err (0, "%d: bitfield '%s' not used",
481 i386_lineno - 1, bitval->field->name);
485 if (runp->type == string)
487 if (instr->operands[n].str != NULL)
488 - error (EXIT_FAILURE, 0,
490 "%d: cannot have more than one string parameter",
494 else if (instr->operands[n].off3 == 0)
495 instr->operands[n].off3 = bitoff;
497 - error (EXIT_FAILURE, 0,
499 "%d: cannot have more than three fields in parameter",
503 newp->str = runp->operands[i].fct;
505 if (tsearch (newp, &fct_names[i], compare_argstring) == NULL)
506 - error (EXIT_FAILURE, errno, "tsearch");
507 + err (EXIT_FAILURE, "tsearch");
512 newp->str = runp->operands[i].str;
514 if (tsearch (newp, &strs[i], compare_argstring) == NULL)
515 - error (EXIT_FAILURE, errno, "tsearch");
516 + err (EXIT_FAILURE, "tsearch");
520 diff -Naur elfutils-0.152.orig/libdw/libdw_alloc.c elfutils-0.152/libdw/libdw_alloc.c
521 --- elfutils-0.152.orig/libdw/libdw_alloc.c 2010-06-29 04:09:31.000000000 +0000
522 +++ elfutils-0.152/libdw/libdw_alloc.c 2012-05-29 07:20:04.013112718 +0000
531 #include <sys/param.h>
536 - error (EXIT_FAILURE, ENOMEM, "libdw");
537 + err (EXIT_FAILURE, "libdw");
539 diff -Naur elfutils-0.152.orig/libebl/eblopenbackend.c elfutils-0.152/libebl/eblopenbackend.c
540 --- elfutils-0.152.orig/libebl/eblopenbackend.c 2010-09-10 13:18:31.000000000 +0000
541 +++ elfutils-0.152/libebl/eblopenbackend.c 2012-05-29 07:20:04.013112718 +0000
550 diff -Naur elfutils-0.152.orig/src/findtextrel.c elfutils-0.152/src/findtextrel.c
551 --- elfutils-0.152.orig/src/findtextrel.c 2010-11-23 03:02:58.000000000 +0000
552 +++ elfutils-0.152/src/findtextrel.c 2012-05-29 07:20:04.014110741 +0000
562 @@ -226,14 +226,14 @@
563 int fd = open64 (real_fname, O_RDONLY);
566 - error (0, errno, gettext ("cannot open '%s'"), fname);
567 + err (0, gettext ("cannot open '%s'"), fname);
571 Elf *elf = elf_begin (fd, ELF_C_READ_MMAP, NULL);
574 - error (0, 0, gettext ("cannot create ELF descriptor for '%s': %s"),
575 + err (0, gettext ("cannot create ELF descriptor for '%s': %s"),
576 fname, elf_errmsg (-1));
580 GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
583 - error (0, 0, gettext ("cannot get ELF header '%s': %s"),
584 + err (0, gettext ("cannot get ELF header '%s': %s"),
585 fname, elf_errmsg (-1));
590 if (ehdr->e_type != ET_DYN)
592 - error (0, 0, gettext ("'%s' is not a DSO or PIE"), fname);
593 + err (0, gettext ("'%s' is not a DSO or PIE"), fname);
603 gettext ("getting get section header of section %zu: %s"),
604 elf_ndxscn (scn), elf_errmsg (-1));
607 dyn = gelf_getdyn (data, cnt, &dynmem);
610 - error (0, 0, gettext ("cannot read dynamic section: %s"),
611 + err (0, gettext ("cannot read dynamic section: %s"),
619 - error (0, 0, gettext ("no text relocations reported in '%s'"), fname);
620 + err (0, gettext ("no text relocations reported in '%s'"), fname);
625 struct segments *segments
626 = (struct segments *) malloc (nsegments_max * sizeof (segments[0]));
627 if (segments == NULL)
628 - error (1, errno, gettext ("while reading ELF file"));
629 + err (1, gettext ("while reading ELF file"));
631 for (int i = 0; i < ehdr->e_phnum; ++i)
634 GElf_Phdr *phdr = gelf_getphdr (elf, i, &phdr_mem);
639 gettext ("cannot get program header index at offset %d: %s"),
643 * sizeof (segments[0]));
644 if (segments == NULL)
646 - error (0, 0, gettext ("\
647 + err (0, gettext ("\
648 cannot get program header index at offset %d: %s"),
657 gettext ("cannot get section header of section %Zu: %s"),
658 elf_ndxscn (scn), elf_errmsg (-1));
661 symscn = elf_getscn (elf, shdr->sh_link);
664 - error (0, 0, gettext ("\
665 + err (0, gettext ("\
666 cannot get symbol table section %zu in '%s': %s"),
667 (size_t) shdr->sh_link, fname, elf_errmsg (-1));
670 GElf_Rel *rel = gelf_getrel (data, cnt, &rel_mem);
673 - error (0, 0, gettext ("\
674 + err (0, gettext ("\
675 cannot get relocation at index %d in section %zu in '%s': %s"),
676 cnt, elf_ndxscn (scn), fname, elf_errmsg (-1));
679 GElf_Rela *rela = gelf_getrela (data, cnt, &rela_mem);
682 - error (0, 0, gettext ("\
683 + err (0, gettext ("\
684 cannot get relocation at index %d in section %zu in '%s': %s"),
685 cnt, elf_ndxscn (scn), fname, elf_errmsg (-1));