Blame SOURCES/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.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-bz218379-solib-trampoline-lookup-lock-fix.patch
7bc85d
7bc85d
;; Fix lockup on trampoline vs. its function lookup; unreproducible (BZ 218379).
7bc85d
;;=fedora
7bc85d
7bc85d
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379
7bc85d
7bc85d
diff --git a/gdb/symtab.c b/gdb/symtab.c
7bc85d
--- a/gdb/symtab.c
7bc85d
+++ b/gdb/symtab.c
7bc85d
@@ -3165,6 +3165,13 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
7bc85d
 	     SYMBOL_LINKAGE_NAME (msymbol)); */
7bc85d
 	  ;
7bc85d
 	/* fall through */
7bc85d
+	/* `msymbol' trampoline may be located before its .text symbol
7bc85d
+	   but this text symbol may be the address we were looking for.
7bc85d
+	   Avoid `find_pc_sect_line'<->`find_pc_line' infinite loop.
7bc85d
+	   Red Hat Bug 218379.  */
7bc85d
+	else if (BMSYMBOL_VALUE_ADDRESS (mfunsym) == pc)
7bc85d
+	  warning ("In stub for %s (0x%s); interlocked, please submit the binary to http://bugzilla.redhat.com", MSYMBOL_LINKAGE_NAME (msymbol.minsym), paddress (target_gdbarch (), pc));
7bc85d
+	/* fall through */
7bc85d
 	else
7bc85d
 	  return find_pc_line (BMSYMBOL_VALUE_ADDRESS (mfunsym), 0);
7bc85d
       }