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

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