mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-30 13:31:52 -06:00
linux-user: Reduce lseek+reads while loading elf files.
Define BPRM_BUF_SIZE to 1k and read that amount initially. If the data we want from the binary is in this buffer, use it instead of reading from the file again. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
This commit is contained in:
parent
d97ef72eed
commit
9955ffac9a
3 changed files with 57 additions and 71 deletions
|
@ -31,6 +31,7 @@
|
|||
* task_struct fields in the kernel
|
||||
*/
|
||||
struct image_info {
|
||||
abi_ulong load_bias;
|
||||
abi_ulong load_addr;
|
||||
abi_ulong start_code;
|
||||
abi_ulong end_code;
|
||||
|
@ -144,12 +145,16 @@ extern unsigned long mmap_min_addr;
|
|||
*/
|
||||
#define MAX_ARG_PAGES 33
|
||||
|
||||
/* Read a good amount of data initially, to hopefully get all the
|
||||
program headers loaded. */
|
||||
#define BPRM_BUF_SIZE 1024
|
||||
|
||||
/*
|
||||
* This structure is used to hold the arguments that are
|
||||
* used when loading binaries.
|
||||
*/
|
||||
struct linux_binprm {
|
||||
char buf[128];
|
||||
char buf[BPRM_BUF_SIZE] __attribute__((aligned));
|
||||
void *page[MAX_ARG_PAGES];
|
||||
abi_ulong p;
|
||||
int fd;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue