check_rtime.pl revision 7e7bd3dccbfe8f79e25e5c1554b5bc3a9aaca321
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#
#
# Check ELF information.
#
# This script descends a directory hierarchy inspecting ELF dynamic executables
# and shared objects. The general theme is to verify that common Makefile rules
# have been used to build these objects. Typical failures occur when Makefile
#
# As always, a number of components don't follow the rules, and these are
# excluded to reduce this scripts output. Pathnames used for this exclusion
# assume this script is being run over a "proto" area. The -a (all) option
# skips any exclusions.
#
# By default any file that has conditions that should be reported is first
# listed and then each condition follows. The -o (one-line) option produces a
#
# NOTE: missing dependencies, symbols or versions are reported by running the
# file through ldd(1). As objects within a proto area are built to exist in a
# base system, standard use of ldd(1) will bind any objects to dependencies
# that exist in the base system. It is frequently the case that newer objects
# exist in the proto area that are required to satisfy other objects
# dependencies, and without using these newer objects an ldd(1) will produce
# misleading error messages. To compensate for this, the -d option (or the
# existence of the CODEMSG_WS/ROOT environment variables) cause the creation of
# alternative dependency mappings via crle(1) configuration files that establish
# any proto shared objects as alternatives to their base system location. Thus
# ldd(1) can be executed against these configuration files so that objects in a
# proto area bind to their dependencies in the same proto area.
# Define all global variables (required for strict)
use vars qw($SkipUndefFiles $SkipUnusedDeps);
use strict;
# Define any directories we should skip completely.
$SkipDirs = qr{
}x;
# Define any files we should skip completely.
$SkipFiles = qr{ ^(?:
lddstub | # lddstub has no dependencies
fptest | # USIII specific extns. cause ldd noise on USII bld. m/c
)$
}x;
# Define any files that are allowed text relocations.
$SkipTextrelFiles = qr{ ^(?:
unix | # kernel models are non-pic
mdb # relocations against __RTC (dbx)
)$
}x;
# Define any directories or files that are allowed to have no direct bound
# symbols
$SkipDirectBindDirs = qr{
}x;
$SkipDirectBindFiles = qr{ ^(?:
unix |
sbcp |
)$
}x;
# Define any files that are allowed undefined references.
$SkipUndefFiles = qr{ ^(?:
)$
}x;
# Define any files that have unused dependencies.
$SkipUnusedDeps = qr{
/lib/libp # profile libc makes libm an unused
}x; # dependency of standard libc
# Define any objects that always look unused.
$SkipUnusedObject = qr{
}x;
# Define any files that should contain debugging information.
$SkipStabFiles = qr{ ^(?:
)$
}x;
# Define any files that don't require a non-executable stack definition.
$SkipNoExStkFiles = qr{ ^(?:
forth |
unix |
)$
}x;
# Identify any files that should be skipped when building a crle(1)
# configuration file. As the hwcap libraries can be loop-back mounted onto
$SkipCrleConf = qr{
lib/libc/libc_hwcap
}x;
# Skip "unused search path=" ldd(1) diagnostics.
$SkipUnusedSearchPath = qr{
}x;
# Skip "unreferenced object=" ldd(1) diagnostics.
$SkipUnrefObject = qr{
}x;
# Define any files that should only have unused (ldd -u) processing.
$UnusedPaths = qr{
ucb/shutdown # libucb interposes on libc and makes
# dependencies on libc seem unnecessary
}x;
# Define interpreters we should ignore.
$SkipInterps = qr{
}x;
# Catch libintl and libw, although ld(1) will bind to these and thus determine
# they're needed, their content was moved into libc as of on297 build 7.
# libthread and libpthread were completely moved into libc as of on10 build 53.
# libdl was moved into libc as of on10 build 49. librt and libaio were moved
# into libc as of Nevada build 44.
$OldDeps = qr{ ^(?:
)$
}x;
# Files for which we skip checking of duplicate addresses in the
# symbol sort sections. Such exceptions should be rare --- most code will
# not have duplicate addresses, since it takes assember or a "#pragma weak"
# to do such aliasing in C. C++ is different: The compiler generates aliases
# for implementation reasons, and the mangled names used to encode argument
# and return value types are difficult to handle well in mapfiles.
# Furthermore, the Sun compiler and gcc use different and incompatible
# name mangling conventions. Since ON must be buildable by either, we
# would have to maintain two sets of mapfiles for each such object.
# C++ use is rare in ON, so this is not worth pursuing.
#
$SkipSymSort = qr{ ^.*(?:
)$
}x;
# -----------------------------------------------------------------------------
# Reliably compare two OS revisions. Arguments are <ver1> <op> <ver2>.
# <op> is the string form of a normal numeric comparison operator.
sub cmp_os_ver {
my @ver1 = split(/\./, $_[0]);
my $op = $_[1];
my @ver2 = split(/\./, $_[2]);
my $diff = 0;
last;
}
}
return (eval "$diff $op 0" ? 1 : 0);
}
# This script relies on ldd returning output reflecting only the binary
# contents. But if LD_PRELOAD* environment variables are present, libraries
# named by them will also appear in the output, disrupting our analysis.
# So, before we get too far, scrub the environment.
delete($ENV{LD_PRELOAD});
delete($ENV{LD_PRELOAD_32});
delete($ENV{LD_PRELOAD_64});
# Establish a program name for any error diagnostics.
# Determine what machinery is available.
$Env = "";
$Ena64 = "ok";
}
$Ena64 = "ok";
}
}
# Check that we have arguments.
print "usage: $Prog [-a] [-d depdir] [-m] [-o] [-s] file | dir, ...\n";
print "\t[-a]\t\tprocess all files (ignore any exception lists)\n";
print "\t[-d dir]\testablish dependencies from under directory\n";
print "\t[-i]\t\tproduce dynamic table entry information\n";
print "\t[-m]\t\tprocess mcs(1) comments\n";
print "\t[-o]\t\tproduce one-liner output (prefixed with pathname)\n";
print "\t[-s]\t\tprocess .stab and .symtab entries\n";
print "\t[-v]\t\tprocess version definition entries\n";
exit 1;
} else {
my($Proto);
if ($opt{d}) {
# User specified dependency directory - make sure it exists.
if (! -d $opt{d}) {
print "$Prog: $opt{d} is not a directory\n";
exit 1;
}
} elsif ($ENV{CODEMGR_WS}) {
my($Root);
# Without a user specified dependency directory see if we're
# part of a codemanager workspace and if a proto area exists.
}
}
$Tmpdir = "/tmp";
}
# Determine whether this is a __GNUC build. If so, unused search path
# processing is disabled.
$Gnuc = 1;
} else {
$Gnuc = 0;
}
# Look for dependencies under $Proto.
if ($Proto) {
# To support alternative dependency mapping we'll need ldd(1)'s
# -e option. This is relatively new (s81_30), so make sure
# ldd(1) is capable before gathering any dependency information.
print "ldd: does not support -e, unable to ";
print "create alternative dependency mappingings.\n";
print "ldd: option added under 4390308 (s81_30).\n\n";
} else {
# Gather dependencies and construct a alternative
# dependency mapping via a crle(1) configuration file.
GenConf();
}
}
# To support unreferenced dependency detection we'll need ldd(1)'s -U
# option. This is relatively new (4638070), and if not available we
# can still fall back to -u. Even with this option, don't use -U with
# releases prior to 5.10 as the cleanup for -U use only got integrated
# into 5.10 under 4642023. Note, that nightly doesn't typically set a
# RELEASE from the standard <env> files. Users who wish to disable use
# of ldd(1)'s -U should set (or uncomment) RELEASE in their <env> file
# if using nightly, or otherwise establish it in their environment.
$LddNoU = 1;
} else {
my($Release);
$LddNoU = 1;
} else {
$LddNoU = 0;
}
}
# For each argument determine if we're dealing with a file or directory.
# Ignore symbolic links.
if (-l $Arg) {
next;
}
if (!stat($Arg)) {
next;
}
# Process simple files.
if (-f _) {
my($Secure) = 0;
$RelPath =~ s!^.*/!./!;
$File =~ s!^.*/!!;
if (-u _ || -g _) {
$Secure = 1;
}
next;
}
# Process directories.
if (-d _) {
next;
}
print "$Arg is not a file or directory\n";
$Error = 1;
}
# Cleanup
CleanUp();
}
$Error = 0;
# Clean up any temporary files.
sub CleanUp {
if ($Crle64) {
unlink $Crle64;
}
if ($Conf64) {
unlink $Conf64;
}
if ($Crle32) {
unlink $Crle32;
}
if ($Conf32) {
unlink $Conf32;
}
}
# Create an output message, either a one-liner (under -o) or preceded by the
# files relative pathname as a title.
sub OutMsg {
if ($opt{o}) {
$Msg =~ s/^[ \t]*//;
print "$Path: $Msg\n";
} else {
if ($Ttl eq 0) {
print "==== $Path ====\n";
}
print "$Msg\n";
}
}
# Determine whether this a ELF dynamic object and if so investigate its runtime
# attributes.
sub ProcFile {
my($HasDirectBinding, $HasVerdef);
# Ignore symbolic links.
if (-l $FullPath) {
return;
}
$Ttl = 0;
@Ldd = 0;
# Determine whether we have access to inspect the file.
if (!(-r $FullPath)) {
"\tunable to inspect file: permission denied");
return;
}
# Determine if this is a file we don't care about.
if (!$opt{a}) {
return;
}
}
# Determine whether we have a executable (static or dynamic) or a
# shared object.
$Interp = 1;
$Header = 'None';
# If we have an invalid file type (which we can tell from the
# first line), or we're processing an archive, bail.
if ($Header eq 'None') {
return;
}
}
$Header = 'Ehdr';
$Header = 'Phdr';
$RWX = 0;
} elsif ($Line =~ /^Interpreter/) {
$Header = 'Intp';
# A dynamic section indicates we're a dynamic object
# (this makes sure we don't check static executables).
$Dyn = 1;
# The e_type field indicates whether this file is a
# shared object (ET_DYN) or an executable (ET_EXEC).
$Dll = 1;
return;
}
# If we encounter a 64-bit object, but we're not running
# on a 64-bit system, suppress calling ldd(1).
$SkipLdd = 1;
}
# If it's a X86 object, we need to enforce RW- data.
$IsX86 = 1;
}
} elsif (($Header eq 'Phdr') &&
# RWX segment seen.
$RWX = 1;
} elsif (($Header eq 'Phdr') &&
# Seen an RWX PT_LOAD segment.
if ($File !~ $SkipNoExStkFiles) {
"\tapplication requires non-executable " .
"data\t<no -Mmapfile_noexdata?>");
}
} elsif (($Header eq 'Phdr') &&
($Line =~ /\[ PT_SUNWSTACK \]/)) {
# This object defines a non-executable stack.
$Stack = 1;
($Line =~ $SkipInterps)) {
# This object defines an interpretor we should skip.
$Interp = 0;
}
}
# Determine whether this ELF executable or shared object has a
# conforming mcs(1) comment section. If the correct $(POST_PROCESS)
# macros are used, only a 3 or 4 line .comment section should exist
# containing one or two "@(#)SunOS" identifying comments (one comment
# for a non-debug build, and two for a debug build). The results of
# the following split should be three or four lines, the last empty
# line being discarded by the split.
if ($opt{m}) {
$Val++;
$Con = 1;
last;
}
$Dev = 1;
next;
}
$Con = 1;
last;
}
$Con = 1;
last;
}
}
"\tnon-conforming mcs(1) comment\t<no \$(POST_PROCESS)?>");
}
}
# Applications should contain a non-executable stack definition.
if (!$opt{a}) {
if ($File =~ $SkipNoExStkFiles) {
goto DYN;
}
}
"\tapplication requires non-executable stack\t<no -Mmapfile_noexstk?>");
}
DYN:
# Having caught any static executables in the mcs(1) check and non-
# executable stack definition check, continue with dynamic objects
# from now on.
if ($Dyn eq 0) {
return;
}
# Only use ldd unless we've encountered an interpreter that should
# be skipped.
my $LDDFullPath = $FullPath;
if ($Secure) {
# The execution of a secure application over an nfs file
# system mounted nosuid will result in warning messages
# environment can occur with root builds, move the file
# being investigated to a safe place first. In addition
# remove its secure permission so that it can be
# influenced by any alternative dependency mappings.
my($TmpPath) = "$Tmpdir/$File";
chmod 0777, $TmpPath;
$LDDFullPath = $TmpPath;
}
# Use ldd(1) to determine the objects relocatability and use.
# By default look for all unreferenced dependencies. However,
# some objects have legitimate dependencies that they do not
# reference.
$Lddopt = "-ru";
} else {
$Lddopt = "-rU";
}
if ($Secure) {
unlink $LDDFullPath;
}
}
$Val = 0;
$Sym = 5;
$UnDep = 1;
if ($Val == 0) {
$Val = 1;
# Make sure ldd(1) worked. One possible failure is that
# this is an old ldd(1) prior to -e addition (4390308).
last;
last;
}
# It's possible this binary can't be executed, ie. we've
# found a sparc binary while running on an intel system,
# or a sparcv9 binary on a sparcv7/8 system.
"\thas wrong class or data encoding");
next;
}
# Historically, ldd(1) likes executable objects to have
# their execute bit set. Note that this test isn't
# applied unless the -a option is in effect, as any
# non-executable files are skipped by default to reduce
# the cost of running this script.
if ($Line =~ /not executable/) {
"\tis not executable");
next;
}
}
# Look for "file" or "versions" that aren't found. Note that
# these lines will occur before we find any symbol referencing
# errors.
}
next;
}
# Look for relocations whose symbols can't be found. Note, we
# only print out the first 5 relocations for any file as this
# output can be excessive.
# Determine if this file is allowed undefined
# references.
if ($Sym == 5) {
if (!$opt{a}) {
if ($File =~ $SkipUndefFiles) {
$Sym = 0;
next;
}
}
}
if ($Sym-- == 1) {
if (!$opt{o}) {
"\tcontinued ...");
}
next;
}
# Just print the symbol name.
next;
}
# Look for any unused search paths.
# Note, skip this comparison for __GNUC builds, as the
# gnu compilers insert numerous unused search paths.
if ($Gnuc == 1) {
next;
}
if (!$opt{a}) {
if ($Line =~ $SkipUnusedSearchPath) {
next;
}
}
if ($Secure) {
}
next;
}
# Look for unreferenced dependencies. Note, if any unreferenced
# objects are ignored, then set $UnDep so as to suppress any
# associated unused-object messages.
if (!$opt{a}) {
if ($Line =~ $SkipUnrefObject) {
$UnDep = 0;
next;
}
}
if ($Secure) {
}
next;
}
# Look for any unused dependencies.
if (!$opt{a}) {
if ($RelPath =~ $SkipUnusedDeps) {
next;
}
if ($Line =~ $SkipUnusedObject) {
next;
}
}
if ($Secure) {
}
next;
}
}
# Reuse the elfdump(1) data to investigate additional dynamic linking
# information.
$HasDirectBinding = 0;
$HasVerdef = 0;
$Header = 'None';
# We're only interested in the section headers and the dynamic
# section.
$Header = 'Shdr';
# This object has a combined relocation section.
$Sun = 1;
# This object contain .stabs sections
$Stab = 1;
} elsif (($SymSort == 0) &&
# This object contains a symbol sort section
$SymSort = 1;
}
# This object contains a complete symbol table.
$Strip = 0;
}
next;
$Header = 'Dyn';
next;
$Header = 'Syminfo';
next;
$HasVerdef = 1;
next;
next;
}
# Look into the Syminfo section.
# Does this object have at least one Directly Bound symbol?
if (($Header eq 'Syminfo')) {
my(@Symword);
if ($HasDirectBinding == 1) {
next;
}
if (!defined($Symword[1])) {
next;
}
if ($Symword[1] =~ /B/) {
$HasDirectBinding = 1;
}
next;
}
# Does this object contain text relocations.
# Determine if this file is allowed text relocations.
if (!$opt{a}) {
if ($File =~ $SkipTextrelFiles) {
$Tex = 0;
next ELF;
}
}
"\tTEXTREL .dynamic tag\t\t\t<no -Kpic?>");
$Tex = 0;
next;
}
# Does this file have any relocation sections (there are a few
# psr libraries with no relocations at all, thus a .SUNW_reloc
# section won't exist either).
next;
}
# Does this file have any plt relocations. If the plt size is
# equivalent to the total relocation size then we don't have
# any relocations suitable for combining into a .SUNW_reloc
# section.
next;
}
# Does this object have any dependencies.
# Catch any old (unnecessary) dependencies.
"\tNEEDED=$Need\t<dependency no longer necessary>");
} elsif ($opt{i}) {
# Under the -i (information) option print out
# any useful dynamic entries.
}
next;
}
# Is this object built with -B direct flag on?
$HasDirectBinding = 1;
}
# Does this object specify a runpath.
next;
}
}
# A shared object, that contains non-plt relocations, should have a
# combined relocation section indicating it was built with -z combreloc.
"\tSUNW_reloc section missing\t\t<no -zcombreloc?>");
}
# No objects released to a customer should have any .stabs sections
# remaining, they should be stripped.
if (!$opt{a}) {
if ($File =~ $SkipStabFiles) {
goto DONESTAB;
}
}
"\tdebugging sections should be deleted\t<no strip -x?>");
}
# Identify an object that is not built with either -B direct or
# -z direct.
if (($RelPath =~ $SkipDirectBindDirs) ||
($File =~ $SkipDirectBindFiles)) {
goto DONESTAB;
}
"\tobject has no direct bindings\t<no -B direct or -z direct?>");
}
# All objects should have a full symbol table to provide complete
# debugging stack traces.
if ($Strip) {
"\tsymbol table should not be stripped\t<remove -s?>");
}
# If there are symbol sort sections in this object, report on
# any that have duplicate addresses.
# If -v was specified, and the object has a version definition
# section, generate output showing each public symbol and the
# version it belongs to.
}
## ProcSymSortOutMsg(RefTtl, RelPath, secname, addr, names...)
#
# Call OutMsg for a duplicate address error in a symbol sort
# section
#
sub ProcSymSortOutMsg {
}
## ProcSymSort(FullPath, RelPath)
#
# Examine the symbol sort sections for the given object and report
# on any duplicate addresses found. Ideally, mapfile directives
# should be used when building objects that have multiple symbols
# with the same address so that only one of them appears in the sort
# section. This saves space, reduces user confusion, and ensures that
# libproc and debuggers always display public names instead of symbols
# that are merely implementation details.
#
sub ProcSymSort {
# If this object is exempt from checking, return quietly
return if ($FullPath =~ $SkipSymSort);
open(SORT, "elfdump -S $FullPath|") ||
die "$Prog: Unable to execute elfdump (symbol sort sections)\n";
my $line;
my $last_addr;
my @dups = ();
my $secname;
chomp $line;
next if ($line eq '');
# If this is a header line, pick up the section name
$secname = $1;
# Every new section is followed by a column header line
# Flush anything left from previous section
# Reset variables for new sort section
$last_addr = '';
@dups = ();
next;
}
# Process symbol line
if ($new_type eq 'UNDEF') {
"$secname: unexpected UNDEF symbol " .
"(link-editor error): $new_name");
next;
}
} else {
}
}
if (scalar(@dups) > 1);
close SORT;
}
## ProcVerdef(FullPath, RelPath)
#
# Examine the version definition section for the given object and report
# each public symbol along with the version it belongs to.
#
sub ProcVerdef {
my $line;
my $cur_ver = '';
# pvs -dov provides information about the versioning hierarchy
# in the file. Lines are of the format:
# path - version[XXX];
# where [XXX] indicates optional information, such as flags
# or inherited versions.
#
# Private versions are allowed to change freely, so ignore them.
open(PVS, "pvs -dov $FullPath|") ||
die "$Prog: Unable to execute pvs (version definition section)\n";
chomp $line;
if ($line =~ /^[^\s]+\s+-\s+([^;]+)/) {
my $ver = $1;
}
}
close PVS;
# pvs -dos lists the symbols assigned to each version definition.
# Lines are of the format:
# path - version: symbol;
# path - version: symbol (size);
# where the (size) is added to data items, but not for functions.
# We strip off the size, if present.
open(PVS, "pvs -dos $FullPath|") ||
die "$Prog: Unable to execute pvs (version definition section)\n";
chomp $line;
if ($line =~ /^[^\s]+\s+-\s+([^:]+):\s*([^\s;]+)/) {
my $ver = $1;
my $sym = $2;
if ($opt{o}) {
"VERSION=$ver, SYMBOL=$sym");
} else {
}
}
}
}
close PVS;
}
sub ProcDir {
# Determine if this is a directory we don't care about.
if (!$opt{a}) {
return;
}
}
# Open the directory and read each entry, omit files starting with "."
if ($Entry =~ /^\./) {
next;
}
$NewFull = "$FullDir/$Entry";
# Ignore symlinks.
if (-l $NewFull) {
next;
}
if (!stat($NewFull)) {
next;
}
$NewRel = "$RelDir/$Entry";
# Descend into and process any directories.
if (-d _) {
next;
}
# Typically dynamic objects are executable, so we can
# reduce the overall cost of this script (a lot!) by
# screening out non-executables here, rather than pass
# them to file(1) later. However, it has been known
# for shared objects to be mistakenly left non-
# executable, so with -a let all files through so that
# this requirement can be verified (see ProcFile()).
if (!$opt{a}) {
if (! -x _) {
next;
}
}
# Process any standard files.
if (-f _) {
my($Secure) = 0;
if (-u _ || -g _) {
$Secure = 1;
}
next;
}
}
closedir(DIR);
}
}
# Create a crle(1) script for any 64-bit dependencies we locate. A runtime
# configuration file will be generated to establish alternative dependency
# mappings for all these dependencies.
sub Entercrle64 {
if (!$Crle64) {
# Create and initialize the script if is doesn't already exit.
$Crle64 = "$Tmpdir/$Prog.crle64.$$";
open(CRLE64, "> $Crle64") ||
die "$Prog: open failed: $Crle64: $!";
}
print CRLE64 "\t-o $FullDir -a $RelDir/$Entry \\\n";
}
# Create a crle(1) script for any 32-bit dependencies we locate. A runtime
# configuration file will be generated to establish alternative dependency
# mappings for all these dependencies.
sub Entercrle32 {
if (!$Crle32) {
# Create and initialize the script if is doesn't already exit.
$Crle32 = "$Tmpdir/$Prog.crle32.$$";
open(CRLE32, "> $Crle32") ||
die "$Prog: open failed: $Crle32: $!";
}
print CRLE32 "\t-o $FullDir -a $RelDir/$Entry \\\n";
}
# Having finished gathering dependencies, complete any crle(1) scripts and
# execute them to generate the associated runtime configuration files. In
# addition establish the environment variable required to pass the configuration
# files to ldd(1).
sub GenConf {
if ($Crle64) {
print CRLE64 "\t-c $Conf64\n";
chmod 0755, $Crle64;
close CRLE64;
if (system($Crle64)) {
undef $Conf64;
}
}
if ($Crle32) {
print CRLE32 "\t-c $Conf32\n";
chmod 0755, $Crle32;
close CRLE32;
if (system($Crle32)) {
undef $Conf32;
}
}
$Env = "-e LD_FLAGS=config_64=$Conf64,config_32=$Conf32";
$Env = "-e LD_FLAGS=config_64=$Conf64";
$Env = "-e LD_FLAGS=config_32=$Conf32";
}
}
# Recurse through a directory hierarchy looking for appropriate dependencies.
sub GetDeps {
my($NewFull);
# Open the directory and read each entry, omit files starting with "."
if ($Entry =~ /^\./) {
next;
}
$NewFull = "$FullDir/$Entry";
# We need to follow links so that any dependencies
# are expressed in all their available forms.
# Bail on symlinks like 32 -> .
if (-l $NewFull) {
if (readlink($NewFull) =~ /^\.$/) {
next;
}
}
if (!stat($NewFull)) {
next;
}
if (!$opt{a}) {
if ($NewFull =~ $SkipCrleConf) {
next;
}
}
# If this is a directory descend into it.
if (-d _) {
my($NewRel);
if ($RelDir =~ /^\/$/) {
$NewRel = "$RelDir$Entry";
} else {
$NewRel = "$RelDir/$Entry";
}
next;
}
# If this is a regular file determine if its a
# valid ELF dependency.
if (-f _) {
my($File);
# Typically shared object dependencies end with
# ".so" or ".so.?", hence we can reduce the cost
# of this script (a lot!) by screening out files
# that don't follow this pattern.
if (!$opt{a}) {
next;
}
}
next;
}
} elsif ($Ena64) {
}
next;
}
}
closedir(DIR);
}
}
exit $Error