summaryrefslogtreecommitdiffstats
path: root/libelf/elf32_updatenull.c
diff options
context:
space:
mode:
authorRoland McGrath <[email protected]>2006-12-17 23:56:51 +0000
committerRoland McGrath <[email protected]>2006-12-17 23:56:51 +0000
commit8190db6a86a37aec86c81626ab1b083c96aff891 (patch)
tree2b065733f6ee44885a447e9506fae59518076048 /libelf/elf32_updatenull.c
parent7c0e79ffc201e4828a050b35f2c9d96e3001cb48 (diff)
propagate from branch 'com.redhat.elfutils' (head b4944cf70801d9dac056f4f80ef1334e5acb8bdc)
to branch 'com.redhat.elfutils.roland.pending' (head e7e402c668fb0670fc5f6b6a522853ae88f32f11)
Diffstat (limited to 'libelf/elf32_updatenull.c')
-rw-r--r--libelf/elf32_updatenull.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libelf/elf32_updatenull.c b/libelf/elf32_updatenull.c
index 3b926c1f..0de48bea 100644
--- a/libelf/elf32_updatenull.c
+++ b/libelf/elf32_updatenull.c
@@ -147,13 +147,13 @@ __elfw2(LIBELFBITS,updatenull) (Elf *elf, int *change_bop, size_t shnum)
off_t size = elf_typesize (LIBELFBITS, ELF_T_EHDR, 1);
/* Set the program header position. */
- if (elf->state.ELFW(elf,LIBELFBITS).phdr == NULL
- && (ehdr->e_type == ET_EXEC || ehdr->e_type == ET_DYN))
+ if (elf->state.ELFW(elf,LIBELFBITS).phdr == NULL && ehdr->e_phnum != 0)
(void) INTUSE(elfw2(LIBELFBITS,getphdr)) (elf);
if (elf->state.ELFW(elf,LIBELFBITS).phdr != NULL)
{
/* Only executables or shared objects have a program header. */
- if (ehdr->e_type != ET_EXEC && unlikely (ehdr->e_type != ET_DYN))
+ if (unlikely (ehdr->e_type == ET_REL)
+ && (elf->flags & ELF_F_PERMISSIVE) == 0)
{
__libelf_seterrno (ELF_E_INVALID_PHDR);
return -1;