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

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