<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Feb 17, 2016 at 11:32 PM Rob Landley <<a href="mailto:rob@landley.net">rob@landley.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, Feb 17, 2016 at 10:22 AM, enh <<a href="mailto:enh@google.com" target="_blank">enh@google.com</a>> wrote:<br>
> It's necessary to distinguish x86 and x86-64 to be able to recognize the<br>
> way x32 is encoded in ELF.<br>
<br>
Hmmm. That's not fun.<br>
<br>
I note that I spent the morning teaching the code to read/display the<br>
dynamic linker name, so this patch won't "git am" directly.<br>
<br>
Reading the patch, we're pretending that arrch64 has nothing to do<br>
with arm? No mention of arm in this architecture? Ok... (I guess<br>
Cortex-M isn't arm either, but don't currently have an example binary<br>
of that to test.)<br></blockquote><div><br></div><div> Cortex-M is ARM (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). </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> (Plus it's customary to distinguish the variants,<br>
> so people are probably eyeballing the architecture rather than paying<br>
> attention to the ELF class.)<br>
<br>
I moved "32-bit x86" and '64-bit x86" right next to each other. (It<br>
was duplicative, saying 32-bit or 64-bit and then saying x86-64 or<br>
aarrcchh64.)<br></blockquote><div><br></div><div>While '64-bit ARM' is nonsense, '32-bit AArch64' isn't (It's ILP32 - the AArch64 version of x32); so while in the common case saying "AArch64, 64-bit" would be redundant, in the uncommon case it is important. </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I pondered changing it to add a -64 extension for 64 bit platforms<br>
instead of saying "xx-bit", but that would give us alpha-64 and<br>
s390-64.<br>
<br>
> If we're not going to use the same strings as traditional file(1) -- which<br>
> is what I'd tried to do<br>
<br>
I can move it back to more traditional "file" output, but we're not<br>
matching exactly (missing a number of fields) and there's no spec. And<br>
that was _before_ I added dynamic linker output so you can distinguish<br>
glibc/bionic/musl/uClibc binaries...<br>
<br>
I really don't know what users expect from this. The --mime-type<br>
output seemed far more easily machine readable (which we haven't<br>
started on yet).<br>
<br>
> -- we should probably use the strings from the ELF<br>
> spec rather than the Linux kernel,<br>
<br>
Maybe it's changed since 2010, but when I was digging into this then<br>
(for hexagon), the last time the ELF spec had been updated was<br>
something like 1995, and the documents were stale snapshots hosted on<br>
a <a href="http://sco.com" rel="noreferrer" target="_blank">sco.com</a> website.<br>
<br>
I believe that the Linux Foundation has since taken over the hosting,<br>
but I'm unaware of them actually acting as a standards body for this.<br>
Nor were there actually "standards" even for some old platforms like<br>
Alpha.<br>
<br>
By "standard" do you mean the values in the glibc elf.h file? (Trust<br>
glibc over the kernel? I was using the kernel to avoid coming up with<br>
my own policy decision out of the blue.)<br>
<br>
> which often deliberately goes against<br>
> the manufacturer's wishes: "arm64" versus "aarch64", for example. But that's<br>
> an issue for another day.<br>
<br>
Ah, manufacturer's naming wishes:<br>
<br>
<a href="http://www.xbitlabs.com/news/cpu/display/20040310223922.html" rel="noreferrer" target="_blank">http://www.xbitlabs.com/news/cpu/display/20040310223922.html</a><br>
<br>
It's a "bud" lite, clearly.<br>
<br>
(Can of worms, this command...)<br>
<br>
Rob<br>
_______________________________________________<br>
Toybox mailing list<br>
<a href="mailto:Toybox@lists.landley.net" target="_blank">Toybox@lists.landley.net</a><br>
<a href="http://lists.landley.net/listinfo.cgi/toybox-landley.net" rel="noreferrer" target="_blank">http://lists.landley.net/listinfo.cgi/toybox-landley.net</a><br>
</blockquote></div></div>