Implicitly set dirty bit
authorUlrich Drepper <drepper@redhat.com>
Mon, 14 Jun 2010 21:18:23 +0000 (14:18 -0700)
committerUlrich Drepper <drepper@redhat.com>
Mon, 14 Jun 2010 21:18:23 +0000 (14:18 -0700)
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.

libelf/ChangeLog
libelf/gelf_update_ehdr.c
libelf/gelf_update_phdr.c
libelf/gelf_update_shdr.c

index 7e6b992..c1479ae 100644 (file)
@@ -1,3 +1,9 @@
+2010-06-14  Ulrich Drepper  <drepper@redhat.com>
+
+       * 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  <roland@redhat.com>
 
        * elf32_getphdr.c: Check for e_phoff/size outside the file bounds.
 
 2003-08-11  Ulrich Drepper  <drepper@redhat.com>
 
-        * Moved to CVS archive.
+       * Moved to CVS archive.
index 4d5c2b6..baf7a3f 100644 (file)
@@ -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 <drepper@redhat.com>, 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:
index d6d5f5a..b90e5c0 100644 (file)
@@ -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:
index c57eab8..c4e3829 100644 (file)
@@ -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 <drepper@redhat.com>, 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: