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 FileName: gdb-6.6-buildid-locate-rpm-scl.patch
8 ;; [SCL] Skip deprecated .gdb_index warning for Red Hat built files (BZ 953585).
11 warning: Skipping deprecated .gdb_index section
12 https://bugzilla.redhat.com/show_bug.cgi?id=953585
14 gdb/build-id.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
15 gdb/dwarf2read.c | 14 ++++++++++++++
16 2 files changed, 68 insertions(+)
18 diff --git a/gdb/build-id.c b/gdb/build-id.c
19 index e2c1e81266..1b75530f91 100644
22 @@ -715,7 +715,11 @@ static int missing_rpm_list_entries;
23 /* Returns the count of newly added rpms. */
26 +#ifndef GDB_INDEX_VERIFY_VENDOR
27 missing_rpm_enlist (const char *filename)
29 +missing_rpm_enlist_1 (const char *filename, int verify_vendor)
32 static int rpm_init_done = 0;
34 @@ -822,7 +826,11 @@ missing_rpm_enlist (const char *filename)
35 mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0);
38 +#ifndef GDB_INDEX_VERIFY_VENDOR
41 + if (!verify_vendor) for (;;)
45 char *debuginfo, **slot, *s, *s2;
46 @@ -940,6 +948,37 @@ missing_rpm_enlist (const char *filename)
50 +#ifdef GDB_INDEX_VERIFY_VENDOR
51 + else /* verify_vendor */
53 + int vendor_pass = 0, vendor_fail = 0;
61 + h = rpmdbNextIterator_p (mi);
65 + vendor = headerFormat_p (h, "%{vendor}", &err);
68 + warning (_("Error querying the rpm file `%s': %s"), filename,
72 + if (strcmp (vendor, "Red Hat, Inc.") == 0)
78 + count = vendor_pass != 0 && vendor_fail == 0;
82 rpmdbFreeIterator_p (mi);
84 @@ -950,6 +989,21 @@ missing_rpm_enlist (const char *filename)
88 +#ifdef GDB_INDEX_VERIFY_VENDOR
89 +missing_rpm_enlist (const char *filename)
91 + return missing_rpm_enlist_1 (filename, 0);
94 +extern int rpm_verify_vendor (const char *filename);
96 +rpm_verify_vendor (const char *filename)
98 + return missing_rpm_enlist_1 (filename, 1);
103 missing_rpm_list_compar (const char *const *ap, const char *const *bp)
105 return strcoll (*ap, *bp);
106 diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
107 index 2c972d5e74..64329af71e 100644
108 --- a/gdb/dwarf2read.c
109 +++ b/gdb/dwarf2read.c
110 @@ -3725,6 +3725,16 @@ read_index_from_section (struct objfile *objfile,
111 "set use-deprecated-index-sections on". */
112 if (version < 6 && !deprecated_ok)
114 +#ifdef GDB_INDEX_VERIFY_VENDOR
115 + extern int rpm_verify_vendor (const char *filename);
117 + /* Red Hat Developer Toolset exception. */
118 + if (rpm_verify_vendor (filename))
124 static int warning_printed = 0;
125 if (!warning_printed)
127 @@ -3736,6 +3746,10 @@ to use the section anyway."),
131 +#ifdef GDB_INDEX_VERIFY_VENDOR
136 /* Version 7 indices generated by gold refer to the CU for a symbol instead
137 of the TU (for symbols coming from TUs),