From: Blue Swirl <blauwirbel@gmail.com>
To: Richard Henderson <rth@twiddle.net>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH] linux-user: Remove ELFLOAD32.
Date: Fri, 23 Apr 2010 21:36:12 +0300 [thread overview]
Message-ID: <u2sf43fc5581004231136y3f18e610u99be0775a0962fd3@mail.gmail.com> (raw)
In-Reply-To: <20100423002659.199E0101C@are.twiddle.net>
On 4/23/10, Richard Henderson <rth@twiddle.net> wrote:
> The ABI-specific types used by linux_binprm and image_info
> are different after forcing TARGET_ABI32 on. Which means
> that the parameters that load_elf_binary_multi sees are not
> those that loader_exec passed. This is inherently broken
> and is more trouble than it's worth fixing.
Nack. How is this inherently broken?
The problem that elfload32 solves is that the CPU is 64 bit, but the
ABI and the binaries loaded are still 32 bits. It works nicely for
sparc32plus binaries (ELFCLASS32, but only for V9 CPUs).
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
> Makefile.target | 1 -
> configure | 6 ------
> linux-user/elfload32.c | 30 ------------------------------
> linux-user/linuxload.c | 6 +-----
> linux-user/qemu.h | 5 -----
> 5 files changed, 1 insertions(+), 47 deletions(-)
> delete mode 100644 linux-user/elfload32.c
>
> diff --git a/Makefile.target b/Makefile.target
> index 5897051..65beed5 100644
> --- a/Makefile.target
> +++ b/Makefile.target
> @@ -88,7 +88,6 @@ obj-y = main.o syscall.o strace.o mmap.o signal.o thunk.o \
> elfload.o linuxload.o uaccess.o gdbstub.o cpu-uname.o
>
> obj-$(TARGET_HAS_BFLT) += flatload.o
> -obj-$(TARGET_HAS_ELFLOAD32) += elfload32.o
>
> obj-$(TARGET_I386) += vm86.o
>
> diff --git a/configure b/configure
> index 7c06719..e2dadb0 100755
> --- a/configure
> +++ b/configure
> @@ -2413,7 +2413,6 @@ ln -s $source_path/Makefile.target $target_dir/Makefile
> echo "# Automatically generated by configure - do not modify" > $config_target_mak
>
> bflt="no"
> -elfload32="no"
> target_nptl="no"
> interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_arch2/g"`
> echo "CONFIG_QEMU_PREFIX=\"$interp_prefix1\"" >> $config_target_mak
> @@ -2510,7 +2509,6 @@ case "$target_arch2" in
> ;;
> sparc64)
> TARGET_BASE_ARCH=sparc
> - elfload32="yes"
> target_phys_bits=64
> ;;
> sparc32plus)
> @@ -2609,10 +2607,6 @@ if test "$target_user_only" = "yes" \
> -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
> echo "CONFIG_USE_NPTL=y" >> $config_target_mak
> fi
> -# 32 bit ELF loader in addition to native 64 bit loader?
> -if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
> - echo "TARGET_HAS_ELFLOAD32=y" >> $config_target_mak
> -fi
> if test "$target_user_only" = "yes" -a "$guest_base" = "yes"; then
> echo "CONFIG_USE_GUEST_BASE=y" >> $config_target_mak
> fi
> diff --git a/linux-user/elfload32.c b/linux-user/elfload32.c
> deleted file mode 100644
> index 4b4648c..0000000
> --- a/linux-user/elfload32.c
> +++ /dev/null
> @@ -1,30 +0,0 @@
> -#define TARGET_ABI32
> -#define load_elf_binary load_elf_binary32
> -#define do_init_thread do_init_thread32
> -
> -#include "elfload.c"
> -
> -#undef load_elf_binary
> -#undef do_init_thread
> -
> -int load_elf_binary(struct linux_binprm *bprm, struct target_pt_regs *regs,
> - struct image_info *info);
> -
> -int load_elf_binary_multi(struct linux_binprm *bprm,
> - struct target_pt_regs *regs,
> - struct image_info *info)
> -{
> - struct elfhdr *elf_ex;
> - int retval;
> -
> - elf_ex = (struct elfhdr *) bprm->buf; /* exec-header */
> - if (elf_ex->e_ident[EI_CLASS] == ELFCLASS64) {
> - retval = load_elf_binary(bprm, regs, info);
> - } else {
> - retval = load_elf_binary32(bprm, regs, info);
> - if (personality(info->personality) == PER_LINUX)
> - info->personality = PER_LINUX32;
> - }
> -
> - return retval;
> -}
> diff --git a/linux-user/linuxload.c b/linux-user/linuxload.c
> index 2d778a2..13ad9aa 100644
> --- a/linux-user/linuxload.c
> +++ b/linux-user/linuxload.c
> @@ -184,11 +184,7 @@ int loader_exec(const char * filename, char ** argv, char ** envp,
> && bprm->buf[1] == 'E'
> && bprm->buf[2] == 'L'
> && bprm->buf[3] == 'F') {
> -#ifndef TARGET_HAS_ELFLOAD32
> - retval = load_elf_binary(bprm,regs,infop);
> -#else
> - retval = load_elf_binary_multi(bprm, regs, infop);
> -#endif
> + retval = load_elf_binary(bprm, regs, infop);
> #if defined(TARGET_HAS_BFLT)
> } else if (bprm->buf[0] == 'b'
> && bprm->buf[1] == 'F'
> diff --git a/linux-user/qemu.h b/linux-user/qemu.h
> index 47fc686..dab3597 100644
> --- a/linux-user/qemu.h
> +++ b/linux-user/qemu.h
> @@ -171,11 +171,6 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
> struct image_info * info);
> int load_flt_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
> struct image_info * info);
> -#ifdef TARGET_HAS_ELFLOAD32
> -int load_elf_binary_multi(struct linux_binprm *bprm,
> - struct target_pt_regs *regs,
> - struct image_info *info);
> -#endif
>
> abi_long memcpy_to_target(abi_ulong dest, const void *src,
> unsigned long len);
>
> --
> 1.6.6.1
>
>
next prev parent reply other threads:[~2010-04-23 18:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-23 0:24 [Qemu-devel] [PATCH] linux-user: Remove ELFLOAD32 Richard Henderson
2010-04-23 18:36 ` Blue Swirl [this message]
2010-04-25 0:36 ` [Qemu-devel] " Richard Henderson
2010-04-25 15:08 ` Blue Swirl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=u2sf43fc5581004231136y3f18e610u99be0775a0962fd3@mail.gmail.com \
--to=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).