add an identifying mark to an ELF file
elfmark -t osr5|udk|none file ...
The elfmark command is used to add an identifying mark
to an ELF file. The OpenServer 5 platform supports
a different application binary interface (ABI) from UnixWare 7
and other platforms derived from UNIX System V, Release 4.
There are differences in the size of fundamental data types
like uid_t; differences in the layout of system data
structures like struct stat; differences in values for
system constants such as error numbers; and even differences
in fundamental compiler calling conventions. This means
that for an OpenServer binary to run correctly on
UnixWare 7 or for a UnixWare 7 binary to run correctly on
OpenServer, the systems must be able to tell for which platform
the binary was intended.
Most binaries compiled for OpenServer contain an identifying
section added by the OpenServer assembler and linker. This
section is called .note and is visible through an
executable's or shared library's program header as a segment
of type PT_NOTE. Unfortunately, the contents of this
section are not made part of the program's or shared library's
address space and are thus not easily accessible by the
system. The system therefore uses the presence of the
section and some heuristics about its size to determine
whether a file is intended for OpenServer. elfmark
is intended to be used in those rare occurrences where
the heuristics break down and the system misidentifies
an ELF file.
elfmark changes the value in the ``e_flags'' field of
an ELF file's ELF header. This value is normally zero.
elfmark accepts a single option, -t,
whose argument identifies the intended target platform
and governs the value inserted in the ``e_flags''
field. The argument can have the following values:
This value asserts that the file uses the OpenServer application
This value asserts that the file uses the UnixWare 7 application
binary interface. The UnixWare 7 ABI conforms to the System
V Application Binary Interface and the System V
Application Binary Interface Intel386 Architecture Processor
Supplement. Since a System V ABI conforming application
will have zero in the ``e_flags'' field of its ELF
header, a special mark is needed to distinguish it from an
OpenServer ELF binary, which also has zero in the ``e_flags''
field (unless elfmarked). This mark may also be inserted
using the -Kudk option to the UnixWare 7 cc and CC
This value resets the ``e_flags'' field of the ELF header
``Object files'' in Programming in standard C and C++.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004