1a405f
diff -rup binutils-2.27.orig/bfd/elf-eh-frame.c binutils-2.27/bfd/elf-eh-frame.c
1a405f
--- binutils-2.27.orig/bfd/elf-eh-frame.c	2017-01-16 17:27:46.411632857 +0000
1a405f
+++ binutils-2.27/bfd/elf-eh-frame.c	2017-01-16 17:30:03.663437755 +0000
1a405f
@@ -2296,7 +2296,15 @@ write_dwarf_eh_frame_hdr (bfd *abfd, str
1a405f
 		  != sec->output_section->vma + val))
1a405f
 	    overflow = TRUE;
1a405f
 	  bfd_put_32 (abfd, val, contents + EH_FRAME_HDR_SIZE + i * 8 + 8);
1a405f
-	  if (i != 0
1a405f
+	  if (i > 0
1a405f
+	      && hdr_info->u.dwarf.array[i].initial_loc
1a405f
+	      == hdr_info->u.dwarf.array[i - 1].initial_loc
1a405f
+	      && hdr_info->u.dwarf.array[i].range
1a405f
+	      == hdr_info->u.dwarf.array[i - 1].range)
1a405f
+	    /* Duplicate FDE entry.  We should probably discard it
1a405f
+	       but for now just ignore it.  */
1a405f
+	    ;
1a405f
+	  else if (i != 0
1a405f
 	      && (hdr_info->u.dwarf.array[i].initial_loc
1a405f
 		  < (hdr_info->u.dwarf.array[i - 1].initial_loc
1a405f
 		     + hdr_info->u.dwarf.array[i - 1].range)))