mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
added entry parameter to ELF loader
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1859 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
94ac515889
commit
9ee3c02942
5 changed files with 19 additions and 11 deletions
7
loader.c
7
loader.c
|
@ -194,7 +194,8 @@ static void *load_at(int fd, int offset, int size)
|
|||
#include "elf_ops.h"
|
||||
|
||||
/* return < 0 if error, otherwise the number of bytes loaded in memory */
|
||||
int load_elf(const char *filename, int64_t virt_to_phys_addend)
|
||||
int load_elf(const char *filename, int64_t virt_to_phys_addend,
|
||||
uint64_t *pentry)
|
||||
{
|
||||
int fd, data_order, must_swab, ret;
|
||||
uint8_t e_ident[EI_NIDENT];
|
||||
|
@ -220,9 +221,9 @@ int load_elf(const char *filename, int64_t virt_to_phys_addend)
|
|||
|
||||
lseek(fd, 0, SEEK_SET);
|
||||
if (e_ident[EI_CLASS] == ELFCLASS64) {
|
||||
ret = load_elf64(fd, virt_to_phys_addend, must_swab);
|
||||
ret = load_elf64(fd, virt_to_phys_addend, must_swab, pentry);
|
||||
} else {
|
||||
ret = load_elf32(fd, virt_to_phys_addend, must_swab);
|
||||
ret = load_elf32(fd, virt_to_phys_addend, must_swab, pentry);
|
||||
}
|
||||
|
||||
close(fd);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue