]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
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 7e6b9929700dbc21bddcba179d6c463e99d1c92d..c1479ae4da9b4f4f9c6431804b5f5d1ebdc6c081 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 4d5c2b6cb3c82e7816fdb69e7056010c7a0b8983..baf7a3f839686ab81b5e7455fa600fe52f7d4c9b 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 d6d5f5ae780efb1531d1b53a340aec4017e77be3..b90e5c042d1b787640a4c0bbca024d74addd215d 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 c57eab80c38309822ce3841168924181a90a8c18..c4e382944cf1360f511b45c529d2d9c7d68db6dc 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: