JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
man pages section 1: User Commands     Oracle Solaris 10 1/13 Information Library
search filter icon
search icon

Document Information

Preface

Introduction

User Commands

acctcom(1)

adb(1)

addbib(1)

admin(1)

aedplot(1B)

alias(1)

allocate(1)

amt(1)

appcert(1)

apptrace(1)

apropos(1)

ar(1)

arch(1)

as(1)

asa(1)

at(1)

atoplot(1B)

atq(1)

atrm(1)

audioconvert(1)

audioplay(1)

audiorecord(1)

auths(1)

auto_ef(1)

awk(1)

banner(1)

basename(1)

basename(1B)

batch(1)

bc(1)

bdiff(1)

bfs(1)

bg(1)

bgplot(1B)

biff(1B)

break(1)

cal(1)

calendar(1)

cancel(1)

case(1)

cat(1)

cc(1B)

cd(1)

cdc(1)

cdrw(1)

chdir(1)

checkeq(1)

checknr(1)

chgrp(1)

chkey(1)

chmod(1)

chown(1)

chown(1B)

ckdate(1)

ckgid(1)

ckint(1)

ckitem(1)

ckkeywd(1)

ckpath(1)

ckrange(1)

ckstr(1)

cksum(1)

cktime(1)

ckuid(1)

ckyorn(1)

clear(1)

cmp(1)

cocheck(1F)

cocreate(1F)

codestroy(1F)

col(1)

comb(1)

comm(1)

command(1)

compress(1)

continue(1)

coproc(1F)

coreceive(1F)

cosend(1F)

cp(1)

cpio(1)

cpp(1)

cputrack(1)

crle(1)

crontab(1)

crtplot(1B)

crypt(1)

csh(1)

csplit(1)

ct(1C)

ctags(1)

ctrun(1)

ctstat(1)

ctwatch(1)

cu(1C)

cut(1)

date(1)

dc(1)

deallocate(1)

decrypt(1)

delta(1)

deroff(1)

df(1B)

dhcpinfo(1)

diff(1)

diff3(1)

diffmk(1)

digest(1)

digestp(1)

dircmp(1)

dirname(1)

dirs(1)

dis(1)

disable(1)

dispgid(1)

dispuid(1)

dos2unix(1)

download(1)

dpost(1)

dtappsession(1)

du(1)

du(1B)

dumbplot(1B)

dump(1)

dumpcs(1)

dumpkeys(1)

echo(1)

echo(1B)

echo(1F)

ed(1)

edit(1)

egrep(1)

eject(1)

elfdump(1)

elfedit(1)

elfsign(1)

elfwrap(1)

enable(1)

encrypt(1)

enhance(1)

env(1)

eqn(1)

errange(1)

errdate(1)

errgid(1)

errint(1)

erritem(1)

error(1)

errpath(1)

errstr(1)

errtime(1)

erruid(1)

erryorn(1)

eval(1)

ex(1)

exec(1)

exit(1)

expand(1)

export(1)

exportfs(1B)

expr(1)

expr(1B)

exstr(1)

face(1)

factor(1)

false(1)

fastboot(1B)

fasthalt(1B)

fc(1)

fdformat(1)

fg(1)

fgrep(1)

file(1)

file(1B)

filep(1)

filesync(1)

filofaxp(1)

find(1)

finger(1)

fmlcut(1F)

fmlexpr(1F)

fmlgrep(1F)

fmli(1)

fmt(1)

fmtmsg(1)

fold(1)

for(1)

foreach(1)

franklinp(1)

from(1B)

ftp(1)

ftpcount(1)

ftpwho(1)

function(1)

gcore(1)

gencat(1)

geniconvtbl(1)

genlayouttbl(1)

genmsg(1)

get(1)

getconf(1)

getfacl(1)

getfrm(1F)

getitems(1F)

getlabel(1)

getopt(1)

getoptcvt(1)

getopts(1)

gettext(1)

gettxt(1)

getzonepath(1)

gigiplot(1B)

glob(1)

goto(1)

gprof(1)

graph(1)

grep(1)

groups(1)

groups(1B)

grpck(1B)

hash(1)

hashcheck(1)

hashmake(1)

hashstat(1)

head(1)

help(1)

helpdate(1)

helpgid(1)

helpint(1)

helpitem(1)

helppath(1)

helprange(1)

helpstr(1)

helptime(1)

helpuid(1)

helpyorn(1)

history(1)

hostid(1)

hostname(1)

hp7221plot(1B)

hpplot(1B)

i286(1)

i386(1)

i486(1)

i860(1)

iAPX286(1)

iconv(1)

idnconv(1)

if(1)

implot(1B)

indicator(1F)

indxbib(1)

install(1B)

ipcrm(1)

ipcs(1)

isainfo(1)

isalist(1)

jobs(1)

join(1)

jsh(1)

kbd(1)

kdestroy(1)

keylogin(1)

keylogout(1)

kill(1)

kinit(1)

klist(1)

kmdb(1)

kmfcfg(1)

kpasswd(1)

krb5-config(1)

ksh(1)

ktutil(1)

lari(1)

last(1)

lastcomm(1)

ld(1)

ld(1B)

ldap(1)

ldapadd(1)

ldapdelete(1)

ldaplist(1)

ldapmodify(1)

ldapmodrdn(1)

ldapsearch(1)

ldd(1)

ld.so.1(1)

let(1)

lex(1)

limit(1)

line(1)

lint(1B)

list_devices(1)

listusers(1)

llc2_autoconfig(1)

llc2_config(1)

llc2_stats(1)

ln(1)

ln(1B)

loadkeys(1)

locale(1)

localedef(1)

logger(1)

logger(1B)

login(1)

logname(1)

logout(1)

longline(1F)

look(1)

lookbib(1)

lorder(1)

lp(1)

lpc(1B)

lpq(1B)

lpr(1B)

lprm(1B)

lpstat(1)

lptest(1B)

ls(1)

ls(1B)

m4(1)

mac(1)

mach(1)

machid(1)

madv.so.1(1)

mail(1)

Mail(1B)

mail(1B)

mailcompat(1)

mailp(1)

mailq(1)

mailstats(1)

mailx(1)

make(1S)

man(1)

mconnect(1)

mcs(1)

mdb(1)

mesg(1)

message(1F)

mixerctl(1)

mkdir(1)

mkmsgs(1)

mkstr(1B)

mktemp(1)

moe(1)

more(1)

mp(1)

mpss.so.1(1)

msgfmt(1)

mt(1)

mv(1)

nawk(1)

nca(1)

ncab2clf(1)

ncakmod(1)

neqn(1)

newform(1)

newgrp(1)

news(1)

newsp(1)

newtask(1)

nice(1)

NIS+(1)

nis+(1)

nis(1)

niscat(1)

nischgrp(1)

nischmod(1)

nischown(1)

nischttl(1)

nisdefaults(1)

niserror(1)

nisgrep(1)

nisgrpadm(1)

nisln(1)

nisls(1)

nismatch(1)

nismkdir(1)

nisopaccess(1)

nispasswd(1)

nisrm(1)

nisrmdir(1)

nistbladm(1)

nistest(1)

nl(1)

nm(1)

nohup(1)

notify(1)

nroff(1)

od(1)

on(1)

onintr(1)

optisa(1)

pack(1)

page(1)

pagesize(1)

pargs(1)

passwd(1)

paste(1)

patch(1)

pathchk(1)

pathconv(1F)

pax(1)

pcat(1)

pcred(1)

pdp11(1)

perl(1)

pfcsh(1)

pfexec(1)

pfiles(1)

pfksh(1)

pflags(1)

pfsh(1)

pg(1)

pgrep(1)

pkginfo(1)

pkgmk(1)

pkgparam(1)

pkgproto(1)

pkgtrans(1)

pkill(1)

pktool(1)

plabel(1)

pldd(1)

plimit(1)

plot(1B)

plottoa(1B)

pmap(1)

popd(1)

postdaisy(1)

postdmd(1)

postio(1)

postmd(1)

postplot(1)

postprint(1)

postreverse(1)

posttek(1)

ppgsz(1)

ppriv(1)

pr(1)

praliases(1)

prctl(1)

preap(1)

prex(1)

print(1)

printenv(1B)

printf(1)

priocntl(1)

proc(1)

prof(1)

profiles(1)

projects(1)

prs(1)

prt(1)

prun(1)

ps(1)

ps(1B)

psig(1)

pstack(1)

pstop(1)

ptime(1)

ptree(1)

pushd(1)

pvs(1)

pwait(1)

pwd(1)

pwdx(1)

ranlib(1)

rcapstat(1)

rcp(1)

rdist(1)

read(1)

readfile(1F)

readonly(1)

red(1)

refer(1)

regcmp(1)

regex(1F)

rehash(1)

reinit(1F)

remote_shell(1)

remsh(1)

renice(1)

repeat(1)

reset(1B)

reset(1F)

return(1)

rksh(1)

rlogin(1)

rm(1)

rmail(1)

rmdel(1)

rmdir(1)

rmformat(1)

roffbib(1)

roles(1)

rpcgen(1)

rpm2cpio(1)

rsh(1)

run(1F)

runat(1)

rup(1)

rup(1C)

ruptime(1)

rusage(1B)

rusers(1)

rwho(1)

sact(1)

sag(1)

sar(1)

sccs(1)

sccs-admin(1)

sccs-cdc(1)

sccs-comb(1)

sccs-delta(1)

sccsdiff(1)

sccs-get(1)

sccs-help(1)

sccs-prs(1)

sccs-prt(1)

sccs-rmdel(1)

sccs-sact(1)

sccs-sccsdiff(1)

sccs-unget(1)

sccs-val(1)

scp(1)

script(1)

sdiff(1)

sed(1)

sed(1B)

select(1)

set(1)

set(1F)

setcolor(1F)

setenv(1)

setfacl(1)

setlabel(1)

setpgrp(1)

settime(1)

sftp(1)

sh(1)

shell(1F)

shell_builtins(1)

shift(1)

shutdown(1B)

size(1)

sleep(1)

snca(1)

snmpstatus(1)

soelim(1)

sort(1)

sortbib(1)

sotruss(1)

source(1)

sparc(1)

spell(1)

spellin(1)

spline(1)

split(1)

srchtxt(1)

ssh(1)

ssh-add(1)

ssh-agent(1)

ssh-http-proxy-connect(1)

ssh-keygen(1)

ssh-keyscan(1)

ssh-socks5-proxy-connect(1)

stop(1)

strchg(1)

strconf(1)

strings(1)

strip(1)

stty(1)

stty(1B)

sum(1)

sum(1B)

sun(1)

suspend(1)

svcprop(1)

svcs(1)

switch(1)

symorder(1)

sysV-make(1)

t300(1)

t300(1B)

t300s(1)

t300s(1B)

t4013(1B)

t4014(1)

t450(1)

t450(1B)

tabs(1)

tail(1)

talk(1)

tar(1)

tbl(1)

tcopy(1)

tee(1)

tek(1)

tek(1B)

telnet(1)

test(1)

test(1B)

test(1F)

tftp(1)

time(1)

timemanp(1)

times(1)

timesysp(1)

timex(1)

tip(1)

tnfdump(1)

tnfxtract(1)

touch(1)

touch(1B)

tplot(1)

tput(1)

tr(1)

tr(1B)

trap(1)

troff(1)

true(1)

truss(1)

tset(1B)

tsort(1)

tty(1)

type(1)

typeset(1)

u370(1)

u3b(1)

u3b15(1)

u3b2(1)

u3b5(1)

ucblinks(1B)

ul(1)

ulimit(1)

umask(1)

unalias(1)

uname(1)

uncompress(1)

unexpand(1)

unget(1)

unhash(1)

unifdef(1)

uniq(1)

units(1)

unix2dos(1)

unlimit(1)

unpack(1)

unset(1)

unset(1F)

unsetenv(1)

until(1)

uptime(1)

users(1B)

uucp(1C)

uudecode(1C)

uuencode(1C)

uuglist(1C)

uulog(1C)

uuname(1C)

uupick(1C)

uustat(1C)

uuto(1C)

uux(1C)

vacation(1)

val(1)

valdate(1)

valgid(1)

valint(1)

valpath(1)

valrange(1)

valstr(1)

valtime(1)

valuid(1)

valyorn(1)

vax(1)

vc(1)

vedit(1)

ver(1)

vgrind(1)

vi(1)

view(1)

vipw(1B)

volcancel(1)

volcheck(1)

volmissing(1)

volrmmount(1)

vplot(1B)

vsig(1F)

w(1)

wait(1)

wc(1)

what(1)

whatis(1)

whence(1)

whereis(1B)

which(1)

while(1)

who(1)

whoami(1B)

whocalls(1)

whois(1)

write(1)

xargs(1)

xgettext(1)

xstr(1)

yacc(1)

yes(1)

ypcat(1)

ypmatch(1)

yppasswd(1)

ypwhich(1)

zcat(1)

zlogin(1)

zonename(1)

crle

- configure runtime linking environment

Synopsis

crle  [-64] [-a name] [-A name] [-c conf] [-e env] [-E env]
 [-f flags] [-i name] [-I name] [-g name] [-G name] [-l dir]
 [-o dir] [-s dir] [-t [ ELF |  AOUT]] [-u] [-v]

Description

The crle utility provides for the creation and display of a runtime linking configuration file. The configuration file is read and interpreted by the runtime linker, ld.so.1(1), during process start-up. Without any arguments, or with just the -c option, crle displays configuration information. This information includes the contents of a configuration file, any system defaults and the command-line required to regenerate the configuration file. When used with any other options, a new configuration file is created or updated.

For 32-bit objects, the default configuration file is /var/ld/ld.config. For 64-bit objects, the default configuration file is /var/ld/64/ld.config.

When creating a new configuration file, first create the file in a temporary location. The environment variable LD_CONFIG can then be set to this new configuration file. This setting causes the new configuration to be used by the runtime linker instead of any default. After verification, the new configuration file can be moved to the default location if desired. At any time, the environment variable LD_NOCONFIG can be set to any value to instruct the runtime linker to ignore any configuration files. This setting can prove useful during experimentation.

A configuration file can contain the following information.

Default Search Paths

The runtime linker uses a prescribed search path for locating the dynamic dependencies of an object. This search path starts with the components of any LD_LIBRARY_PATH definition, followed by the components of an object's runpath. Finally, any default search paths specific to the object's type are used. This last component of the search path can be expressed within the configuration file. Typically, use of this facility should be augmented with any system defaults. See the -l option.

Trusted Directories

When processing a secure application, the runtime linker restricts the use of LD_LIBRARY_PATH and the directories from which preload and audit libraries can be used. This processing is restricted to known trusted directories. Trusted directories can be expressed within the configuration file. Typically, use of this facility should be augmented with any system defaults. See the -s option.

Directory Cache

The location of shared objects within defined directories can be maintained as a cache within the configuration file. This directory cache can reduce the overhead of searching for application dependencies.

Alternative Objects

In conjunction with the directory cache, shared objects can have alternative objects specified for use at runtime. These alternate objects, can be supplied by the user. Alternative objects can also be created by crle as copies of shared objects fixed to known memory locations. These fixed alternative objects can require less processing at runtime than their original shared object counterpart.

Environment Variables

Any environment variable interpreted by the runtime linker can be specified within the configuration file.

Defining alternative default search paths, or additional trusted directories can be useful for administrators who wish to install third party software in a central location, or otherwise alter the search path of applications that might not have been coded with suitable runpaths.

The declaration of alternative objects, provides a means of replacing dependencies other than by using symbolic links, or requiring LD_LIBRARY_PATH settings.

The declaration of environment variables that are interpreted by the runtime linker, provides a means of centralizing their definition for all applications.

The directory cache, and crle generated alternate objects, can provide a means of reducing the runtime start-up overhead of applications. Alternative objects can be useful for applications that require many dependencies, or whose dependencies are expensive to relocate. Shared objects that contain position-dependent code are often expensive to relocate.

When alternate objects that are generated by crle are specified within a configuration file, ld.so.1(1) performs some minimal consistency verification. The alternative objects are verified against their originating objects. This verification is intended to avert application failure should an applications configuration information become out-of-sync with the underlying system components. When this situation arises the flexibility offered by dynamic linking system components can be compromised. This type of application failure can be very difficult to diagnose. No verification of directory cache information is performed. Any changes to the directory structure are not seen by a process until the cache is rebuilt.

System shared objects are often well tuned, and can show little benefit from being cached. The directory cache and alternative object features are typically applicable to user applications and shared objects.

crle creates alternate objects for the shared objects that are discovered when using the -I and -G options, by calls to dldump(3C). The alternate object is created in the directory specified by the preceding -o option, or defaults to the directory in which the configuration file is created. The flags used for the dldump() are specified using the -f option, or default to RTLD_REL_RELATIVE.

Options

The following options are supported.

-64

Specify to process 64-bit objects, the default is 32-bit.

-a name

Create an alternative pathname for name. The alternative pathname is added to the configuration file.

The actual alternative file must be supplied by the user. Multiple occurrences of this option are permitted. If name is a directory, each shared object within the directory is added to the cache. If name does not exist, then name is marked in the cache as a nonexistent file.

Typically, this option is used with the -o option.

-A name

Create an optional alternative pathname for name. This alternative pathname is added to the configuration file.

This option mimics the -a option, except that if the alternative is unavailable at runtime, the original object name is used. This model mimics the use of auxiliary filters. See the Linker and Libraries Guide.

Typically, this option is used with the -o option.

-c conf

Specify to use the configuration file name conf. If this option is not supplied, the default configuration file is used.

-e env

Specify a replaceable environment variable, env. Only environment variables that are applicable to the runtime linker are meaningful. Multiple occurrences of this option are permitted. This option is similar to the -E option. However, the options differs in how configuration file definitions, and process environment definitions of the same name are resolved at runtime.

A definition established in a configuration file can be overridden by a process environment definition, or be suppressed by a null-value process environment definition.

In other words, these configuration file definitions can be replaced, or removed by the process environment at runtime.

-E env

Specify a permanent environment variable, env. Only environment variables that are applicable to the runtime linker are meaningful. Multiple occurrences of this option are permitted. This option is similar to the -e option. However, the option differs in how configuration file definitions, and process environment definitions of the same name are resolved at runtime.

Environment variable definitions that are meaningful to the runtime linker fall into one of two categories. Singular definitions are definitions such as LD_NOLAZYLOAD=1 and LD_DEBUG_OUTPUT=file. List definitions, which can take one or more values, are definitions such as LD_LIBRARY_PATH=path, and LD_DEBUG=files,details.

A singular definition that is established in a configuration file takes precedence over a process environment definition. A list definition that is established in a configuration file is appended to a process environment definition. Any definition that is established in a configuration file can not be suppressed by a null-value process environment definition.

In other words, these configuration file definitions can not be replaced, or removed by the process environment at runtime.

-f flags

Provide the symbolic flags argument to the dldump(3C) calls used to generate alternate objects. Any of the RTLD_REL flags that are defined in /usr/include/dlfcn.h can be used. Multiple flags can be or'ed together using the “|” character. In this case, the string should be quoted to avoid expansion by the shell. If no flags values are provided the default flag is RTLD_REL_RELATIVE.

-i name

Add an individual name to the configuration cache. Multiple occurrences of this option are permitted. name can be a shared object or a directory. If name is a directory, each shared object within the directory is added to the cache. If name does not exist, the name is marked in the cache as a nonexistent directory.

-I name

Mimic the -i, and in addition any shared object that is processed has an alternative created using dldump(3C). If the -f flag contains RTLD_REL_EXEC, then name can be a dynamic executable, for which an alternative is created. Only one dynamic executable can be specified in this manner, as the cache that is created is specific to this application.

-g name

Add the group name to the configuration cache. Each object is expanded to determine its dependencies. Multiple occurrences of this option are permitted. name can be a dynamic executable, shared object or a directory. If name is a shared object, the shared object and its dependencies are added to the cache. If name is a directory, each shared object within the directory, and its dependencies, are added to the cache.

-G name

Mimic the -g option, and in addition any shared object that is processed has an alternative created using dldump(3C). If name is a dynamic executable, and the -f flag contains RTLD_REL_EXEC, then an alternative for the dynamic executable is also created. Only one dynamic executable can be specified in this manner as the cache that is created is specific to this application.

-l dir

Specify a new default search directory dir for ELF or AOUT objects. Multiple occurrences of this option are permitted. The type of object that is applicable to the search, is specified by the preceding -t option, or defaults to ELF.

The default search paths for 32-bit ELF objects are /lib followed by /usr/lib. For 64-bit ELF objects, the default search paths are /lib/64 followed by /usr/lib/64.

The default search paths for AOUT objects are /usr/4lib, followed by /usr/lib and finally /usr/local/lib.

Use of this option replaces the default search path. Therefore, a -l option is normally required to specify the original system default in relation to any new paths that are being applied. However, if the -u option is in effect, and a configuration file does not exist, the system defaults are added to the new configuration file. These defaults are added before the new paths specified with the -l option.

-o dir

When used with either the -a or -A options, specifies the directory dir in which any alternate objects exist. When alternative objects are created by crle, this option specified where the alternative are created. Without this option, alternate objects exist in the directory in which the configuration file is created. Multiple occurrences of this option are permitted, the directory dir being used to locate alternatives for any following command-line options. Alternative objects are not permitted to override their associated originals.

Typically, this option is used with the -a or -A options.

-s dir

Specify a new trusted directory dir for secure ELF or AOUT objects. See SECURITY in ld.so.1(1) for a definition of secure objects.

Multiple occurrences of this option are permitted. The type of object that is applicable to the search is specified by the preceding -t option, or defaults to ELF.

The default trusted directories for secure 32-bit ELF objects are /lib/secure followed by /usr/lib/secure. For 64-bit secure ELF objects, the default trusted directories are /lib/secure/64 followed by /usr/lib/secure/64.

The default trusted directories for secure AOUT objects are /usr/4lib, followed by /usr/lib, followed by /usr/ucblib, and finally /usr/local/lib.

Use of this option replaces the default trusted directories. Therefore, a -s option is normally required to specify the original system default in relation to any new directories that are being applied. However, if the -u option is in effect, and a configuration file does not exist, the system defaults are added to the new configuration file. These defaults are added before the new directories specified with the -l option.

-t ELF | AOUT

Toggle the object type that is applicable to any -l or -s options that follow. The default object type is ELF.

-u

Request that a configuration file be updated, possibly with the addition of new information. Without other options, any existing configuration file is inspected and its contents recomputed. Additional arguments allow information to be appended to the recomputed contents. See NOTES.

If a configuration file does not exist, the configuration file is created as directed by the other arguments. In the case of the -l and -s options, any system defaults are first applied to the configuration file before the directories specified with these options.

-v

Specify verbose mode. When creating a configuration file, a trace of the files that are being processed is written to the standard out. When printing the contents of a configuration file, more extensive directory and file information is provided.

By default, the runtime linker attempts to read the configuration file /var/ld/ld.config for each 32-bit application processesed. /var/ld/64/ld.config is read for each 64-bit application. When processing an alternative application, the runtime linker uses a $ORIGIN/ld.config.app-name configuration file if present. See NOTES. Applications can reference an alternative configuration file by setting the LD_CONFIG environment variable. See ld.so.1(1). An alternative configuration file can also be specified by recording the configuration file name in the application at the time the application is built. See the -c option of ld(1).

Examples

Example 1 Updating and Displaying a New Default Search Path for ELF Objects

The following example updates and displays a new default search path for ELF objects:

example% crle -u -l /local/lib
example% crle



Configuration file [version 4]: /var/ld/ld.config
  Default Library Path (ELF):  /lib:/usr/lib:/local/lib
  Trusted Directories (ELF):   /lib/secure:/usr/lib/secure (system default)

Command line:
  crle -l /lib:/usr/lib:/local/lib



example% crle -u -l /usr/local/lib
example% crle

Configuration file [version 4]: /var/ld/ld.config
  Default Library Path (ELF):  /lib:/usr/lib:/local/lib:/usr/local/lib
  Trusted Directories (ELF):   /lib/secure:/usr/lib/secure (system default)

Command line:
  crle -l /lib:/usr/lib:/local/lib:/usr/local/lib

In this example, the default configuration file initially did not exist. Therefore, the new search path /local/lib is appended to the system default. The next update appends the search path /usr/local/lib to those paths already established in the configuration file.

Example 2 Creating and Displaying a New Default Search Path and New Trusted Directory for ELF Objects

The following example creates and displays a new default search path and new trusted directory for ELF objects:

example% crle -l /local/lib -l /lib -l /usr/lib -s /local/lib
example% crle

Configuration file [version 4]: /var/ld/ld.config
  Default Library Path (ELF):  /local/lib:/lib:/usr/lib
  Trusted Directories (ELF):   /local/lib

Command line:
  crle -l /local/lib:/lib:/usr/lib -s /local/lib

With this configuration, third party applications could be installed in /local/bin and their associated dependencies in /local/lib. The default search path allows the applications to locate their dependencies without the need to set LD_LIBRARY_PATH. The default trusted directories have also been replaced with this example.

Example 3 Creating a Directory Cache for ELF Objects

The following example creates a directory cache for ELF objects:

example% crle -i /usr/dt/lib -i /usr/openwin/lib -i /lib -i /usr/lib \
        -c config
example% ldd -s ./main
....
   find object=libc.so.1; required by ./main
    search path=/usr/dt/lib:/usr/openwin/lib  (RPATH ./main)
    trying path=/usr/dt/lib/libc.so.1
    trying path=/usr/openwin/lib/libc.so.1
    search path=/lib  (default)
    trying path=/lib/libc.so.1
        libc.so.1 =>     /lib/libc.so.1

example% LD_CONFIG=config ldd -s ./main
....
   find object=libc.so.1; required by ./main
    search path=/usr/dt/lib:/usr/openwin/lib  (RPATH ./main)
    search path=/lib  (default)
    trying path=/lib/libc.so.1
        libc.so.1 =>     /lib/libc.so.1

With this configuration, the cache reflects that the system library libc.so.1 does not exist in the directories /usr/dt/lib or /usr/openwin/lib. Therefore, the search for this system file ignores these directories even though the application's runpath indicates these paths should be searched.

Example 4 Creating an Alternative Object Cache for an ELF Executable

The following example creates an alternative object cache for an ELF executable:

example% crle -c /local/$HOST/.xterm/ld.config.xterm \
        -f RTLD_REL_ALL  -G /usr/openwin/bin/xterm
example% ln  -s /local/$HOST/.xterm/xterm  /local/$HOST/xterm
example% ldd /usr/local/$HOST/xterm
    libXaw.so.5 =>  /local/$HOST/.xterm/libWaw.so.5  (alternate)
    libXmu.so.4 =>  /local/$HOST/.xterm/libXmu.so.4  (alternate)
    ....
    libc.so.1 =>    /local/$HOST/.xterm/libc.so.1  (alternate)
    ....

With this configuration, a new xterm and its dependencies are created. These new objects are fully relocated to each other, and result in faster start-up than the originating objects. The execution of this application uses its own specific configuration file. This model is generally more flexible than using the environment variable LD_CONFIG, as the configuration file can not be erroneously used by other applications such as ldd(1) or truss(1).

Example 5 Creating an Alternative Object Cache to Replace an ELF Shared Object

The following example creates an alternative object cache to replace an ELF shared object:

example% ldd /usr/bin/vi
    libcurses.so.1 =>  /lib/libcurses.so.1
    ....

example% crle -a /lib/libcurses.so.1 -o /usr/ucblib
example% crle

Configuration file [version 4]: /var/ld/ld.config
  Default Library Path (ELF):  /lib:/usr/lib  (system default)
  Trusted Directories (ELF):   /lib/secure:/usr/lib/secure (system default)

Directory: /lib
  libcurses.so.1  (alternate: /usr/ucblib/libcurses.so.1)
....

example% ldd /usr/bin/vi
    libcurses.so.1 => /usr/ucblib/libcurses.so.1 (alternate)
    ....

With this configuration, any dependency that would normally resolve to /usr/lib/libcurses.so.1 instead resolves to /usr/ucblib/libcurses.so.1.

Example 6 Setting Replaceable and Permanent Environment Variables

The following example sets replaceable and permanent environment variables:

example% crle -e LD_LIBRARY_PATH=/local/lib \
        -E LD_PRELOAD=preload.so.1
example% crle
.....
Environment Variables:
  LD_LIBRARY_PATH=/local/lib  (replaceable)
  LD_PRELOAD=preload.so.1  (permanent)

.....
example% LD_DEBUG=files LD_PRELOAD=preload.so.2 ./main
.....
18764: file=preload.so.2;  preloaded
18764: file=/local/lib/preload.so.2  [ ELF ]; generating link map
.....
18764: file=preload.so.1;  preloaded
18764: file=/local/lib/preload.so.1  [ ELF ]; generating link map
.....

With this configuration file, a replaceable search path has been specified together with a permanent preload object which becomes appended to the process environment definition.

Exit Status

The creation or display of a configuration file results in a 0 being returned. Otherwise, any error condition is accompanied with a diagnostic message and a non-zero value being returned.

Notes

The ability to tag an alternative application to use an application-specific configuration file, is possible if the original application contains one of the .dynamic tags DT_FLAGS_1 or DT_FEATURE_1. Without these entries, a configuration file must be specified using the LD_CONFIG environment variable. Care should be exercised with this latter method as this environment variable is visible to any forked applications.

The use of the -u option requires at least version 2 of crle. This version level is evident from displaying the contents of a configuration file:

example% crle

Configuration file [2]: /var/ld/ld.config
  ......

With a version 2 configuration file, crle is capable of constructing the command-line arguments required to regenerate the configuration file. This command-line construction, provides full update capabilities using the -u option. Although a version 1 configuration file update is possible, the configuration file contents might be insufficient for crle to compute the entire update requirements.

Files

/var/ld/ld.config

Default configuration file for 32-bit applications.

/var/ld/64/ld.config

Default configuration file for 64-bit applications.

/var/tmp

Default location for temporary configuration file. See tempnam(3C).

/usr/lib/lddstub

Stub application that is employed to dldump(3C) 32-bit objects.

/usr/lib/64/lddstub

Stub application that is employed to dldump(3C) 64-bit objects.

/usr/lib/libcrle.so.1

Audit library that is employed to dldump(3C) 32-bit objects.

/usr/lib/64/libcrle.so.1

Audit library that is employed to dldump(3C) 64-bit objects.

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
SUNWtoo
Interface Stability
Stable

See Also

ld(1), ld.so.1(1), dldump(3C), tempnam(3C), attributes(5)

Linker and Libraries Guide