#!/bin/sh /usr/share/dpatch/dpatch-run
## 03-gcc4-mips.dpatch by Matej Vela <vela@debian.org>
##
## DP: Fixes FTBFS on mips, mipsel, and alpha with GCC 4

@DPATCH@
diff -urNad lush-1.2.1~/src/dldbfd.c lush-1.2.1/src/dldbfd.c
--- lush-1.2.1~/src/dldbfd.c	2006-11-02 17:46:09.000000000 +0100
+++ lush-1.2.1/src/dldbfd.c	2006-12-14 12:31:22.000000000 +0100
@@ -88,9 +88,11 @@
 
 #ifdef bfd_get_section_size_before_reloc   /* bfd<2.15 */
 # define dldbfd_section_rawsize(p) ((p)->_raw_size)
+# define dldbfd_set_section_rawsize(p, v) ((p)->_raw_size = (v))
 # define dldbfd_section_size(p) ((p)->_cooked_size)
 #else
 # define dldbfd_section_rawsize(p) ((p)->rawsize ? (p)->rawsize : (p)->size)
+# define dldbfd_set_section_rawsize(p, v) ((p)->rawsize ? ((p)->rawsize = (v)) : ((p)->size = (v)))
 # define dldbfd_section_size(p) ((p)->size)
 #endif
 
@@ -1227,7 +1229,7 @@
       sgot = bfd_make_section(ent->abfd, ".got");
       ASSERT_BFD(sgot);
       sgot->flags = SEC_ALLOC|SEC_RELOC;
-      dldbfd_section_rawsize(sgot) = 0;
+      dldbfd_set_section_rawsize(sgot, 0);
       dldbfd_section_size(sgot) = offset;
       if (sgot->alignment_power < 4)
         sgot->alignment_power = 4;
@@ -1597,7 +1599,7 @@
       sgot = bfd_make_section(ent->abfd, ".got");
       ASSERT(sgot);
       sgot->flags = SEC_ALLOC|SEC_RELOC|SEC_LOAD;
-      dldbfd_section_rawsize(sgot) = 0;
+      dldbfd_set_section_rawsize(sgot, 0);
       dldbfd_section_size(sgot) = offset;
       if (sgot->alignment_power < 4)
 	sgot->alignment_power = 4;      /* Set GOT relocations */
