1 From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
2 From: Fedora GDB patches <invalid@email.com>
3 Date: Fri, 27 Oct 2017 21:07:50 +0200
4 Subject: gdb-6.6-buildid-locate-rpm-scl.patch
6 ;; [SCL] Skip deprecated .gdb_index warning for Red Hat built files (BZ 953585).
9 warning: Skipping deprecated .gdb_index section
10 https://bugzilla.redhat.com/show_bug.cgi?id=953585
12 diff --git a/gdb/build-id.c b/gdb/build-id.c
15 @@ -689,7 +689,11 @@ static int missing_rpm_list_entries;
16 /* Returns the count of newly added rpms. */
19 +#ifndef GDB_INDEX_VERIFY_VENDOR
20 missing_rpm_enlist (const char *filename)
22 +missing_rpm_enlist_1 (const char *filename, int verify_vendor)
25 static int rpm_init_done = 0;
27 @@ -796,7 +800,11 @@ missing_rpm_enlist (const char *filename)
28 mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0);
31 +#ifndef GDB_INDEX_VERIFY_VENDOR
34 + if (!verify_vendor) for (;;)
38 char *debuginfo, **slot, *s, *s2;
39 @@ -914,6 +922,37 @@ missing_rpm_enlist (const char *filename)
43 +#ifdef GDB_INDEX_VERIFY_VENDOR
44 + else /* verify_vendor */
46 + int vendor_pass = 0, vendor_fail = 0;
54 + h = rpmdbNextIterator_p (mi);
58 + vendor = headerFormat_p (h, "%{vendor}", &err);
61 + warning (_("Error querying the rpm file `%s': %s"), filename,
65 + if (strcmp (vendor, "Red Hat, Inc.") == 0)
71 + count = vendor_pass != 0 && vendor_fail == 0;
75 rpmdbFreeIterator_p (mi);
77 @@ -924,6 +963,21 @@ missing_rpm_enlist (const char *filename)
81 +#ifdef GDB_INDEX_VERIFY_VENDOR
82 +missing_rpm_enlist (const char *filename)
84 + return missing_rpm_enlist_1 (filename, 0);
87 +extern int rpm_verify_vendor (const char *filename);
89 +rpm_verify_vendor (const char *filename)
91 + return missing_rpm_enlist_1 (filename, 1);
96 missing_rpm_list_compar (const char *const *ap, const char *const *bp)
98 return strcoll (*ap, *bp);
99 diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
100 --- a/gdb/dwarf2read.c
101 +++ b/gdb/dwarf2read.c
102 @@ -3469,6 +3469,16 @@ read_gdb_index_from_section (struct objfile *objfile,
103 "set use-deprecated-index-sections on". */
104 if (version < 6 && !deprecated_ok)
106 +#ifdef GDB_INDEX_VERIFY_VENDOR
107 + extern int rpm_verify_vendor (const char *filename);
109 + /* Red Hat Developer Toolset exception. */
110 + if (rpm_verify_vendor (filename))
116 static int warning_printed = 0;
117 if (!warning_printed)
119 @@ -3480,6 +3490,10 @@ to use the section anyway."),
123 +#ifdef GDB_INDEX_VERIFY_VENDOR
128 /* Version 7 indices generated by gold refer to the CU for a symbol instead
129 of the TU (for symbols coming from TUs),