Adding a MACHINE_ARCH note

Warner Losh imp at bsdimp.com
Wed Jul 10 04:22:38 UTC 2013


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 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.

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



More information about the freebsd-arch mailing list