diff options
-rw-r--r-- | fs/binfmt_elf.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 561006127902..79b05a1a4365 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c | |||
@@ -1220,7 +1220,7 @@ static int notesize(struct memelfnote *en) | |||
1220 | 1220 | ||
1221 | static int alignfile(struct file *file, loff_t *foffset) | 1221 | static int alignfile(struct file *file, loff_t *foffset) |
1222 | { | 1222 | { |
1223 | char buf[4] = { 0, }; | 1223 | static const char buf[4] = { 0, }; |
1224 | DUMP_WRITE(buf, roundup(*foffset, 4) - *foffset, foffset); | 1224 | DUMP_WRITE(buf, roundup(*foffset, 4) - *foffset, foffset); |
1225 | return 1; | 1225 | return 1; |
1226 | } | 1226 | } |
@@ -1569,7 +1569,8 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file) | |||
1569 | 1569 | ||
1570 | DUMP_WRITE(elf, sizeof(*elf)); | 1570 | DUMP_WRITE(elf, sizeof(*elf)); |
1571 | offset += sizeof(*elf); /* Elf header */ | 1571 | offset += sizeof(*elf); /* Elf header */ |
1572 | offset += (segs+1) * sizeof(struct elf_phdr); /* Program headers */ | 1572 | offset += (segs + 1) * sizeof(struct elf_phdr); /* Program headers */ |
1573 | foffset = offset; | ||
1573 | 1574 | ||
1574 | /* Write notes phdr entry */ | 1575 | /* Write notes phdr entry */ |
1575 | { | 1576 | { |
@@ -1586,8 +1587,6 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file) | |||
1586 | DUMP_WRITE(&phdr, sizeof(phdr)); | 1587 | DUMP_WRITE(&phdr, sizeof(phdr)); |
1587 | } | 1588 | } |
1588 | 1589 | ||
1589 | foffset = offset; | ||
1590 | |||
1591 | dataoff = offset = roundup(offset, ELF_EXEC_PAGESIZE); | 1590 | dataoff = offset = roundup(offset, ELF_EXEC_PAGESIZE); |
1592 | 1591 | ||
1593 | /* Write program headers for segments dump */ | 1592 | /* Write program headers for segments dump */ |
@@ -1612,7 +1611,6 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file) | |||
1612 | phdr.p_align = ELF_EXEC_PAGESIZE; | 1611 | phdr.p_align = ELF_EXEC_PAGESIZE; |
1613 | 1612 | ||
1614 | DUMP_WRITE(&phdr, sizeof(phdr)); | 1613 | DUMP_WRITE(&phdr, sizeof(phdr)); |
1615 | foffset += sizeof(phdr); | ||
1616 | } | 1614 | } |
1617 | 1615 | ||
1618 | #ifdef ELF_CORE_WRITE_EXTRA_PHDRS | 1616 | #ifdef ELF_CORE_WRITE_EXTRA_PHDRS |