elf.py revision 1231
#
# 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.
#
import os
"""Exception that is raised when the elf dependency checker is given
a file that errors when it tries to get the dynamic section from the
file."""
"""Exception that is used for elf dependencies which have a dynamic
token in their path that we're unable to decode."""
return _("%s had this token, %s, in its run path:%s. We are "
"unable to handle this token at this time.") % \
"""Class representing a dependency from one file to another library
as determined by elf."""
**kwargs)
"""Checks whether this dependency has been delivered. If the
full path has not been delivered, check whether the base name
has. If it has, it's likely that the run path is being set
externally. Report a warning, but not an error in this case."""
# If the none of the paths pointed to a file with the desired
# basename, but a file with that basename was delivered by this
# package, then treat the dependency as a warning instead of
# an error. The failure to find the path to the right file
# may be due to the library search path being set outside the
# file that generates the dependency.
"warning"
else:
"""Given a file action and proto directory, produce the elf dependencies
for that file."""
return []
return []
try:
raise BadElfFile(proto_file, e)
deps = [
d[0]
]
rp = []
rp = [
for p in rp
]
kernel64 = None
# For kernel modules, default path resolution is /platform/<platform>,
# a given module? Does it do fallbacks to, say, sun4u?
if rp:
raise RuntimeError("RUNPATH set for kernel module "
# Add this platform to the search path.
# Default kernel search path
# What subdirectory should we look in for 64-bit kernel modules?
kernel64 = "amd64"
kernel64 = "sparcv9"
else:
raise RuntimeError("Unknown arch:%s" %
ei["arch"])
else:
if "/lib" not in rp:
res = []
elist = []
for p in rp:
if "$" in p:
if "/" in tok:
return [
for d in deps
], elist