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_ehdr.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_ehdr.c')
-rw-r--r-- | lib/libelf/gelf_ehdr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libelf/gelf_ehdr.c b/lib/libelf/gelf_ehdr.c index 4d7698a..f3e8c76 100644 --- a/lib/libelf/gelf_ehdr.c +++ b/lib/libelf/gelf_ehdr.c @@ -137,6 +137,8 @@ gelf_update_ehdr(Elf *e, GElf_Ehdr *s) if ((ehdr = _libelf_ehdr(e, ec, 0)) == NULL) return (0); + (void) elf_flagehdr(e, ELF_C_SET, ELF_F_DIRTY); + if (ec == ELFCLASS64) { eh64 = (Elf64_Ehdr *) ehdr; *eh64 = *s; @@ -161,7 +163,5 @@ gelf_update_ehdr(Elf *e, GElf_Ehdr *s) eh32->e_shnum = s->e_shnum; eh32->e_shstrndx = s->e_shstrndx; - (void) elf_flagehdr(e, ELF_C_SET, ELF_F_DIRTY); - return (1); } |