Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FI69y-0005JS-Cv for qemu-devel@nongnu.org; Sat, 11 Mar 2006 10:37:38 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FI69w-0005I4-HW for qemu-devel@nongnu.org; Sat, 11 Mar 2006 10:37:37 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FI69w-0005Hv-EV for qemu-devel@nongnu.org; Sat, 11 Mar 2006 10:37:36 -0500 Received: from [64.233.182.197] (helo=nproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FI6DU-00058f-3A for qemu-devel@nongnu.org; Sat, 11 Mar 2006 10:41:16 -0500 Received: by nproxy.gmail.com with SMTP id p46so156113nfa for ; Sat, 11 Mar 2006 07:37:35 -0800 (PST) Message-ID: <5b5833aa0603110737k32511e6dy87402e1de5f5c4d5@mail.gmail.com> Date: Sat, 11 Mar 2006 11:37:35 -0400 From: "Anderson Lizardo" Subject: Re: [Qemu-devel] [PATCH] reduce magic numbers length to 16 bytes (qemu-binfmt-conf.sh) In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <5b5833aa0603101858t5ebe6f7i667175ef8e966085@mail.gmail.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 3/11/06, Andreas Schwab wrote: > "Anderson Lizardo" writes: > > > Any reason why the magic numbers from qemu-binfmt-conf.sh are not just > > 16 bytes long as those reported by "readelf --file-header"? For > > example: > > > > $ readelf --file-header /bin/true | grep Magic: > > Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 > > > > Using only the first 16 bytes avoids the need to have separate entries > > for i386 and i486, given that they are emulated by the same program > > (qemu-i386). > > How would you distinguish it from an arm or mipsel binary? Now I realize my mistake, sorry for the noise :/ To not make this thread completely useless: I find /usr/share/misc/file/magic very useful to get machine patterns (as detected by "file"). Search there for "magic for ELF executables" and you will find a fairly complete list of machine magic numbers. Regards, -- Anderson Lizardo Embedded Linux Lab - 10LE Nokia Institute of Technology - INdT Manaus - Brazil