



2015-06-01 Juan Manuel Guerrero  <juan.guerrero@gmx.de>

	* bfd/cofflink.c (_bfd_coff_generic_relocate_section): Do not ignore
	the relocation if the output section has been discarded.


2015-06-01 Eli Zaretskii  <eliz@gnu.org>

	* go32-nat.c (go32_xfer_memory): Fix the return value to be
	compatible to what read_child and write_child return.  This
	unbreaks that DJGPP build of GDB which was broken since v7.7.





diff -aprNU5 gdb-7.9.1.orig/bfd/cofflink.c gdb-7.9.1/bfd/cofflink.c
--- gdb-7.9.1.orig/bfd/cofflink.c	2015-06-04 21:13:08 +0000
+++ gdb-7.9.1/bfd/cofflink.c	2015-06-04 21:23:52 +0000
@@ -2977,13 +2977,18 @@ _bfd_coff_generic_relocate_section (bfd
 	    }
 	  else
 	    {
 	      sec = sections[symndx];
 
+	      /* This does not work for the DJGPP port of gdb-7.9.1.
+	         As soon as this issue has been fixed in the master branch
+	         it will be removed in the next DJGPP port.  */
+#ifndef __DJGPP__
 	      /* If the output section has been discarded then ignore this reloc.  */
 	      if (sec->output_section->vma == 0)
 		continue;
+#endif
 
               val = (sec->output_section->vma
 		     + sec->output_offset
 		     + sym->n_value);
 	      if (! obj_pe (input_bfd))
diff -aprNU5 gdb-7.9.1.orig/gdb/go32-nat.c gdb-7.9.1/gdb/go32-nat.c
--- gdb-7.9.1.orig/gdb/go32-nat.c	2015-02-06 21:23:42 +0000
+++ gdb-7.9.1/gdb/go32-nat.c	2015-06-04 21:25:10 +0000
@@ -585,14 +585,16 @@ go32_xfer_memory (gdb_byte *readbuf, con
   if (writebuf != NULL)
     res = my_write_child (memaddr, writebuf, len);
   else
     res = read_child (memaddr, readbuf, len);
 
-  if (res <= 0)
+  /* read_child and write_child return zero on success, non-zero on
+     failure.  */
+  if (res != 0)
     return TARGET_XFER_E_IO;
 
-  *xfered_len = res;
+  *xfered_len = len;
   return TARGET_XFER_OK;
 }
 
 /* Target to_xfer_partial implementation.  */
 
