recipes: libs/ncurses: Do not use the C11 Noreturn feature for now
[dragora.git] / patches / elfutils / musl-qsort_r.patch
blob10697d6023af9eb0480f65cdae523633a15ca92b
1 --- src/readelf.c
2 +++ src/readelf.c
3 @@ -4773,10 +4773,11 @@ listptr_base (struct listptr *p)
4 return cudie_base (&cu);
7 +static const char *listptr_name;
9 static int
10 -compare_listptr (const void *a, const void *b, void *arg)
11 +compare_listptr (const void *a, const void *b)
13 - const char *name = arg;
14 struct listptr *p1 = (void *) a;
15 struct listptr *p2 = (void *) b;
17 @@ -4792,21 +4793,21 @@ compare_listptr (const void *a, const void *b, void *arg)
18 p1->warned = p2->warned = true;
19 error (0, 0,
20 gettext ("%s %#" PRIx64 " used with different address sizes"),
21 - name, (uint64_t) p1->offset);
22 + listptr_name, (uint64_t) p1->offset);
24 if (p1->dwarf64 != p2->dwarf64)
26 p1->warned = p2->warned = true;
27 error (0, 0,
28 gettext ("%s %#" PRIx64 " used with different offset sizes"),
29 - name, (uint64_t) p1->offset);
30 + listptr_name, (uint64_t) p1->offset);
32 if (listptr_base (p1) != listptr_base (p2))
34 p1->warned = p2->warned = true;
35 error (0, 0,
36 gettext ("%s %#" PRIx64 " used with different base addresses"),
37 - name, (uint64_t) p1->offset);
38 + listptr_name, (uint64_t) p1->offset);
40 if (p1->attr != p2 ->attr)
42 @@ -4814,7 +4815,7 @@ compare_listptr (const void *a, const void *b, void *arg)
43 error (0, 0,
44 gettext ("%s %#" PRIx64
45 " used with different attribute %s and %s"),
46 - name, (uint64_t) p1->offset, dwarf_attr_name (p2->attr),
47 + listptr_name, (uint64_t) p1->offset, dwarf_attr_name (p2->attr),
48 dwarf_attr_name (p2->attr));
51 @@ -4885,9 +4886,11 @@ notice_listptr (enum section_e section, struct listptr_table *table,
52 static void
53 sort_listptr (struct listptr_table *table, const char *name)
55 - if (table->n > 0)
56 - qsort_r (table->table, table->n, sizeof table->table[0],
57 - &compare_listptr, (void *) name);
58 + if (table->n > 0) {
59 + listptr_name = name;
60 + qsort (table->table, table->n, sizeof table->table[0],
61 + &compare_listptr);
62 + }
65 static bool