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

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