Adding a MACHINE_ARCH note

Konstantin Belousov kostikbel at gmail.com
Wed Jul 10 03:46:05 UTC 2013


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 at bsdimp.com> wrote:
> > I thought that the ELF headers gave us all the data we needed to know
> > how things were built...
> 
> 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.
> 
> 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.

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.

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.

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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20130710/51561360/attachment.sig>


More information about the freebsd-arch mailing list