Merge branch 'master' of ssh://git.fedorahosted.org/git/elfutils
diff --git a/src/elflint.c b/src/elflint.c
index 1c508c4..1929902 100644
--- a/src/elflint.c
+++ b/src/elflint.c
@@ -3358,6 +3358,13 @@
    && !memcmp (special_sections[idx].name, string, \
 	       sizeof string - (prefix ? 1 : 0)))
 
+
+/* Indeces of some sections we need later.  */
+static size_t eh_frame_hdr_scnndx;
+static size_t eh_frame_scnndx;
+static size_t gcc_except_table_scnndx;
+
+
 static void
 check_sections (Ebl *ebl, GElf_Ehdr *ehdr)
 {
@@ -3554,6 +3561,14 @@
 
 		break;
 	      }
+
+	  /* Remember a few special sections for later.  */
+	  if (strcmp (scnname, ".eh_frame_hdr") == 0)
+	    eh_frame_hdr_scnndx = cnt;
+	  else if (strcmp (scnname, ".eh_frame") == 0)
+	    eh_frame_scnndx = cnt;
+	  else if (strcmp (scnname, ".gcc_except_table") == 0)
+	    gcc_except_table_scnndx = cnt;
 	}
 
       if (shdr->sh_entsize != 0 && shdr->sh_size % shdr->sh_entsize)
@@ -3961,6 +3976,7 @@
   return last_offset;
 }
 
+
 static void
 check_note (Ebl *ebl, GElf_Ehdr *ehdr, GElf_Phdr *phdr, int cnt)
 {
@@ -3992,6 +4008,7 @@
 	   cnt, phdr->p_filesz - notes_size);
 }
 
+
 static void
 check_note_section (Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int idx)
 {
@@ -4023,6 +4040,11 @@
 	   idx, section_name (ebl, idx), shdr->sh_size - notes_size);
 }
 
+
+/* Index of the PT_GNU_EH_FRAME program eader entry.  */
+static int pt_gnu_eh_frame_pndx;
+
+
 static void
 check_program_header (Ebl *ebl, GElf_Ehdr *ehdr)
 {
@@ -4206,6 +4228,9 @@
 	  if ((phdr->p_flags & PF_X) != 0)
 	    ERROR (gettext ("\
 call frame search table must not be executable\n"));
+
+	  /* Remember which entry this is.  */
+	  pt_gnu_eh_frame_pndx = cnt;
 	}
 
       if (phdr->p_filesz > phdr->p_memsz
@@ -4227,6 +4252,14 @@
 }
 
 
+static void
+check_exception_data (Ebl *ebl, GElf_Ehdr *ehdr)
+{
+  ebl;
+  ehdr;
+}
+
+
 /* Process one file.  */
 static void
 process_elf_file (Elf *elf, const char *prefix, const char *suffix,
@@ -4275,6 +4308,11 @@
      headers at all.  */
   check_sections (ebl, ehdr);
 
+  /* Check the exception handling data, if it exists.  */
+  if (pt_gnu_eh_frame_pndx != 0 || eh_frame_hdr_scnndx != 0
+      || eh_frame_scnndx != 0 || gcc_except_table_scnndx != 0)
+    check_exception_data (ebl, ehdr);
+
   /* Report if no relocation section needed the text relocation flag.  */
   if (textrel && !needed_textrel)
     ERROR (gettext ("text relocation flag set but not needed\n"));