Commit Graph

10 Commits

Author SHA1 Message Date
Marcel Moolenaar
76c1f1f63d Catch up with common usage:
o  Define ELFMAG and SELFMAG as an alternative to test the ELF magic.
   ELFMAG is the magic; SELFMAG is the size of the magic. Use with
   strncmp() or memcmp().
o  Define SHT_NUM as the number of predefined sections.

Note: style(9) deviation for consistency.
2001-09-08 22:59:30 +00:00
David E. O'Brien
f310d6cfbf Add "ELFOSABI_NONE" which is the symbol used in a copy of the old ELF spec,
as an alias for "ELFOSABI_SYSV".
2001-02-24 22:23:12 +00:00
David E. O'Brien
68a2ed01fd Update the e_machine values to include x86-64, PowerPC and [Strong]ARM;
and fix the Sparc values.  Also update the ELFOSABI list while I'm here.
2001-01-01 21:56:57 +00:00
Doug Rabson
d0eedf572f Add machine type for ia64. 2000-09-29 13:35:14 +00:00
David E. O'Brien
c815a20cb2 Change our ELF binary branding to something more acceptable to the Binutils
maintainers.

After we established our branding method of writing upto 8 characters of
the OS name into the ELF header in the padding; the Binutils maintainers
and/or SCO (as USL) decided that instead the ELF header should grow two new
fields -- EI_OSABI and EI_ABIVERSION.  Each of these are an 8-bit unsigned
integer.  SCO has assigned official values for the EI_OSABI field.  In
addition to this, the Binutils maintainers and NetBSD decided that a better
ELF branding method was to include ABI information in a ".note" ELF
section.

With this set of changes, we will now create ELF binaries branded using
both "official" methods.  Due to the complexity of adding a section to a
binary, binaries branded with ``brandelf'' will only brand using the
EI_OSABI method.  Also due to the complexity of pulling a section out of an
ELF file vs. poking around in the ELF header, our image activator only
looks at the EI_OSABI header field.

Note that a new kernel can still properly load old binaries except for
Linux static binaries branded in our old method.

  *
  * For a short period of time, ``ld'' will also brand ELF binaries
  * using our old method.  This is so people can still use kernel.old
  * with a new world.  This support will be removed before 5.0-RELEASE,
  * and may not last anywhere upto the actual release.  My expiration
  * time for this is about 6mo.
  *
2000-04-18 02:39:26 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Doug Rabson
ac065b7037 The structure Elf_Note does not have 32 and 64 bit variants but always
has 32bit fields. This change allows FreeBSD/alpha to generate well-formed
ELF corefiles.

Reviewed by: John Polstra <jdp@polstra.com>
1999-05-07 22:09:18 +00:00
John Polstra
c8afdc1dcf Add generic defines ELF_ARCH, ELF_CLASS, and ELF_DATA. These give
the relevant characteristics of the native machine, for building
and checking Elf_Ehdr structures.

Add structures to represent ELF "note" headers.  Add defines for the
note types used in ELF core files.
1998-09-14 20:30:13 +00:00
John Polstra
e17ade2b82 Add definitions for the ELF section attribute flags, SHF_*.
Submitted by:	Robert Nordier <rnordier@nordier.com>
1998-09-08 20:38:06 +00:00
John Polstra
ca0154bc75 Revamp the ELF include files to better support architecture-independent
applications.  Here's how it works.

The kernel should include <machine/elf.h> to get the definitions
for the native architecture.  It can reference the various ELF
structures with generic names like Elf_Sym, Elf_Shdr, etc.  A define
__ELF_WORD_SIZE is also available with the value 32 or 64 as
appropriate for the native architecture.

Generic applications should include <elf.h>, which is just a wrapper
for <machine/elf.h>.

Applications such as object file dumpers that need to deal with
foreign ELF files can include <sys/elf32.h> and/or <sys/elf64.h>.
Both can be included from the same source file if desired.  The
structure names must be referenced using wordsize-specific names
like Elf32_Sym, Elf64_Shdr, etc.

I haven't change the alpha stuff, but I haven't broken it either.
1998-08-16 03:03:38 +00:00