projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[linux-2.6-microblaze.git]
/
fs
/
binfmt_flat.c
diff --git
a/fs/binfmt_flat.c
b/fs/binfmt_flat.c
index
b9c658e
..
a1072c6
100644
(file)
--- a/
fs/binfmt_flat.c
+++ b/
fs/binfmt_flat.c
@@
-74,6
+74,12
@@
#define MAX_SHARED_LIBS (1)
#endif
#define MAX_SHARED_LIBS (1)
#endif
+#ifdef CONFIG_BINFMT_FLAT_NO_DATA_START_OFFSET
+#define DATA_START_OFFSET_WORDS (0)
+#else
+#define DATA_START_OFFSET_WORDS (MAX_SHARED_LIBS)
+#endif
+
struct lib_info {
struct {
unsigned long start_code; /* Start of text segment */
struct lib_info {
struct {
unsigned long start_code; /* Start of text segment */
@@
-576,7
+582,8
@@
static int load_flat_file(struct linux_binprm *bprm,
goto err;
}
goto err;
}
- len = data_len + extra + MAX_SHARED_LIBS * sizeof(unsigned long);
+ len = data_len + extra +
+ DATA_START_OFFSET_WORDS * sizeof(unsigned long);
len = PAGE_ALIGN(len);
realdatastart = vm_mmap(NULL, 0, len,
PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, 0);
len = PAGE_ALIGN(len);
realdatastart = vm_mmap(NULL, 0, len,
PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, 0);
@@
-591,7
+598,7
@@
static int load_flat_file(struct linux_binprm *bprm,
goto err;
}
datapos = ALIGN(realdatastart +
goto err;
}
datapos = ALIGN(realdatastart +
-
MAX_SHARED_LIB
S * sizeof(unsigned long),
+
DATA_START_OFFSET_WORD
S * sizeof(unsigned long),
FLAT_DATA_ALIGN);
pr_debug("Allocated data+bss+stack (%u bytes): %lx\n",
FLAT_DATA_ALIGN);
pr_debug("Allocated data+bss+stack (%u bytes): %lx\n",
@@
-622,7
+629,8
@@
static int load_flat_file(struct linux_binprm *bprm,
memp_size = len;
} else {
memp_size = len;
} else {
- len = text_len + data_len + extra + MAX_SHARED_LIBS * sizeof(u32);
+ len = text_len + data_len + extra +
+ DATA_START_OFFSET_WORDS * sizeof(u32);
len = PAGE_ALIGN(len);
textpos = vm_mmap(NULL, 0, len,
PROT_READ | PROT_EXEC | PROT_WRITE, MAP_PRIVATE, 0);
len = PAGE_ALIGN(len);
textpos = vm_mmap(NULL, 0, len,
PROT_READ | PROT_EXEC | PROT_WRITE, MAP_PRIVATE, 0);
@@
-638,7
+646,7
@@
static int load_flat_file(struct linux_binprm *bprm,
realdatastart = textpos + ntohl(hdr->data_start);
datapos = ALIGN(realdatastart +
realdatastart = textpos + ntohl(hdr->data_start);
datapos = ALIGN(realdatastart +
-
MAX_SHARED_LIB
S * sizeof(u32),
+
DATA_START_OFFSET_WORD
S * sizeof(u32),
FLAT_DATA_ALIGN);
reloc = (__be32 __user *)
FLAT_DATA_ALIGN);
reloc = (__be32 __user *)
@@
-714,7
+722,7
@@
static int load_flat_file(struct linux_binprm *bprm,
ret = result;
pr_err("Unable to read code+data+bss, errno %d\n", ret);
vm_munmap(textpos, text_len + data_len + extra +
ret = result;
pr_err("Unable to read code+data+bss, errno %d\n", ret);
vm_munmap(textpos, text_len + data_len + extra +
-
MAX_SHARED_LIB
S * sizeof(u32));
+
DATA_START_OFFSET_WORD
S * sizeof(u32));
goto err;
}
}
goto err;
}
}