qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Add SH4 ELF magic into qemu-binfmt-conf.sh.
@ 2009-12-16 22:03 David Kozub
  2009-12-19 17:34 ` Aurelien Jarno
  0 siblings, 1 reply; 6+ messages in thread
From: David Kozub @ 2009-12-16 22:03 UTC (permalink / raw)
  To: qemu-devel


Signed-off-by: David Kozub <zub@linux.fjfi.cvut.cz>
---
  qemu-binfmt-conf.sh |    9 ++++++++-
  1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/qemu-binfmt-conf.sh b/qemu-binfmt-conf.sh
index ba916ac..9c65c9a 100644
--- a/qemu-binfmt-conf.sh
+++ b/qemu-binfmt-conf.sh
@@ -1,5 +1,5 @@
  #!/bin/sh
-# enable automatic i386/ARM/M68K/MIPS/SPARC/PPC program execution by the kernel
+# enable automatic i386/ARM/M68K/MIPS/SPARC/PPC/SH4 program execution by the kernel

  # load the binfmt_misc module
  if [ ! -d /proc/sys/fs/binfmt_misc ]; then
@@ -27,6 +27,9 @@ case "$cpu" in
    armv4l)
      cpu="arm"
    ;;
+  sh4)
+    cpu="sh4"
+  ;;
  esac

  # register the interpreter for each cpu except for the native one
@@ -60,3 +63,7 @@ if [ $cpu != "mips" ] ; then
      echo   ':mips64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-mips64:' > /proc/sys/fs/binfmt_misc/register
      echo   ':mips64el:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-mips64el:' > /proc/sys/fs/binfmt_misc/register
  fi
+if [ $cpu != "sh4" ] ; then
+    echo ':sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-sh4:' > /proc/sys/fs/binfmt_misc/register
+    echo ':sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-sh4eb:' > /proc/sys/fs/binfmt_misc/register
+fi
-- 
1.6.4.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH] Add SH4 ELF magic into qemu-binfmt-conf.sh.
@ 2009-12-17 13:11 David Kozub
  2009-12-17 19:45 ` Richard Henderson
  0 siblings, 1 reply; 6+ messages in thread
From: David Kozub @ 2009-12-17 13:11 UTC (permalink / raw)
  To: qemu-devel


Signed-off-by: David Kozub <zub@linux.fjfi.cvut.cz>
---
  qemu-binfmt-conf.sh |    9 ++++++++-
  1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/qemu-binfmt-conf.sh b/qemu-binfmt-conf.sh
index ba916ac..9c65c9a 100644
--- a/qemu-binfmt-conf.sh
+++ b/qemu-binfmt-conf.sh
@@ -1,5 +1,5 @@
  #!/bin/sh
-# enable automatic i386/ARM/M68K/MIPS/SPARC/PPC program execution by the kernel
+# enable automatic i386/ARM/M68K/MIPS/SPARC/PPC/SH4 program execution by the kernel

  # load the binfmt_misc module
  if [ ! -d /proc/sys/fs/binfmt_misc ]; then
@@ -27,6 +27,9 @@ case "$cpu" in
    armv4l)
      cpu="arm"
    ;;
+  sh4)
+    cpu="sh4"
+  ;;
  esac

  # register the interpreter for each cpu except for the native one
@@ -60,3 +63,7 @@ if [ $cpu != "mips" ] ; then
      echo   ':mips64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-mips64:' > /proc/sys/fs/binfmt_misc/register
      echo   ':mips64el:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-mips64el:' > /proc/sys/fs/binfmt_misc/register
  fi
+if [ $cpu != "sh4" ] ; then
+    echo ':sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-sh4:' > /proc/sys/fs/binfmt_misc/register
+    echo ':sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-sh4eb:' > /proc/sys/fs/binfmt_misc/register
+fi
-- 
1.6.4.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] Add SH4 ELF magic into qemu-binfmt-conf.sh.
  2009-12-17 13:11 [Qemu-devel] [PATCH] Add SH4 ELF magic into qemu-binfmt-conf.sh David Kozub
@ 2009-12-17 19:45 ` Richard Henderson
  2009-12-17 21:15   ` David Kozub
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Henderson @ 2009-12-17 19:45 UTC (permalink / raw)
  To: David Kozub; +Cc: qemu-devel

On 12/17/2009 05:11 AM, David Kozub wrote:
> ;;
> + sh4)
> + cpu="sh4"
> + ;;

You don't need this entry.  That table is supposed to be for changing 
the name.  You'd use it if uname returned sh4eb though...


r~

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] Add SH4 ELF magic into qemu-binfmt-conf.sh.
  2009-12-17 19:45 ` Richard Henderson
@ 2009-12-17 21:15   ` David Kozub
  2009-12-17 22:47     ` Richard Henderson
  0 siblings, 1 reply; 6+ messages in thread
From: David Kozub @ 2009-12-17 21:15 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-devel

On Thu, 17 Dec 2009, Richard Henderson wrote:

>> ;;
>> + sh4)
>> + cpu="sh4"
>> + ;;
>
> You don't need this entry.  That table is supposed to be for changing the 
> name.  You'd use it if uname returned sh4eb though...

Indeed, I got swayed. Then also "m68k" and "i386" are superfluous there.

As for sh4eb, AFAIK "uname -m" still returns "sh4" only. This leaves us in 
a situation similar to mips and arm - we could still want to have qemu for 
the other endianness.

On a side note, why is the mask for e_type 0xfffe, allowing both ET_EXEC 
and ET_DYN? I.e. when would we need it for shared libraries?

Being new here - what should I do about the patch? Send again, with fixes?

Best regards,

David

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] Add SH4 ELF magic into qemu-binfmt-conf.sh.
  2009-12-17 21:15   ` David Kozub
@ 2009-12-17 22:47     ` Richard Henderson
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Henderson @ 2009-12-17 22:47 UTC (permalink / raw)
  To: David Kozub; +Cc: qemu-devel

On 12/17/2009 01:15 PM, David Kozub wrote:
> On a side note, why is the mask for e_type 0xfffe, allowing both ET_EXEC
> and ET_DYN? I.e. when would we need it for shared libraries?

-fpie generates an ET_DYN "executable".


r~

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] Add SH4 ELF magic into qemu-binfmt-conf.sh.
  2009-12-16 22:03 David Kozub
@ 2009-12-19 17:34 ` Aurelien Jarno
  0 siblings, 0 replies; 6+ messages in thread
From: Aurelien Jarno @ 2009-12-19 17:34 UTC (permalink / raw)
  To: David Kozub; +Cc: qemu-devel

On Wed, Dec 16, 2009 at 11:03:42PM +0100, David Kozub wrote:
>
> Signed-off-by: David Kozub <zub@linux.fjfi.cvut.cz>
> ---
>  qemu-binfmt-conf.sh |    9 ++++++++-
>  1 files changed, 8 insertions(+), 1 deletions(-)
>
> diff --git a/qemu-binfmt-conf.sh b/qemu-binfmt-conf.sh
> index ba916ac..9c65c9a 100644
> --- a/qemu-binfmt-conf.sh
> +++ b/qemu-binfmt-conf.sh
> @@ -1,5 +1,5 @@
>  #!/bin/sh
> -# enable automatic i386/ARM/M68K/MIPS/SPARC/PPC program execution by the kernel
> +# enable automatic i386/ARM/M68K/MIPS/SPARC/PPC/SH4 program execution by the kernel
>
>  # load the binfmt_misc module
>  if [ ! -d /proc/sys/fs/binfmt_misc ]; then
> @@ -27,6 +27,9 @@ case "$cpu" in
>    armv4l)
>      cpu="arm"
>    ;;
> +  sh4)
> +    cpu="sh4"
> +  ;;
>  esac

As already pointed, this part is actually useless.

>  # register the interpreter for each cpu except for the native one
> @@ -60,3 +63,7 @@ if [ $cpu != "mips" ] ; then
>      echo   ':mips64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-mips64:' > /proc/sys/fs/binfmt_misc/register
>      echo   ':mips64el:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-mips64el:' > /proc/sys/fs/binfmt_misc/register
>  fi
> +if [ $cpu != "sh4" ] ; then
> +    echo ':sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-sh4:' > /proc/sys/fs/binfmt_misc/register
> +    echo ':sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-sh4eb:' > /proc/sys/fs/binfmt_misc/register
> +fi
> -- 
> 1.6.4.4
>
>
>

-- 
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-12-19 17:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-17 13:11 [Qemu-devel] [PATCH] Add SH4 ELF magic into qemu-binfmt-conf.sh David Kozub
2009-12-17 19:45 ` Richard Henderson
2009-12-17 21:15   ` David Kozub
2009-12-17 22:47     ` Richard Henderson
  -- strict thread matches above, loose matches on Subject: below --
2009-12-16 22:03 David Kozub
2009-12-19 17:34 ` Aurelien Jarno

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).