summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlrich Drepper <[email protected]>2010-06-14 14:18:23 -0700
committerUlrich Drepper <[email protected]>2010-06-14 14:18:23 -0700
commitd763578420c9570a882f542d9ec8eb0b5974dffe (patch)
treea3a0bd59ac545498ccda9e837fde727353419527
parentb9e851815475d70d86ff0eda21d07239dd042107 (diff)
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.
-rw-r--r--libelf/ChangeLog8
-rw-r--r--libelf/gelf_update_ehdr.c5
-rw-r--r--libelf/gelf_update_phdr.c3
-rw-r--r--libelf/gelf_update_shdr.c5
4 files changed, 18 insertions, 3 deletions
diff --git a/libelf/ChangeLog b/libelf/ChangeLog
index 7e6b9929..c1479ae4 100644
--- a/libelf/ChangeLog
+++ b/libelf/ChangeLog
@@ -1,3 +1,9 @@
+2010-06-14 Ulrich Drepper <[email protected]>
+
+ * 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 <[email protected]>
* elf32_getphdr.c: Check for e_phoff/size outside the file bounds.
@@ -763,4 +769,4 @@
2003-08-11 Ulrich Drepper <[email protected]>
- * Moved to CVS archive.
+ * Moved to CVS archive.
diff --git a/libelf/gelf_update_ehdr.c b/libelf/gelf_update_ehdr.c
index 4d5c2b6c..baf7a3f8 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 <[email protected]>, 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 d6d5f5ae..b90e5c04 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 c57eab80..c4e38294 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 <[email protected]>, 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: