[Toybox] [PATCH] Distinguish 32- and 64-bit variants in file(1) for x32.
Rob Landley
rob at landley.net
Sat Feb 20 12:41:29 PST 2016
On Thu, Feb 18, 2016 at 8:31 PM, Owen Shepherd <owen.shepherd at e43.eu> wrote:
>
> On Wed, Feb 17, 2016 at 11:32 PM Rob Landley <rob at landley.net> wrote:
>>
>> On Wed, Feb 17, 2016 at 10:22 AM, enh <enh at google.com> wrote:
>> > It's necessary to distinguish x86 and x86-64 to be able to recognize the
>> > way x32 is encoded in ELF.
>>
>> Hmmm. That's not fun.
>>
>> I note that I spent the morning teaching the code to read/display the
>> dynamic linker name, so this patch won't "git am" directly.
>>
>> Reading the patch, we're pretending that arrch64 has nothing to do
>> with arm? No mention of arm in this architecture? Ok... (I guess
>> Cortex-M isn't arm either, but don't currently have an example binary
>> of that to test.)
>
>
> Cortex-M is ARM
It's a nommu chip that only implements thumb instructions. It does not
run conventional 32 bit (or 64 bit) arm binaries. We're talking about
how ELF headers should identify the binaries they contain, and how a
tool should describe what those headers say about the binary.
> (Ideally it'd show up as something like "ARMv7-M",
> "ARMv6-M" or "ARMv8-M" to distinguish which specific version. This would
> probably be overly complicated for your use case - I believe these are
> recorded as ELF notes).
So you're saying arm came out with an incompatible binary format and
didn't bother to identify it with a new ELF type? (armv7 will run
armv3 binaries from the previous decade, i686 will run i386 binaries,
but Cortex-M can't run an armv3 binary.)
My real limiting factor here is I don't have "hello world" binaries
for each of the possible Linux ELF formats. I'd really like to add
that to the test suite...
>> > (Plus it's customary to distinguish the variants,
>> > so people are probably eyeballing the architecture rather than paying
>> > attention to the ELF class.)
>>
>> I moved "32-bit x86" and '64-bit x86" right next to each other. (It
>> was duplicative, saying 32-bit or 64-bit and then saying x86-64 or
>> aarrcchh64.)
>
>
> While '64-bit ARM' is nonsense
The Linux guys were pretty happy to create a linux/arch/arm64
directory for 64-bit arm.
Rob
1456000889.0
More information about the Toybox
mailing list