mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
bsd-user: add stubbed out core dump support
Add a stubbed-out version of the bsd-user fork's core dump support. This allows elfload.c to be almost the same between what's upstream and what's in qemu-project upstream w/o the burden of reviewing the core dump support. Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
25fb5d383d
commit
0475f8fac5
3 changed files with 36 additions and 2 deletions
|
@ -26,15 +26,17 @@
|
|||
static abi_ulong target_auxents; /* Where the AUX entries are in target */
|
||||
static size_t target_auxents_sz; /* Size of AUX entries including AT_NULL */
|
||||
|
||||
#include "target_arch_reg.h"
|
||||
#include "target_os_elf.h"
|
||||
#include "target_os_stack.h"
|
||||
#include "target_os_thread.h"
|
||||
|
||||
#include "elf.h"
|
||||
#include "target_os_user.h"
|
||||
|
||||
abi_ulong target_stksiz;
|
||||
abi_ulong target_stkbas;
|
||||
|
||||
static int elf_core_dump(int signr, CPUArchState *env);
|
||||
|
||||
static inline void memcpy_fromfs(void *to, const void *from, unsigned long n)
|
||||
{
|
||||
memcpy(to, from, n);
|
||||
|
@ -100,15 +102,25 @@ static void bswap_sym(struct elf_sym *sym)
|
|||
bswap16s(&sym->st_shndx);
|
||||
}
|
||||
|
||||
static void bswap_note(struct elf_note *en)
|
||||
{
|
||||
bswap32s(&en->n_namesz);
|
||||
bswap32s(&en->n_descsz);
|
||||
bswap32s(&en->n_type);
|
||||
}
|
||||
|
||||
#else /* ! BSWAP_NEEDED */
|
||||
|
||||
static void bswap_ehdr(struct elfhdr *ehdr) { }
|
||||
static void bswap_phdr(struct elf_phdr *phdr, int phnum) { }
|
||||
static void bswap_shdr(struct elf_shdr *shdr, int shnum) { }
|
||||
static void bswap_sym(struct elf_sym *sym) { }
|
||||
static void bswap_note(struct elf_note *en) { }
|
||||
|
||||
#endif /* ! BSWAP_NEEDED */
|
||||
|
||||
#include "elfcore.c"
|
||||
|
||||
/*
|
||||
* 'copy_elf_strings()' copies argument/envelope strings from user
|
||||
* memory to free pages in kernel mem. These are in a format ready
|
||||
|
@ -834,6 +846,12 @@ int load_elf_binary(struct bsd_binprm *bprm, struct target_pt_regs *regs,
|
|||
|
||||
info->entry = elf_entry;
|
||||
|
||||
#ifdef USE_ELF_CORE_DUMP
|
||||
bprm->core_dump = &elf_core_dump;
|
||||
#else
|
||||
bprm->core_dump = NULL;
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue