Skip to content

Instantly share code, notes, and snippets.

@ice799
Created November 17, 2011 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ice799/1374231 to your computer and use it in GitHub Desktop.
Save ice799/1374231 to your computer and use it in GitHub Desktop.
diff --git a/src/elfcore.c b/src/elfcore.c
index 4304770..598f5dc 100644
--- a/src/elfcore.c
+++ b/src/elfcore.c
@@ -856,13 +856,8 @@ static int CreateElfCore(void *handle,
mappings[i].start_address += zeros;
}
- /* Do not write contents for memory segments that are read-only */
- if ((mappings[i].flags & (PF_ANONYMOUS|PF_W)) == 0) {
- mappings[i].write_size = 0;
- } else {
- mappings[i].write_size = mappings[i].end_address
- - mappings[i].start_address;
- }
+ mappings[i].write_size = mappings[i].end_address
+ - mappings[i].start_address;
/* Remove mapping, if it was not readable, or completely zero
* anyway. The former is usually the case of stack guard pages, and
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment