01917d
Index: gdb-7.5.50.20130118/gdb/gdbtypes.h
01917d
===================================================================
01917d
--- gdb-7.5.50.20130118.orig/gdb/gdbtypes.h	2013-01-18 23:07:03.488358315 +0100
01917d
+++ gdb-7.5.50.20130118/gdb/gdbtypes.h	2013-01-18 23:08:10.286451570 +0100
01917d
@@ -420,6 +420,7 @@ enum field_loc_kind
01917d
   {
01917d
     FIELD_LOC_KIND_BITPOS,	/* bitpos */
01917d
     FIELD_LOC_KIND_ENUMVAL,	/* enumval */
01917d
+    /* This address is unrelocated by the objfile's ANOFFSET.  */
01917d
     FIELD_LOC_KIND_PHYSADDR,	/* physaddr */
01917d
     FIELD_LOC_KIND_PHYSNAME,	/* physname */
01917d
     FIELD_LOC_KIND_DWARF_BLOCK	/* dwarf_block */
01917d
@@ -614,6 +615,7 @@ struct main_type
01917d
 	   is the location (in the target) of the static field.
01917d
 	   Otherwise, physname is the mangled label of the static field.  */
01917d
 
01917d
+	/* This address is unrelocated by the objfile's ANOFFSET.  */
01917d
 	CORE_ADDR physaddr;
01917d
 	const char *physname;
01917d
 
01917d
@@ -1237,6 +1239,7 @@ extern void allocate_gnat_aux_type (stru
01917d
 #define FIELD_ENUMVAL_LVAL(thisfld) ((thisfld).loc.enumval)
01917d
 #define FIELD_ENUMVAL(thisfld) (FIELD_ENUMVAL_LVAL (thisfld) + 0)
01917d
 #define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname)
01917d
+/* This address is unrelocated by the objfile's ANOFFSET.  */
01917d
 #define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr)
01917d
 #define FIELD_DWARF_BLOCK(thisfld) ((thisfld).loc.dwarf_block)
01917d
 #define SET_FIELD_BITPOS(thisfld, bitpos)			\
01917d
@@ -1248,6 +1251,7 @@ extern void allocate_gnat_aux_type (stru
01917d
 #define SET_FIELD_PHYSNAME(thisfld, name)			\
01917d
   (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME,		\
01917d
    FIELD_STATIC_PHYSNAME (thisfld) = (name))
01917d
+/* This address is unrelocated by the objfile's ANOFFSET.  */
01917d
 #define SET_FIELD_PHYSADDR(thisfld, addr)			\
01917d
   (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR,		\
01917d
    FIELD_STATIC_PHYSADDR (thisfld) = (addr))
01917d
@@ -1264,6 +1268,7 @@ extern void allocate_gnat_aux_type (stru
01917d
 #define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n))
01917d
 #define TYPE_FIELD_ENUMVAL(thistype, n) FIELD_ENUMVAL (TYPE_FIELD (thistype, n))
01917d
 #define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIELD (thistype, n))
01917d
+/* This address is unrelocated by the objfile's ANOFFSET.  */
01917d
 #define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIELD (thistype, n))
01917d
 #define TYPE_FIELD_DWARF_BLOCK(thistype, n) FIELD_DWARF_BLOCK (TYPE_FIELD (thistype, n))
01917d
 #define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n))
01917d
Index: gdb-7.5.50.20130118/gdb/jv-lang.c
01917d
===================================================================
01917d
--- gdb-7.5.50.20130118.orig/gdb/jv-lang.c	2013-01-18 23:07:03.488358315 +0100
01917d
+++ gdb-7.5.50.20130118/gdb/jv-lang.c	2013-01-18 23:08:10.286451570 +0100
01917d
@@ -430,7 +430,8 @@ java_link_class_type (struct gdbarch *gd
01917d
 
01917d
   fields = NULL;
01917d
   nfields--;			/* First set up dummy "class" field.  */
01917d
-  SET_FIELD_PHYSADDR (TYPE_FIELD (type, nfields), value_address (clas));
01917d
+  SET_FIELD_PHYSADDR (TYPE_FIELD (type, nfields), value_address (clas)
01917d
+    - (TYPE_OBJFILE (type) == NULL ? 0 : ANOFFSET (TYPE_OBJFILE (type)->section_offsets, SECT_OFF_TEXT (TYPE_OBJFILE (type)))));
01917d
   TYPE_FIELD_NAME (type, nfields) = "class";
01917d
   TYPE_FIELD_TYPE (type, nfields) = value_type (clas);
01917d
   SET_TYPE_FIELD_PRIVATE (type, nfields);
01917d
@@ -478,7 +479,8 @@ java_link_class_type (struct gdbarch *gd
01917d
 	  SET_TYPE_FIELD_PROTECTED (type, i);
01917d
 	}
01917d
       if (accflags & 0x0008)	/* ACC_STATIC */
01917d
-	SET_FIELD_PHYSADDR (TYPE_FIELD (type, i), boffset);
01917d
+	SET_FIELD_PHYSADDR (TYPE_FIELD (type, i), boffset
01917d
+	  - (TYPE_OBJFILE (type) == NULL ? 0 : ANOFFSET (TYPE_OBJFILE (type)->section_offsets, SECT_OFF_TEXT (TYPE_OBJFILE (type)))));
01917d
       else
01917d
 	SET_FIELD_BITPOS (TYPE_FIELD (type, i), 8 * boffset);
01917d
       if (accflags & 0x8000)	/* FIELD_UNRESOLVED_FLAG */
01917d
Index: gdb-7.5.50.20130118/gdb/value.c
01917d
===================================================================
01917d
--- gdb-7.5.50.20130118.orig/gdb/value.c	2013-01-18 23:07:03.490358319 +0100
01917d
+++ gdb-7.5.50.20130118/gdb/value.c	2013-01-18 23:08:10.287451543 +0100
01917d
@@ -2624,7 +2624,8 @@ value_static_field (struct type *type, i
01917d
     {
01917d
     case FIELD_LOC_KIND_PHYSADDR:
01917d
       retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno),
01917d
-			      TYPE_FIELD_STATIC_PHYSADDR (type, fieldno));
01917d
+			      TYPE_FIELD_STATIC_PHYSADDR (type, fieldno)
01917d
+			      + (TYPE_OBJFILE (type) == NULL ? 0 : ANOFFSET (TYPE_OBJFILE (type)->section_offsets, SECT_OFF_TEXT (TYPE_OBJFILE (type)))));
01917d
       break;
01917d
     case FIELD_LOC_KIND_PHYSNAME:
01917d
     {