diff options
author | kaiw <kaiw@FreeBSD.org> | 2010-07-21 08:58:52 +0000 |
---|---|---|
committer | kaiw <kaiw@FreeBSD.org> | 2010-07-21 08:58:52 +0000 |
commit | d52f6374a8ac2ed4442c862b5c27e12e7921db39 (patch) | |
tree | 1fd64483b461c3a95643505ccb63407707d65990 /lib/libelf/gelf_phdr.c | |
parent | 19ba81c75ab61e11e242da176f498a77890674fe (diff) | |
download | FreeBSD-src-d52f6374a8ac2ed4442c862b5c27e12e7921db39.zip FreeBSD-src-d52f6374a8ac2ed4442c862b5c27e12e7921db39.tar.gz |
Bug fix: when updating headers using the gelf_update_*() functions,
the appropriate `dirty' bit needs to be set for both the Elf32 and
Elf64 case.
Obtained from: elftoolchain
MFC after: 1 month
Diffstat (limited to 'lib/libelf/gelf_phdr.c')
-rw-r--r-- | lib/libelf/gelf_phdr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libelf/gelf_phdr.c b/lib/libelf/gelf_phdr.c index 6d82d7f..654b99d 100644 --- a/lib/libelf/gelf_phdr.c +++ b/lib/libelf/gelf_phdr.c @@ -155,6 +155,8 @@ gelf_update_phdr(Elf *e, int ndx, GElf_Phdr *s) return (0); } + (void) elf_flagphdr(e, ELF_C_SET, ELF_F_DIRTY); + if (ec == ELFCLASS64) { ph64 = e->e_u.e_elf.e_phdr.e_phdr64 + ndx; *ph64 = *s; @@ -172,7 +174,5 @@ gelf_update_phdr(Elf *e, int ndx, GElf_Phdr *s) LIBELF_COPY_U32(ph32, s, p_memsz); LIBELF_COPY_U32(ph32, s, p_align); - (void) elf_flagphdr(e, ELF_C_SET, ELF_F_DIRTY); - return (1); } |