diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c
index dd6802b05fd..08ffc5f1b4a 100644
--- a/bfd/elf-eh-frame.c
+++ b/bfd/elf-eh-frame.c
@@ -606,7 +606,9 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
       || (sec->flags & SEC_HAS_CONTENTS) == 0
       || sec->sec_info_type != SEC_INFO_TYPE_NONE)
     {
-      /* This file does not contain .eh_frame information.  */
+      /* This file does not contain .eh_frame information or
+	 .eh_frame has already been parsed, as can happen with
+	 --gc-sections.  */
       return;
     }
 
diff --git a/bfd/elf.c b/bfd/elf.c
index 4fa8a2a7911..0fa580d8d78 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -10134,6 +10134,12 @@ _bfd_elf_free_cached_info (bfd *abfd)
 	    }
 	  free (elf_section_data (sec)->relocs);
 	  elf_section_data (sec)->relocs = NULL;
+	  if (sec->sec_info_type == SEC_INFO_TYPE_EH_FRAME)
+	    {
+	      struct eh_frame_sec_info *sec_info
+		= elf_section_data (sec)->sec_info;
+	      free (sec_info->cies);
+	    }
 	}
       free (tdata->symtab_hdr.contents);
       tdata->symtab_hdr.contents = NULL;
