Blame SOURCES/gdb-6.5-bz203661-emit-relocs.patch

190f2a
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
190f2a
From: Fedora GDB patches <invalid@email.com>
190f2a
Date: Fri, 27 Oct 2017 21:07:50 +0200
190f2a
Subject: gdb-6.5-bz203661-emit-relocs.patch
190f2a
190f2a
;; Fix debuginfo addresses resolving for --emit-relocs Linux kernels (BZ 203661).
190f2a
;;=push+jan: There was some mail thread about it, this patch may be a hack.
190f2a
190f2a
diff --git a/gdb/symfile.c b/gdb/symfile.c
190f2a
--- a/gdb/symfile.c
190f2a
+++ b/gdb/symfile.c
190f2a
@@ -3584,6 +3584,12 @@ default_symfile_relocate (struct objfile *objfile, asection *sectp,
190f2a
      DWO file.  */
190f2a
   bfd *abfd = sectp->owner;
190f2a
 
190f2a
+  /* Executable files have all the relocations already resolved.
190f2a
+     Handle files linked with --emit-relocs.
190f2a
+     http://sources.redhat.com/ml/gdb/2006-08/msg00137.html  */
190f2a
+  if ((abfd->flags & EXEC_P) != 0)
190f2a
+    return NULL;
190f2a
+
190f2a
   /* We're only interested in sections with relocation
190f2a
      information.  */
190f2a
   if ((sectp->flags & SEC_RELOC) == 0)