keiths / rpms / gdb

Forked from rpms/gdb 5 months ago
Clone
a8767b3
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
f524ac5
From: Fedora GDB patches <invalid@email.com>
f524ac5
Date: Fri, 27 Oct 2017 21:07:50 +0200
f524ac5
Subject: gdb-archer-pie-addons.patch
f524ac5
f637971
;;=push+jan: May get obsoleted by Tom's unrelocated objfiles patch.
f524ac5
f637971
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
f637971
--- a/gdb/gdbtypes.h
f637971
+++ b/gdb/gdbtypes.h
ed8730b
@@ -649,6 +649,7 @@ enum field_loc_kind
8c4c91e
   {
Jan Kratochvil eb6cb2d
     FIELD_LOC_KIND_BITPOS,	/**< bitpos */
Jan Kratochvil eb6cb2d
     FIELD_LOC_KIND_ENUMVAL,	/**< enumval */
8c4c91e
+    /* This address is unrelocated by the objfile's ANOFFSET.  */
Jan Kratochvil eb6cb2d
     FIELD_LOC_KIND_PHYSADDR,	/**< physaddr */
Jan Kratochvil eb6cb2d
     FIELD_LOC_KIND_PHYSNAME,	/**< physname */
Jan Kratochvil eb6cb2d
     FIELD_LOC_KIND_DWARF_BLOCK	/**< dwarf_block */
ed8730b
@@ -699,6 +700,7 @@ union field_location
Jan Kratochvil 32f92b2
      field.  Otherwise, physname is the mangled label of the
Jan Kratochvil 32f92b2
      static field.  */
8c4c91e
 
Jan Kratochvil 32f92b2
+  /* This address is unrelocated by the objfile's ANOFFSET.  */
Jan Kratochvil 32f92b2
   CORE_ADDR physaddr;
Jan Kratochvil 32f92b2
   const char *physname;
Jan Kratochvil 254f0e9
 
f637971
diff --git a/gdb/value.c b/gdb/value.c
f637971
--- a/gdb/value.c
f637971
+++ b/gdb/value.c
ed8730b
@@ -2850,7 +2850,8 @@ value_static_field (struct type *type, int fieldno)
0911f37
     {
dd46ae6
     case FIELD_LOC_KIND_PHYSADDR:
ed8730b
       retval = value_at_lazy (type->field (fieldno).type (),
dd46ae6
-			      TYPE_FIELD_STATIC_PHYSADDR (type, fieldno));
dd46ae6
+			      TYPE_FIELD_STATIC_PHYSADDR (type, fieldno)
a5d2c85
+			      + (TYPE_OBJFILE (type) == NULL ? 0 : TYPE_OBJFILE (type)->section_offsets[SECT_OFF_TEXT (TYPE_OBJFILE (type))]));
dd46ae6
       break;
dd46ae6
     case FIELD_LOC_KIND_PHYSNAME:
0911f37
     {