Blob Blame History Raw
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-6.5-bz203661-emit-relocs.patch

;; Fix debuginfo addresses resolving for --emit-relocs Linux kernels (BZ 203661).
;;=push+jan: There was some mail thread about it, this patch may be a hack.

diff --git a/gdb/symfile.c b/gdb/symfile.c
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -3492,6 +3492,12 @@ default_symfile_relocate (struct objfile *objfile, asection *sectp,
      DWO file.  */
   bfd *abfd = sectp->owner;
 
+  /* Executable files have all the relocations already resolved.
+     Handle files linked with --emit-relocs.
+     http://sources.redhat.com/ml/gdb/2006-08/msg00137.html  */
+  if ((abfd->flags & EXEC_P) != 0)
+    return NULL;
+
   /* We're only interested in sections with relocation
      information.  */
   if ((sectp->flags & SEC_RELOC) == 0)