&& !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)
{
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)
return last_offset;
}
+
static void
check_note (Ebl *ebl, GElf_Ehdr *ehdr, GElf_Phdr *phdr, int cnt)
{
cnt, phdr->p_filesz - notes_size);
}
+
static void
check_note_section (Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int idx)
{
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)
{
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
}
+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,
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"));