Commit Graph

14 Commits

Author SHA1 Message Date
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
Wes Peters
b5ce857bec Make brandelf explain itself a little better on error.
Also, at Boris' suggestion, add -l option to list known
ELF types.

PR:		bin/15285
Reviewed by:	bp
2000-01-04 02:33:54 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Mark Newton
d81380b49d Added "SVR4" as an acceptable brand 1999-01-30 06:16:48 +00:00
Eivind Eklund
7b206e114e Add a forgotten 'static'. 1998-04-21 02:44:12 +00:00
Eivind Eklund
e3e9c8eed9 Make brandelf test for known brands, and introduce a '-f' option to
bypass the testing.

Partially submitted by:  Brian Feldman <green@feldman.dyn.ml.org>
1998-04-21 02:31:09 +00:00
Joerg Wunsch
6fe3822809 Open the file r/o if looking only. Make the error message more useful.
PR:		bin/3283
Submitted by:	Martin Kammerhofer <dada@freepass.tu-graz.ac.at>
1997-08-23 15:51:14 +00:00
Philippe Charnier
4f971ac410 Use err(3). Typo fix in usage string. 1997-06-23 06:47:12 +00:00
John Polstra
5851a3655a Fill out the ELF header files to make them more or less complete.
Fix a macro name that was misspelled both in brandelf.c and
imgact_elf.h.
1997-05-21 23:07:31 +00:00
Warner Losh
1c8af87873 compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-29 04:34:07 +00:00
Peter Wemm
c115df18cd Revert $FreeBSD$ to $Id$ 1997-02-22 19:58:13 +00:00
Joerg Wunsch
b5b54135f4 Add a manpage for brandelf(1). Minor stylistic fixes, and a buffer
overrun fix, too.

Submitted by:	John-Mark Gurney <jmg@nike.efn.org>
1997-02-09 20:35:54 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Søren Schmidt
fcfc24ca7d Utility to "brand" ELF binaries.
Man page to come...
For now use: <brandelf -t Linux linuxbin> to brand, and just
<brandelf> to verify branding on a ELF file. FreeBSD native is
set with <brandelf -t FreeBSD freebsdbin>.
1996-10-16 18:16:22 +00:00