Blame SOURCES/gdb-archer-pie-addons.patch

7a6771
Index: gdb-7.9.50.20150520/gdb/gdbtypes.h
7a6771
===================================================================
7a6771
--- gdb-7.9.50.20150520.orig/gdb/gdbtypes.h	2015-05-31 16:55:29.723475485 +0200
7a6771
+++ gdb-7.9.50.20150520/gdb/gdbtypes.h	2015-05-31 16:55:49.716601669 +0200
7a6771
@@ -462,6 +462,7 @@ enum field_loc_kind
7a6771
   {
7a6771
     FIELD_LOC_KIND_BITPOS,	/**< bitpos */
7a6771
     FIELD_LOC_KIND_ENUMVAL,	/**< enumval */
7a6771
+    /* This address is unrelocated by the objfile's ANOFFSET.  */
7a6771
     FIELD_LOC_KIND_PHYSADDR,	/**< physaddr */
7a6771
     FIELD_LOC_KIND_PHYSNAME,	/**< physname */
7a6771
     FIELD_LOC_KIND_DWARF_BLOCK	/**< dwarf_block */
7a6771
@@ -513,6 +514,7 @@ union field_location
7a6771
      field.  Otherwise, physname is the mangled label of the
7a6771
      static field.  */
7a6771
 
7a6771
+  /* This address is unrelocated by the objfile's ANOFFSET.  */
7a6771
   CORE_ADDR physaddr;
7a6771
   const char *physname;
7a6771
 
7a6771
@@ -1386,6 +1388,7 @@ extern void set_type_vptr_basetype (stru
7a6771
 #define FIELD_ENUMVAL_LVAL(thisfld) ((thisfld).loc.enumval)
7a6771
 #define FIELD_ENUMVAL(thisfld) (FIELD_ENUMVAL_LVAL (thisfld) + 0)
7a6771
 #define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname)
7a6771
+/* This address is unrelocated by the objfile's ANOFFSET.  */
7a6771
 #define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr)
7a6771
 #define FIELD_DWARF_BLOCK(thisfld) ((thisfld).loc.dwarf_block)
7a6771
 #define SET_FIELD_BITPOS(thisfld, bitpos)			\
7a6771
@@ -1397,6 +1400,7 @@ extern void set_type_vptr_basetype (stru
7a6771
 #define SET_FIELD_PHYSNAME(thisfld, name)			\
7a6771
   (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME,		\
7a6771
    FIELD_STATIC_PHYSNAME (thisfld) = (name))
7a6771
+/* This address is unrelocated by the objfile's ANOFFSET.  */
7a6771
 #define SET_FIELD_PHYSADDR(thisfld, addr)			\
7a6771
   (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR,		\
7a6771
    FIELD_STATIC_PHYSADDR (thisfld) = (addr))
7a6771
@@ -1413,6 +1417,7 @@ extern void set_type_vptr_basetype (stru
7a6771
 #define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n))
7a6771
 #define TYPE_FIELD_ENUMVAL(thistype, n) FIELD_ENUMVAL (TYPE_FIELD (thistype, n))
7a6771
 #define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIELD (thistype, n))
7a6771
+/* This address is unrelocated by the objfile's ANOFFSET.  */
7a6771
 #define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIELD (thistype, n))
7a6771
 #define TYPE_FIELD_DWARF_BLOCK(thistype, n) FIELD_DWARF_BLOCK (TYPE_FIELD (thistype, n))
7a6771
 #define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n))
7a6771
Index: gdb-7.9.50.20150520/gdb/jv-lang.c
7a6771
===================================================================
7a6771
--- gdb-7.9.50.20150520.orig/gdb/jv-lang.c	2015-05-31 16:55:29.724475491 +0200
7a6771
+++ gdb-7.9.50.20150520/gdb/jv-lang.c	2015-05-31 16:55:30.820482408 +0200
7a6771
@@ -427,7 +427,8 @@ java_link_class_type (struct gdbarch *gd
7a6771
 
7a6771
   fields = NULL;
7a6771
   nfields--;			/* First set up dummy "class" field.  */
7a6771
-  SET_FIELD_PHYSADDR (TYPE_FIELD (type, nfields), value_address (clas));
7a6771
+  SET_FIELD_PHYSADDR (TYPE_FIELD (type, nfields), value_address (clas)
7a6771
+    - (TYPE_OBJFILE (type) == NULL ? 0 : ANOFFSET (TYPE_OBJFILE (type)->section_offsets, SECT_OFF_TEXT (TYPE_OBJFILE (type)))));
7a6771
   TYPE_FIELD_NAME (type, nfields) = "class";
7a6771
   TYPE_FIELD_TYPE (type, nfields) = value_type (clas);
7a6771
   SET_TYPE_FIELD_PRIVATE (type, nfields);
7a6771
@@ -475,7 +476,8 @@ java_link_class_type (struct gdbarch *gd
7a6771
 	  SET_TYPE_FIELD_PROTECTED (type, i);
7a6771
 	}
7a6771
       if (accflags & 0x0008)	/* ACC_STATIC */
7a6771
-	SET_FIELD_PHYSADDR (TYPE_FIELD (type, i), boffset);
7a6771
+	SET_FIELD_PHYSADDR (TYPE_FIELD (type, i), boffset
7a6771
+	  - (TYPE_OBJFILE (type) == NULL ? 0 : ANOFFSET (TYPE_OBJFILE (type)->section_offsets, SECT_OFF_TEXT (TYPE_OBJFILE (type)))));
7a6771
       else
7a6771
 	SET_FIELD_BITPOS (TYPE_FIELD (type, i), 8 * boffset);
7a6771
       if (accflags & 0x8000)	/* FIELD_UNRESOLVED_FLAG */
7a6771
Index: gdb-7.9.50.20150520/gdb/value.c
7a6771
===================================================================
7a6771
--- gdb-7.9.50.20150520.orig/gdb/value.c	2015-05-31 16:55:29.725475497 +0200
7a6771
+++ gdb-7.9.50.20150520/gdb/value.c	2015-05-31 16:55:30.821482415 +0200
7a6771
@@ -2951,7 +2951,8 @@ value_static_field (struct type *type, i
7a6771
     {
7a6771
     case FIELD_LOC_KIND_PHYSADDR:
7a6771
       retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno),
7a6771
-			      TYPE_FIELD_STATIC_PHYSADDR (type, fieldno));
7a6771
+			      TYPE_FIELD_STATIC_PHYSADDR (type, fieldno)
7a6771
+			      + (TYPE_OBJFILE (type) == NULL ? 0 : ANOFFSET (TYPE_OBJFILE (type)->section_offsets, SECT_OFF_TEXT (TYPE_OBJFILE (type)))));
7a6771
       break;
7a6771
     case FIELD_LOC_KIND_PHYSNAME:
7a6771
     {