[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: thoughts on architectures

In article <20020211001709.A1325@quic.net> you write:
>I need to look into it a bit more, and figure out exactly what FreeBSD does
>and doesn't do with this.

Everything you need to know is in /usr/src/sys/kern/imgact_elf.c:

	/* We support three types of branding -- (1) the ELF EI_OSABI field
	 * that SCO added to the ELF spec, (2) FreeBSD 3.x's traditional string
	 * branding w/in the ELF header, and (3) path of the `interp_path'
	 * field.  We should also look for an ".note.ABI-tag" ELF section now
	 * in all Linux ELF binaries, FreeBSD 4.1+, and some NetBSD ones.

There's a table of the supported ABIs which is scanned when executing an
ELF binary. On the first scan an ABI is found if either the OSABI field
matches (number 1 above) or if the second eight bytes of the ELF header
match (which used to be "FreeBSD" instead of nulls as is usual) (number
2 above). On the second scan an ABI is found if the file's .interp
section matches (number 3 above).


Reply to: