Problem
I installed the JDK or UDK, and now some other ELF binaries that used to run will not execute. Instead, I get an error message such as:
dynamic linker: <filename>: symbol not found:
init_features_vectorWhen I try to examine this with the ldd(C) command
(ldd [-r|-d] <filename>), I get the following errors:<filename> needs: /usr/lib/libc.so.1 => /udk/usr/lib/libc.so.1 dynamic linker: <filename>: relocation error: symbol not found: _init_features_vector
<filename> is the name of the elf binary. Not all elf binaries generate this message. Most ELF binaries run fine.
Cause
The ELF binary is malformed. This can be fixed.
The libc.so library that is shipped with either the JDK or UDK
(/usr/lib/libc.so.1) attempts to automatically recognize two classes
of dynamic ELF binaries: OpenServer binaries, and Gemini (SVR4,
UnixWare, UDK, Gemini) binaries. The ELF binary that will not run
is an OpenServer binary, but it is being recognized as a Gemini
binary. To fix it, it must be marked correctly, using the provided
tool.All OpenServer dynamic ELF binaries make reference to the symbol
"_init_features_vector". The Gemini libc does not provide this
symbol. However, the runtime linker uses a different mechanism to
recognize binary types, and can sometimes be fooled. These cases
can be recognized because they will generate a message about
"_init_features_vector".Why are these binaries sometimes misidentified?OpenServer binaries built by the OpenServer compiler tools (cc, icc, and gcc distribution) place a "stamp" into the binary. This stamp lives in the ".note" section. An example can be seen by executing:
$ dump -sn .note /bin/x286emulNOTE: Like any other live software, gcc is under active development. gcc for OpenServer 5 comes in a number of flavors, with respect to this issue:
gcc 2.7-95q4 -- produces correct .note sections which are understood correctly by the UDK (or JDK)libc.
GNU strip 2.7-95q4 -- removes .note sections. This is a
problem only if the GNU Development System is installed and
in the search path before the SCO Development System, AND
the makefile strips binaries.Other ports of gcc 2.7.x -- may or may not do anything with .note sections.
J. Kean Johnson's work, which has been checked into gcc 2.8.0 builds .note sections, are correct according to SCO's documentation of the elfstamp, but cannot be recognized because of the way the RTLD works.
The ELF binary is either missing its .note section, the .note section
is in an incorrect format, or the .note section has a different size
than what the RTLD expects. The RTLD uses the size of the .note
section to determine the binary version unless it has a UDK (Gemini)
mark in the ELF header flags. elfmark puts the UDK or OSR5 mark in
this header flag, thus overriding any consideration of the .note
section existence.What happened to the .note section?There are three known possibilities:1. It was built with a very early (pre-alpha) release of the of the OpenServer Release 5.0 Development System.
2. It was built with anything, then stripped with the 'strip' program as found in the port of the GNU toolchain. This removes the necessary .note section.
3. It was built with a preliminary version of GCC 2.8.0, which contains J. Kean Johnson's OpenServer port work. This writes correct OSR5 .note sections which should be, but are not, correctly recognized by the UDK libc.
Solution
To fix the binary so that it is properly recognized, issue this command:
# /udk/usr/ccs/bin/elfmark -t osr5 <filename>NOTE: Static ELF binaries and all COFF and OMF binaries do not use the
runtime dynamic linker /usr/lib/ld.so.1 == /usr/lib/libc.so.1, so
they are unaffected by any of these changes. Static ELF and all
COFF binaries continue to be treated as OpenServer 5.0 binaries on
OpenServer 5.0. Static ELF binaries continue to be treated as
SVR4/UnixWare binaries on UnixWare. COFF and all OMF (8086/286/386
x.out) binaries continue to be treated as iBCS2 on both operating
systems.