From: Ulrich Drepper Date: Mon, 14 Jun 2010 21:18:23 +0000 (-0700) Subject: Implicitly set dirty bit X-Git-Tag: elfutils-0.148~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d763578420c9570a882f542d9ec8eb0b5974dffe;p=thirdparty%2Felfutils.git Implicitly set dirty bit The gelf_update_[eps]hdr functions didn't implicitly mark the data structures as modified. This has always been the case and programs should set the bit but it is somewhat inconsistent since other update functions implicitly set the bit. Do it in these three cases, too. --- diff --git a/libelf/ChangeLog b/libelf/ChangeLog index 7e6b99297..c1479ae4d 100644 --- a/libelf/ChangeLog +++ b/libelf/ChangeLog @@ -1,3 +1,9 @@ +2010-06-14 Ulrich Drepper + + * gelf_update_shdr.c: Implicitly set ELF_F_DIRTY bit. + * gelf_update_phdr.c: Likewise. + * gelf_update_ehdr.c: Likewise. + 2010-04-14 Roland McGrath * elf32_getphdr.c: Check for e_phoff/size outside the file bounds. @@ -763,4 +769,4 @@ 2003-08-11 Ulrich Drepper - * Moved to CVS archive. + * Moved to CVS archive. diff --git a/libelf/gelf_update_ehdr.c b/libelf/gelf_update_ehdr.c index 4d5c2b6cb..baf7a3f83 100644 --- a/libelf/gelf_update_ehdr.c +++ b/libelf/gelf_update_ehdr.c @@ -1,5 +1,5 @@ /* Update ELF header. - Copyright (C) 2000, 2001, 2002 Red Hat, Inc. + Copyright (C) 2000, 2001, 2002, 2010 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper , 2000. @@ -127,6 +127,9 @@ gelf_update_ehdr (Elf *elf, GElf_Ehdr *src) memcpy (ehdr, src, sizeof (Elf64_Ehdr)); } + /* Mark the ELF header as modified. */ + elf->state.elf.ehdr_flags |= ELF_F_DIRTY; + result = 1; out: diff --git a/libelf/gelf_update_phdr.c b/libelf/gelf_update_phdr.c index d6d5f5ae7..b90e5c042 100644 --- a/libelf/gelf_update_phdr.c +++ b/libelf/gelf_update_phdr.c @@ -152,6 +152,9 @@ gelf_update_phdr (Elf *elf, int ndx, GElf_Phdr *src) memcpy (phdr + ndx, src, sizeof (Elf64_Phdr)); } + /* Mark the program header as modified. */ + elf->state.elf.phdr_flags |= ELF_F_DIRTY; + result = 1; out: diff --git a/libelf/gelf_update_shdr.c b/libelf/gelf_update_shdr.c index c57eab80c..c4e382944 100644 --- a/libelf/gelf_update_shdr.c +++ b/libelf/gelf_update_shdr.c @@ -1,5 +1,5 @@ /* Update section header. - Copyright (C) 2000, 2001, 2002 Red Hat, Inc. + Copyright (C) 2000, 2001, 2002, 2010 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper , 2000. @@ -120,6 +120,9 @@ gelf_update_shdr (Elf_Scn *scn, GElf_Shdr *src) (void) memcpy (shdr, src, sizeof (GElf_Shdr)); } + /* Mark the section header as modified. */ + scn->shdr_flags |= ELF_F_DIRTY; + result = 1; out: