 +test -z "$CREATE_SHLIB$CREATE_PIE" && test -n "$DATA_ADDR" && COMMONPAGESIZE=""
 +test -n "$RELRO_NOW" && unset SEPARATE_GOTPLT
 +test -z "$ATTRS_SECTIONS" && ATTRS_SECTIONS=".gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }"
-+DATA_SEGMENT_ALIGN="ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))"
++DATA_SEGMENT_ALIGN="ALIGN(${SEGMENT_SIZE}) + (. & (${COMMONPAGESIZE} - 1))"
 +DATA_SEGMENT_RELRO_END=""
 +DATA_SEGMENT_END=""
-+if test -n "${COMMONPAGESIZE}"; then
-+  DATA_SEGMENT_ALIGN="ALIGN (${SEGMENT_SIZE}) - ((${MAXPAGESIZE} - .) & (${MAXPAGESIZE} - 1)); . = DATA_SEGMENT_ALIGN (${MAXPAGESIZE}, ${COMMONPAGESIZE})"
-+  DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);"
-+  DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);"
-+fi
 +if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then
 +  INITIAL_READONLY_SECTIONS=".interp       ${RELOCATING-0} : { *(.interp) }"
 +fi

     default:
       return 0;
     }
@@ -8597,4 +9091,25 @@
       bss_section = saved_bss_section;
     }
 }

     bfd_elf64_powerpc_vec)	tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_powerpcle_vec)	tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
     bfd_elf64_s390_vec)		tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;;
diff -Naur ../PRISTINE/binutils-2.20/bfd/elf.c binutils-2.20/bfd/elf.c
--- ../PRISTINE/binutils-2.20/bfd/elf.c	2009-09-10 13:47:12.000000000 +0200
+++ binutils-2.20/bfd/elf.c	2010-05-17 17:38:36.000000000 +0200
@@ -7266,7 +7266,13 @@
 			       bfd_size_type count)
 {
   Elf_Internal_Shdr *hdr;
-  bfd_signed_vma pos;
+  bfd_signed_vma pos, hlts_pos;
+  static unsigned char HLTs[0x20] = {
+    0xF4, 0xF4, 0xF4, 0xF4, 0xF4, 0xF4, 0xF4, 0xF4,
+    0xF4, 0xF4, 0xF4, 0xF4, 0xF4, 0xF4, 0xF4, 0xF4,
+    0xF4, 0xF4, 0xF4, 0xF4, 0xF4, 0xF4, 0xF4, 0xF4,
+    0xF4, 0xF4, 0xF4, 0xF4, 0xF4, 0xF4, 0xF4, 0xF4
+  };
 
   if (! abfd->output_has_begun
       && ! _bfd_elf_compute_section_file_positions (abfd, NULL))
@@ -7274,6 +7280,26 @@
 
   hdr = &elf_section_data (section)->this_hdr;
   pos = hdr->sh_offset + offset;
+
+  /* TODO(khim): make the behaviour configurable */
+  hlts_pos = ((pos + count - 1) & ~0xFFFF) + 0xFFE0;
+  if (hlts_pos > pos)
+    {
+      if ((bfd_get_section_flags (abfd, section) & SEC_CODE) &&
+          (bfd_seek (abfd, hlts_pos, SEEK_SET) != 0
+           || bfd_bwrite(HLTs, 0x20, abfd) != 0x20))
+        return FALSE;
+    }
+  else
+    {
+      bfd_size_type hlts_count = 0x20 + hlts_pos - pos;
+      if ((bfd_get_section_flags (abfd, section) & SEC_CODE) &&
+          (bfd_seek (abfd, pos, SEEK_SET) != 0
+           || bfd_bwrite(HLTs, hlts_count, abfd) != hlts_count))
+      return FALSE;
+    }
+    
+
   if (bfd_seek (abfd, pos, SEEK_SET) != 0
       || bfd_bwrite (location, count, abfd) != count)
     return FALSE;
diff -Naur ../PRISTINE/binutils-2.20/bfd/elf32-i386.c binutils-2.20/bfd/elf32-i386.c
--- ../PRISTINE/binutils-2.20/bfd/elf32-i386.c	2009-09-10 04:47:12.000000000 -0700
+++ binutils-2.20/bfd/elf32-i386.c	2010-01-05 13:21:03.387256000 -0800
