aboutsummaryrefslogtreecommitdiff
path: root/fs/binfmt_elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/binfmt_elf.c')
-rw-r--r--fs/binfmt_elf.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index fa8ea33ab0b..08e4414b837 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1499,6 +1499,9 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file)
#endif
int thread_status_size = 0;
elf_addr_t *auxv;
+#ifdef ELF_CORE_WRITE_EXTRA_NOTES
+ int extra_notes_size;
+#endif
/*
* We no longer stop all VM operations.
@@ -1628,7 +1631,8 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file)
sz += thread_status_size;
#ifdef ELF_CORE_WRITE_EXTRA_NOTES
- sz += ELF_CORE_EXTRA_NOTES_SIZE;
+ extra_notes_size = ELF_CORE_EXTRA_NOTES_SIZE;
+ sz += extra_notes_size;
#endif
fill_elf_note_phdr(&phdr, sz, offset);
@@ -1674,6 +1678,7 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file)
#ifdef ELF_CORE_WRITE_EXTRA_NOTES
ELF_CORE_WRITE_EXTRA_NOTES;
+ foffset += extra_notes_size;
#endif
/* write out the thread status notes section */