1 |
On 01/30/2015 03:01 PM, Anthony G. Basile wrote: |
2 |
> On 01/29/15 21:02, Zac Medico wrote: |
3 |
>>>> +# hppa_{32,64} |
4 |
>>>> +# ia_{32,64} |
5 |
>>>> +# m68k_{32,64} |
6 |
>>>> +# mips_{eabi32,eabi64,n32,n64,o32,o64} |
7 |
>>>> +# ppc_{32,64} |
8 |
>>>> +# s390_{32,64} |
9 |
>>>> +# sh_{32,64} |
10 |
>>>> +# sparc_{32,64} |
11 |
>>>> +# x86_{32,64,x32} |
12 |
>>>> +# |
13 |
>>>> +# NOTES: |
14 |
>>>> +# |
15 |
>>>> +# * The ABIs referenced by some of the above *_32 and *_64 categories |
16 |
>>>> +# may be imaginary, but they are listed anyway, since the goal is to |
17 |
>>>> +# establish a naming convention that is as consistent and uniform as |
18 |
>>>> +# possible. |
19 |
>>>> +# |
20 |
>>>> +# * The Elf header's e_ident[EI_OSABI] byte is completely ignored, |
21 |
>>>> +# since OS-independence is one of the goals. The assumption is that, |
22 |
>>>> +# for given installation, we are only interested in tracking |
23 |
>>>> multilib |
24 |
>>>> +# ABIs for a single OS. |
25 |
>>> |
26 |
>>> If you run readelf -h on (say) bash in any of our stage3's tarballs you |
27 |
>>> always get "OS/ABI: UNIX - System V" irrespective of arch and abi. I |
28 |
>>> don't know what you would get on BSD, but the field is totally |
29 |
>>> irrelevant for our purposes despite the name. As far as I can tell, it |
30 |
>>> is totally invariant across arches and abis. |
31 |
>>> |
32 |
>>> You can even unpack the the stage3's on an amd64 host and run readelf |
33 |
>>> form the host on the chroot target and you'll get the elf header, so you |
34 |
>>> don't need access to native hardware. |
35 |
>>> |
36 |
>>> The comment suggests that there might be some interesting information |
37 |
>>> there, but there isn't. Maybe I'm just reading too much into it. |
38 |
>> |
39 |
>> Well, a quick google search seems to indicate that FreeBSD uses |
40 |
>> EI_OSABI. I was specifically thinking about FreeBSD when I wrote that |
41 |
>> comment, because I was aware that Gentoo/FBSD was using ELF, and I just |
42 |
>> assumed that they would have a different EI_OSABI than Linux. |
43 |
> |
44 |
> Even there you'll get "UNIX - System V". I don't have a freebsd system |
45 |
> ready to go, but here's what i get from my openbsd system: |
46 |
> |
47 |
> # uname -a |
48 |
> OpenBSD obi.dis 5.6 GENERIC.MP#333 amd64 |
49 |
> # readelf -h /bin/sh |
50 |
> ELF Header: |
51 |
> Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 |
52 |
> Class: ELF64 |
53 |
> Data: 2's complement, little endian |
54 |
> Version: 1 (current) |
55 |
> OS/ABI: UNIX - System V |
56 |
> ABI Version: 0 |
57 |
> Type: EXEC (Executable file) |
58 |
> Machine: Advanced Micro Devices X86-64 |
59 |
> Version: 0x1 |
60 |
> Entry point address: 0x400260 |
61 |
> Start of program headers: 64 (bytes into file) |
62 |
> Start of section headers: 442512 (bytes into file) |
63 |
> Flags: 0x0 |
64 |
> Size of this header: 64 (bytes) |
65 |
> Size of program headers: 56 (bytes) |
66 |
> Number of program headers: 7 |
67 |
> Size of section headers: 64 (bytes) |
68 |
> Number of section headers: 17 |
69 |
> Section header string table index: 16 |
70 |
> |
71 |
> |
72 |
> I have *never* seen the OS/ABI be anything different. That's what |
73 |
> struck me about your comment. Anyhow, we're far afield. |
74 |
> |
75 |
> I might install freebsd later in a vm just to have one handy and check. |
76 |
|
77 |
I just loop-mounted a GhostBSD iso, and here's what I found: |
78 |
|
79 |
# readelf -h /media/iso/bin/sh |
80 |
ELF Header: |
81 |
Magic: 7f 45 4c 46 01 01 01 09 00 00 00 00 00 00 00 00 |
82 |
Class: ELF32 |
83 |
Data: 2's complement, little endian |
84 |
Version: 1 (current) |
85 |
OS/ABI: UNIX - FreeBSD |
86 |
ABI Version: 0 |
87 |
Type: EXEC (Executable file) |
88 |
Machine: Intel 80386 |
89 |
Version: 0x1 |
90 |
Entry point address: 0x804a100 |
91 |
Start of program headers: 52 (bytes into file) |
92 |
Start of section headers: 119888 (bytes into file) |
93 |
Flags: 0x0 |
94 |
Size of this header: 52 (bytes) |
95 |
Size of program headers: 32 (bytes) |
96 |
Number of program headers: 8 |
97 |
Size of section headers: 40 (bytes) |
98 |
Number of section headers: 28 |
99 |
Section header string table index: 27 |
100 |
|
101 |
-- |
102 |
Thanks, |
103 |
Zac |