summaryrefslogtreecommitdiffstats
path: root/src/elflint.c
diff options
context:
space:
mode:
authorUlrich Drepper <[email protected]>2009-01-21 13:05:36 -0800
committerUlrich Drepper <[email protected]>2009-01-21 13:05:36 -0800
commitdaf0fda7c0e6dcdcc6d011c89a7c6e94ecd238e1 (patch)
treed3eb1e4a5dfa39bded0ddcd1bd4d9dc1af897317 /src/elflint.c
parent935eddef3db5cc2fdc317fa943f93502281d3a42 (diff)
Fix elflint test for .eh_frame_hdr allocation.
Diffstat (limited to 'src/elflint.c')
-rw-r--r--src/elflint.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/elflint.c b/src/elflint.c
index f31b75c1..3beac464 100644
--- a/src/elflint.c
+++ b/src/elflint.c
@@ -4223,7 +4223,7 @@ call frame search table size mismatch in program and section header\n"));
if ((phdr->p_flags & PF_R) == 0)
ERROR (gettext ("\
call frame search table must be allocated\n"));
- else if (shdr != NULL && (shdr->sh_flags & SHF_ALLOC) != 0)
+ else if (shdr != NULL && (shdr->sh_flags & SHF_ALLOC) == 0)
ERROR (gettext ("\
section [%2zu] '%s' must be allocated\n"), elf_ndxscn (scn), ".eh_frame_hdr");
@@ -4270,6 +4270,10 @@ static void
check_exception_data (Ebl *ebl __attribute__ ((unused)),
GElf_Ehdr *ehdr __attribute__ ((unused)))
{
+ if ((ehdr->e_type == ET_EXEC || ehdr->e_type == ET_DYN)
+ && pt_gnu_eh_frame_pndx == 0 && eh_frame_hdr_scnndx != 0)
+ ERROR (gettext ("executable/DSO with .eh_frame_hdr section does not have "
+ "a PT_GNU_EH_FRAME program header entry"));
}