aboutsummaryrefslogtreecommitdiffstats
path: root/fs/binfmt_elf.c
diff options
context:
space:
mode:
authorJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-11-22 13:06:44 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-11-22 13:06:44 -0500
commit0bd2af46839ad6262d25714a6ec0365db9d6b98f (patch)
treedcced72d230d69fd0c5816ac6dd03ab84799a93e /fs/binfmt_elf.c
parente138a5d2356729b8752e88520cc1525fae9794ac (diff)
parentf26b90440cd74c78fe10c9bd5160809704a9627c (diff)
Merge ../scsi-rc-fixes-2.6
Diffstat (limited to 'fs/binfmt_elf.c')
-rw-r--r--fs/binfmt_elf.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 06435f3665f4..79b05a1a4365 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1152,7 +1152,7 @@ static int dump_write(struct file *file, const void *addr, int nr)
1152static int dump_seek(struct file *file, loff_t off) 1152static int dump_seek(struct file *file, loff_t off)
1153{ 1153{
1154 if (file->f_op->llseek && file->f_op->llseek != no_llseek) { 1154 if (file->f_op->llseek && file->f_op->llseek != no_llseek) {
1155 if (file->f_op->llseek(file, off, 1) != off) 1155 if (file->f_op->llseek(file, off, SEEK_CUR) < 0)
1156 return 0; 1156 return 0;
1157 } else { 1157 } else {
1158 char *buf = (char *)get_zeroed_page(GFP_KERNEL); 1158 char *buf = (char *)get_zeroed_page(GFP_KERNEL);
@@ -1220,7 +1220,7 @@ static int notesize(struct memelfnote *en)
1220 1220
1221static int alignfile(struct file *file, loff_t *foffset) 1221static 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