Fix Sparc/Linux host breakage by df70204db5

While i386, x86_64 and Sparc64/OpenBSD still worked after
df70204db5, Sparc32 and Sparc64 Linux hosts
broke.

Partially revert the commit: make the restored code conditional to
!CONFIG_USER_PIE.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Blue Swirl 2009-09-13 13:33:05 +00:00
parent c5ff6d5472
commit 91b40c5be8
2 changed files with 23 additions and 1 deletions

3
configure vendored
View File

@ -2364,9 +2364,10 @@ if test "$target_softmmu" = "yes" ; then
fi fi
if test "$target_user_only" = "yes" -a "$static" = "no" -a \ if test "$target_user_only" = "yes" -a "$static" = "no" -a \
"$user_pie" = "yes" ; then "$user_pie" = "yes" ; then
cflags="-fpie $cflags" cflags="-fpie $cflags"
ldflags="-pie $ldflags" ldflags="-pie $ldflags"
echo "CONFIG_USER_PIE=y" >> $config_mak
fi fi
if test "$target_softmmu" = "yes" -a \( \ if test "$target_softmmu" = "yes" -a \( \

View File

@ -48,6 +48,27 @@ int have_guest_base;
static const char *interp_prefix = CONFIG_QEMU_PREFIX; static const char *interp_prefix = CONFIG_QEMU_PREFIX;
const char *qemu_uname_release = CONFIG_UNAME_RELEASE; const char *qemu_uname_release = CONFIG_UNAME_RELEASE;
/* for recent libc, we add these dummy symbols which are not declared
when generating a linked object (bug in ld ?) */
#if ((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && \
!defined(CONFIG_STATIC)) && !defined(CONFIG_USER_PIE)
asm(".globl __preinit_array_start\n"
".globl __preinit_array_end\n"
".globl __init_array_start\n"
".globl __init_array_end\n"
".globl __fini_array_start\n"
".globl __fini_array_end\n"
".section \".rodata\"\n"
"__preinit_array_start:\n"
"__preinit_array_end:\n"
"__init_array_start:\n"
"__init_array_end:\n"
"__fini_array_start:\n"
"__fini_array_end:\n"
".long 0\n"
".previous\n");
#endif
/* XXX: on x86 MAP_GROWSDOWN only works if ESP <= address + 32, so /* XXX: on x86 MAP_GROWSDOWN only works if ESP <= address + 32, so
we allocate a bigger stack. Need a better solution, for example we allocate a bigger stack. Need a better solution, for example
by remapping the process stack directly at the right place */ by remapping the process stack directly at the right place */