Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Jul 2013 22:22:29 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        Andrew Turner <andrew@fubar.geek.nz>, freebsd-arch@freebsd.org
Subject:   Re: Adding a MACHINE_ARCH note
Message-ID:  <97A960A4-1955-4D6C-8A75-FCBC3CD2DEB7@bsdimp.com>
In-Reply-To: <20130710034554.GW91021@kib.kiev.ua>
References:  <20130709090744.0e497e7e@bender.Home> <32F979BD-FB5C-4111-9586-4C5E7C6DFA71@bsdimp.com> <20130709234837.559e3769@bender.Home> <20130710034554.GW91021@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help

On Jul 9, 2013, at 9:45 PM, Konstantin Belousov wrote:

> On Tue, Jul 09, 2013 at 11:48:37PM +0100, Andrew Turner wrote:
>> On Tue, 9 Jul 2013 08:19:46 -0600
>> Warner Losh <imp@bsdimp.com> wrote:
>>> I thought that the ELF headers gave us all the data we needed to =
know
>>> how things were built...
>>=20
>> It will tell us if it was for e.g. an ARM or MIPS ELF file, but I'm =
not
>> sure how we can tell the difference between an arm and an armv6 ELF.
>>=20
>> With armv6 there are a few changes in the userland/kernel
>> interface, e.g. reading the thread local storage pointer is different
>> such that an armv6 static binary would not run on an ARMv5 core as it
>> uses newer instructions.
>=20
> Initially, I thought that you want to differentiate binaries based on =
the
> features of the ISA used.  I am not aware of any portable convention
> to do this.  For SPARC ISA extensions, Sun invented DT_SUNW_CAP tag.
> IMHO using tag instead of note is slightly better there.
>=20
> But, your later note suggests that you actually worry about the ABI,
> and not ISA features, right ?  There is EI_OSABI byte in the e_ident
> member of the ELF header, and you could allocate an new ABI identifier
> for FREEBSD ARMv6, with corresponding changes in the ELF image
> activator.
>=20
> Whatever method of branding is used, IMO you should really discuss
> this with the architecture owners, i.e. ARM.  If any other OS would
> invent similar branding with the different implementation, it is
> detrimental to the whole arch ecosystem, I think.

I posted links to the relevant standards, and there are standard ways to =
find this information out from the ELF headers. The only possible issue =
is the brandelf issue, which I've not looked into.

Warner




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?97A960A4-1955-4D6C-8A75-FCBC3CD2DEB7>