mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-25 11:01:52 -06:00
linux-user: Minimum Sig Handler Stack Size for PPC64 ELF V2
The ELF V2 ABI for PPC64 defines MINSIGSTKSZ as 4096 bytes whereas it was 2048 previously. Signed-off-by: Tom Musta <tommusta@gmail.com> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
This commit is contained in:
parent
67d6d829cd
commit
0903c8be9e
18 changed files with 34 additions and 1 deletions
|
@ -617,6 +617,15 @@ abi_long do_sigaltstack(abi_ulong uss_addr, abi_ulong uoss_addr, abi_ulong sp)
|
|||
{
|
||||
struct target_sigaltstack *uss;
|
||||
struct target_sigaltstack ss;
|
||||
size_t minstacksize = TARGET_MINSIGSTKSZ;
|
||||
|
||||
#if defined(TARGET_PPC64)
|
||||
/* ELF V2 for PPC64 has a 4K minimum stack size for signal handlers */
|
||||
struct image_info *image = ((TaskState *)thread_cpu->opaque)->info;
|
||||
if (get_ppc64_abi(image) > 1) {
|
||||
minstacksize = 4096;
|
||||
}
|
||||
#endif
|
||||
|
||||
ret = -TARGET_EFAULT;
|
||||
if (!lock_user_struct(VERIFY_READ, uss, uss_addr, 1)) {
|
||||
|
@ -642,8 +651,9 @@ abi_long do_sigaltstack(abi_ulong uss_addr, abi_ulong uoss_addr, abi_ulong sp)
|
|||
ss.ss_sp = 0;
|
||||
} else {
|
||||
ret = -TARGET_ENOMEM;
|
||||
if (ss.ss_size < MINSIGSTKSZ)
|
||||
if (ss.ss_size < minstacksize) {
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
target_sigaltstack_used.ss_sp = ss.ss_sp;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue