Blame SOURCES/gdb-6.3-ppc64displaysymbol-20041124.patch

689258
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
689258
From: Andrew Cagney <cagney@gnu.org>
689258
Date: Fri, 27 Oct 2017 21:07:50 +0200
689258
Subject: gdb-6.3-ppc64displaysymbol-20041124.patch
689258
689258
;; Include the pc's section when doing a symbol lookup so that the
689258
;; correct symbol is found.
689258
;;=push: Write new testcase.
689258
689258
2004-11-24  Andrew Cagney  <cagney@gnu.org>
689258
689258
	* printcmd.c (build_address_symbolic): Find a section for the
689258
	address.
689258
689258
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
689258
--- a/gdb/printcmd.c
689258
+++ b/gdb/printcmd.c
689258
@@ -587,6 +587,14 @@ build_address_symbolic (struct gdbarch *gdbarch,
689258
 	  addr = overlay_mapped_address (addr, section);
689258
 	}
689258
     }
689258
+  /* To ensure that the symbol returned belongs to the correct setion
689258
+     (and that the last [random] symbol from the previous section
689258
+     isn't returned) try to find the section containing PC.  First try
689258
+     the overlay code (which by default returns NULL); and second try
689258
+     the normal section code (which almost always succeeds).  */
689258
+  section = find_pc_overlay (addr);
689258
+  if (section == NULL)
689258
+    section = find_pc_section (addr);
689258
 
689258
   /* First try to find the address in the symbol table, then
689258
      in the minsyms.  Take the closest one.  */