Print this page
9842 man page typos and spelling
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man1/crle.1.man.txt
+++ new/usr/src/man/man1/crle.1.man.txt
1 1 CRLE(1) User Commands CRLE(1)
2 2
3 3
4 4
5 5 NAME
6 6 crle - configure runtime linking environment
7 7
8 8 SYNOPSIS
9 9 crle [-64] [-a name] [-A name] [-c conf] [-e env] [-E env]
10 10 [-f flags] [-i name] [-I name] [-g name] [-G name]
11 11 [-l dir] [-o dir] [-s dir] [-t [ ELF | AOUT]] [-u] [-v]
12 12
13 13
14 14 DESCRIPTION
15 15 The crle utility provides for the creation and display of a runtime
16 16 linking configuration file. The configuration file is read and
17 17 interpreted by the runtime linker, ld.so.1(1), during process startup.
18 18 The runtime linker attempts to read a default configuration file for
19 19 all processes. For 32-bit processes, the default configuration file is
20 20 /var/ld/ld.config. For 64-bit processes, the default configuration
21 21 file is /var/ld/64/ld.config.
22 22
23 23
24 24 Without any arguments, or with just the -c option, crle displays
25 25 configuration information. This information includes the contents of a
26 26 configuration file, any system defaults and the command-line required
27 27 to regenerate the configuration file. When used with any other options,
28 28 a new configuration file is created or updated.
29 29
30 30
31 31 The runtime linker can also be directed to an alternative configuration
32 32 file by setting one of the LD_CONFIG family of environment variable.
33 33 LD_CONFIG applies to both 32-bit and 64-bit programs. Since 32-bit and
34 34 64-bit configuration files differ, a single configuration file cannot
35 35 be used for both class of object. Hence, LD_CONFIG can adversely affect
36 36 program execution in cases where a program of one class executes a
37 37 program of the other class. In particular, it is common practice for
↓ open down ↓ |
37 lines elided |
↑ open up ↑ |
38 38 the 32-bit version of standard Solaris utilities to execute their
39 39 64-bit counterpart. LD_CONFIG cannot be successfully used in this case.
40 40 Therefore, the use of the LD_CONFIG_32 and LD_CONFIG_64 environment
41 41 variables, that precisely target the appropriate class of process, is
42 42 recommended.
43 43
44 44
45 45 Creating an incorrect configuration file in the standard location,
46 46 /var/ld, can prevent programs from running, and can therefore be
47 47 difficult to recover from. To guard against this situation, it is
48 - recommented that new configuration files first be created in a
48 + recommended that new configuration files first be created in a
49 49 temporary location. Then set the appropriate LD_CONFIG environment
50 50 variable to this new configuration file. This setting causes the new
51 51 configuration file to be used by the runtime linker instead of any
52 52 default. After verification, the new configuration file can be moved to
53 53 the default location if desired. At any time, the environment variable
54 54 LD_NOCONFIG can be set to any value to instruct the runtime linker to
55 55 ignore any configuration files. This setting can prove useful during
56 56 experimentation.
57 57
58 58
59 59 A configuration file can contain the following information.
60 60
61 61 Default Search Paths
62 62
63 63 The runtime linker uses a prescribed search path for locating the
64 64 dynamic dependencies of an object. This search path starts with the
65 65 components of any LD_LIBRARY_PATH definition, followed by the
66 66 components of an object's runpath. Finally, any default search
67 67 paths specific to the object's class are used. This last component
68 68 of the search path can be expressed within the configuration file.
69 69 Typically, use of this facility should be augmented with any system
70 70 default. See the -l and -u options.
71 71
72 72
73 73 Trusted Directories
74 74
75 75 When processing a secure application, the runtime linker restricts
76 76 the use of LD_LIBRARY_PATH searches, and $ORIGIN token expansion.
77 77 See Security in Linker and Libraries Guide. In addition, the
78 78 directories from which preload and audit libraries can be located
79 79 are also restricted. The path names that are associated with
80 80 preload and audit libraries are restricted to known trusted
81 81 directories. Trusted directories can be expressed within the
82 82 configuration file. Typically, use of this facility should be
83 83 augmented with any system defaults. See the -s and -u options.
84 84
85 85
86 86 Environment Variables
87 87
88 88 Any environment variable interpreted by the runtime linker can be
89 89 specified within the configuration file.
90 90
91 91
92 92 Directory Cache
93 93
94 94 The location of shared objects within defined directories can be
95 95 maintained as a cache within the configuration file. This directory
96 96 cache can reduce the overhead of searching for application
97 97 dependencies.
98 98
99 99
100 100 Alternative Objects
101 101
102 102 In conjunction with the directory cache, shared objects can have
103 103 alternative objects specified for use at runtime. These alternate
104 104 objects, can be supplied by the user. Alternative objects can also
105 105 be created by crle as copies of shared objects fixed to known
106 106 memory locations. These fixed alternative objects can require less
107 107 processing at runtime than their original shared object
108 108 counterpart.
109 109
110 110
111 111
112 112 Defining additional default search paths, or additional trusted
113 113 directories can be useful for administrators who wish to install third
114 114 party software in a central location, or otherwise alter the search
115 115 path of applications that might not have been coded with a suitable
116 116 runpath.
117 117
118 118
119 119 The declaration of alternative objects provides a means of replacing
120 120 dependencies other than by using symbolic links or requiring
121 121 LD_LIBRARY_PATH settings.
122 122
123 123
124 124 The declaration of environment variables that are interpreted by the
125 125 runtime linker provides a means of centralizing their definition for
126 126 all applications.
127 127
128 128
129 129 The directory cache, and crle generated alternate objects, can provide
130 130 a means of reducing the runtime startup overhead of applications.
131 131 Alternative objects can be useful for applications that require many
132 132 dependencies, or whose dependencies are expensive to relocate. Shared
133 133 objects that contain position-dependent code are often expensive to
134 134 relocate. Note, the system has many caching facilities that help
135 135 mitigate expenses such as negative path lookups, and thus employing
136 136 crle to create a directory cache may have minimal effect other than for
137 137 some very specific cases.
138 138
139 139
140 140 When alternate objects that are generated by crle are specified within
141 141 a configuration file, the runtime linker performs some minimal
142 142 consistency verification. The alternative objects are verified against
143 143 their originating objects. This verification is intended to avert
144 144 application failure should an applications configuration information
145 145 become out-of-sync with the underlying system components. When this
146 146 situation arises the flexibility offered by dynamic linking system
147 147 components can be compromised. This type of application failure can be
148 148 very difficult to diagnose. No verification of directory cache
149 149 information is performed. Any changes to the directory structure are
150 150 not seen by a process until the cache is rebuilt.
151 151
152 152
153 153 System shared objects are often well tuned, and can show little benefit
154 154 from being cached. The directory cache and alternative object features
155 155 are typically applicable to user applications and shared objects, and
156 156 may only show improvement in some very specific cases.
157 157
158 158
159 159 crle creates alternate objects for the shared objects that are
160 160 discovered when using the -I and -G options, using dldump(3C). The
161 161 alternate object is created in the directory specified by the preceding
162 162 -o option, or defaults to the directory in which the configuration file
163 163 is created. The flags used by dldump() are specified using the -f
164 164 option, or default to RTLD_REL_RELATIVE.
165 165
166 166 OPTIONS
167 167 The following options are supported.
168 168
169 169 -64
170 170
171 171 Specify to process 64-bit objects, the default is 32-bit. Use -64
172 172 to create a 64-bit specific configuration file.
173 173
174 174
175 175 -a name
176 176
177 177 Create an alternative path name for name. The alternative path name
178 178 is added to the configuration file.
179 179
180 180 The actual alternative file must be supplied by the user. Multiple
181 181 occurrences of this option are permitted. If name is a directory,
182 182 each shared object within the directory is added to the cache. If
183 183 name does not exist, then name is marked in the cache as a
184 184 nonexistent file.
185 185
186 186 Typically, this option is used with the -o option.
187 187
188 188
189 189 -A name
190 190
191 191 Create an optional alternative path name for name. This alternative
192 192 path name is added to the configuration file.
193 193
194 194 This option mimics the -a option, except that if the alternative is
195 195 unavailable at runtime, the original object name is used. This
196 196 model mimics the use of auxiliary filters. See Generating Auxiliary
197 197 Filters in Linker and Libraries Guide.
198 198
199 199 Typically, this option is used with the -o option.
200 200
201 201
202 202 -c conf
203 203
204 204 Specify to use the configuration file name conf. If this option is
205 205 not supplied, the default configuration file is used.
206 206
207 207
208 208 -e env
209 209
210 210 Specify a replaceable environment variable, env. Only environment
211 211 variables that are applicable to the runtime linker are meaningful.
212 212 Multiple occurrences of this option are permitted. This option is
213 213 similar to the -E option. However, the options differs in how
214 214 configuration file definitions, and process environment definitions
215 215 of the same name are resolved at runtime.
216 216
217 217 A definition established in a configuration file can be overridden
218 218 by a process environment definition, or be suppressed by a null-
219 219 value process environment definition.
220 220
221 221 In other words, these configuration file definitions can be
222 222 replaced, or removed by the process environment at runtime.
223 223
224 224
225 225 -E env
226 226
227 227 Specify a permanent environment variable, env. Only environment
228 228 variables that are applicable to the runtime linker are meaningful.
229 229 Multiple occurrences of this option are permitted. This option is
230 230 similar to the -e option. However, the option differs in how
231 231 configuration file definitions, and process environment definitions
232 232 of the same name are resolved at runtime.
233 233
234 234 Environment variable definitions that are meaningful to the runtime
235 235 linker fall into one of two categories. Singular definitions are
236 236 definitions such as LD_NOLAZYLOAD=1 and LD_DEBUG_OUTPUT=file. List
237 237 definitions, which can take one or more values, are definitions
238 238 such as LD_LIBRARY_PATH=path, and LD_DEBUG=files,details.
239 239
240 240 A singular definition that is established in a configuration file
241 241 takes precedence over a process environment definition. A list
242 242 definition that is established in a configuration file is appended
243 243 to a process environment definition. Any definition that is
244 244 established in a configuration file can not be suppressed by a
245 245 null-value process environment definition.
246 246
247 247 In other words, these configuration file definitions can not be
248 248 replaced, or removed by the process environment at runtime.
249 249
250 250
251 251 -f flags
252 252
253 253 Provide the symbolic flags argument to the dldump(3C) calls used to
254 254 generate alternate objects. Any of the RTLD_REL flags that are
255 255 defined in /usr/include/dlfcn.h can be used. Multiple flags can be
256 256 or'ed together using the "|" character. In this case, the string
257 257 should be quoted to avoid expansion by the shell. If no flags
258 258 values are provided the default flag is RTLD_REL_RELATIVE.
259 259
260 260
261 261 -i name
262 262
263 263 Add an individual name to the configuration cache. Multiple
264 264 occurrences of this option are permitted. name can be a shared
265 265 object or a directory. If name is a directory, each shared object
266 266 within the directory is added to the cache. If name does not exist,
267 267 the name is marked in the cache as a nonexistent directory.
268 268
269 269
270 270 -I name
271 271
272 272 Mimic the -i, and in addition any shared object that is processed
273 273 has an alternative created using dldump(3C). If the -f flag
274 274 contains RTLD_REL_EXEC, then name can be a dynamic executable, for
275 275 which an alternative is created. Only one dynamic executable can be
276 276 specified in this manner, as the cache that is created is specific
277 277 to this application.
278 278
279 279
280 280 -g name
281 281
282 282 Add the group name to the configuration cache. Each object is
283 283 expanded to determine its dependencies. Multiple occurrences of
284 284 this option are permitted. name can be a dynamic executable,
285 285 shared object or a directory. If name is a shared object, the
286 286 shared object and its dependencies are added to the cache. If name
287 287 is a directory, each shared object within the directory, and its
288 288 dependencies, are added to the cache.
289 289
290 290
291 291 -G name
292 292
293 293 Mimic the -g option, and in addition any shared object that is
294 294 processed has an alternative created using dldump(3C). If name is a
295 295 dynamic executable, and the -f flag contains RTLD_REL_EXEC, then an
296 296 alternative for the dynamic executable is also created. Only one
297 297 dynamic executable can be specified in this manner as the cache
298 298 that is created is specific to this application.
299 299
300 300
301 301 -l dir
302 302
303 303 Specify a new default search directory dir for ELF or AOUT objects.
304 304 Multiple occurrences of this option are permitted. The type of
305 305 object that is applicable to the search, is specified by the
306 306 preceding -t option, or defaults to ELF.
307 307
308 308 The default search paths for 32-bit ELF objects are /lib followed
309 309 by /usr/lib. For 64-bit ELF objects, the default search paths are
310 310 /lib/64 followed by /usr/lib/64.
311 311
312 312 The default search paths for AOUT objects are /usr/4lib, followed
313 313 by /usr/lib and finally /usr/local/lib.
314 314
315 315 Use of this option replaces the default search path. Therefore, a
316 316 -l option is normally required to specify the original system
317 317 default in relation to any new paths that are being applied.
318 318 However, if the -u option is in effect, and a configuration file
319 319 does not exist, the system defaults are added to the new
320 320 configuration file. These defaults are added before the new paths
321 321 specified with the -l option.
322 322
323 323
324 324 -o dir
325 325
326 326 When used with either the -a or -A options, specifies the directory
327 327 dir in which any alternate objects exist. When alternative objects
328 328 are created by crle, this option specified where the alternative
329 329 are created. Without this option, alternate objects exist in the
330 330 directory in which the configuration file is created. Multiple
331 331 occurrences of this option are permitted, the directory dir being
332 332 used to locate alternatives for any following command-line options.
333 333 Alternative objects are not permitted to override their associated
334 334 originals.
335 335
336 336 Typically, this option is used with the -a or -A options.
337 337
338 338
339 339 -s dir
340 340
341 341 Specify a new trusted directory dir for secure ELF or AOUT objects.
342 342 See SECURITY in ld.so.1(1) for a definition of secure objects. See
343 343 Security in Linker and Libraries Guide for a discussion of runtime
344 344 restrictions imposed on secure applications.
345 345
346 346 Multiple occurrences of this option are permitted. The type of
347 347 object that is applicable to the search is specified by the
348 348 preceding -t option, or defaults to ELF.
349 349
350 350 The default trusted directories for secure 32-bit ELF objects, and
351 351 AOUT objects, are /lib/secure followed by /usr/lib/secure. For
352 352 64-bit secure ELF objects, the default trusted directories are
353 353 /lib/secure/64 followed by /usr/lib/secure/64.
354 354
355 355 Use of this option replaces the default trusted directories.
356 356 Therefore, a -s option is normally required to specify the original
357 357 system default in relation to any new directories that are being
358 358 applied. However, if the -u option is in effect, and a
359 359 configuration file does not exist, the system defaults are added to
360 360 the new configuration file. These defaults are added before the new
361 361 directories specified with the -l option.
362 362
363 363
364 364 -t ELF | AOUT
365 365
366 366 Toggle the object type that is applicable to any -l or -s options
367 367 that follow. The default object type is ELF.
368 368
369 369
370 370 -u
371 371
372 372 Request that a configuration file be updated, possibly with the
373 373 addition of new information. Without other options, any existing
374 374 configuration file is inspected and its contents recomputed.
375 375 Additional arguments allow information to be appended to the
376 376 recomputed contents. See NOTES.
377 377
378 378 If a configuration file does not exist, the configuration file is
379 379 created as directed by the other arguments. In the case of the -l
380 380 and -s options, any system defaults are first applied to the
381 381 configuration file before the directories specified with these
382 382 options.
383 383
384 384 The configuration file can be in the older format that lacks the
385 385 system identification information that is normally written at the
386 386 beginning of the file. In this case, crle does not place system
387 387 identification information into the resulting file, preserving
388 388 compatibility of the file with older versions of Solaris. See
389 389 NOTES.
390 390
391 391
392 392 -v
393 393
394 394 Specify verbose mode. When creating a configuration file, a trace
395 395 of the files that are being processed is written to the standard
396 396 out. When printing the contents of a configuration file, more
397 397 extensive directory and file information is provided.
398 398
399 399
400 400
401 401 By default, the runtime linker attempts to read the configuration file
402 402 /var/ld/ld.config for each 32-bit application processed.
403 403 /var/ld/64/ld.config is read for each 64-bit application. When
404 404 processing an alternative application, the runtime linker uses a
405 405 $ORIGIN/ld.config.app-name configuration file if present. See NOTES.
406 406 Applications can reference an alternative configuration file by setting
407 407 the LD_CONFIG environment variable. An alternative configuration file
408 408 can also be specified by recording the configuration file name in the
409 409 application at the time the application is built. See the -c option of
410 410 ld(1).
411 411
412 412 EXAMPLES
413 413 Example 1 Experimenting With a Temporary Configuration File
414 414
415 415
416 416 The following example creates a temporary configuration file with a new
417 417 default search path for ELF objects. The environment variable
418 418 LD_CONFIG_32 is used to instruct the runtime linker to use this
419 419 configuration file for all 32-bit processes.
420 420
421 421
422 422 $ crle -c /tmp/ld.config -u -l /local/lib
423 423 $ crle -c /tmp/ld.config
424 424
425 425 Configuration file [version 4]: /tmp/ld.config
426 426 Platform: 32-bit MSB SPARC
427 427 Default Library Path (ELF): /lib:/usr/lib:/local/lib
428 428 Trusted Directories (ELF): /lib/secure:/usr/lib/secure \
429 429 (system default)
430 430
431 431 Command line:
432 432 crle -c /tmp/ld.config -l /lib:/usr/lib:/local/lib
433 433
434 434 $ LD_CONFIG_32=/tmp/ld.config date
435 435 Thu May 29 17:42:00 PDT 2008
436 436
437 437
438 438
439 439 Example 2 Updating and Displaying a New Default Search Path for ELF
440 440 Objects
441 441
442 442
443 443 The following example updates and displays a new default search path
444 444 for ELF objects.
445 445
446 446
447 447 # crle -u -l /local/lib
448 448 # crle
449 449
450 450 Configuration file [version 4]: /var/ld/ld.config
451 451 Platform: 32-bit MSB SPARC
452 452 Default Library Path (ELF): /lib:/usr/lib:/local/lib
453 453 Trusted Directories (ELF): /lib/secure:/usr/lib/secure \
454 454 (system default)
455 455
456 456 Command line:
457 457 crle -l /lib:/usr/lib:/local/lib
458 458
459 459 # crle -u -l /ISV/lib
460 460 # crle
461 461
462 462 Configuration file [version 4]: /var/ld/ld.config
463 463 Platform 32-bit MSB SPARC
464 464 Default Library Path (ELF): /lib:/usr/lib:/local/lib:/ISV/lib
465 465 Trusted Directories (ELF): /lib/secure:/usr/lib/secure \
466 466 (system default)
467 467
468 468 Command line:
469 469 crle -l /lib:/usr/lib:/local/lib:/usr/local/lib
470 470
471 471
472 472
473 473
474 474 In this example, the default configuration file initially did not
475 475 exist. Therefore, the new search path /local/lib is appended to the
476 476 system default. The next update appends the search path /ISV/lib to
477 477 those paths already established in the configuration file.
478 478
479 479
480 480 Example 3 Recovering From a Bad Configuration File
481 481
482 482
483 483 The following example creates a bad configuration file in the default
484 484 location. The file can be removed by instructing the runtime linker to
485 485 ignore any configuration file with the LD_NOCONFIG environment
486 486 variable. Note, it is recommended that temporary configuration files be
487 487 created and the environment variable LD_CONFIG used to experiment with
488 488 these files.
489 489
490 490
491 491 # crle -l /local/lib
492 492 # date
493 493 ld.so.1: date: fatal: libc.so.1: open failed: \
494 494 No such file or directory
495 495 Killed
496 496 # LD_NOCONFIG=yes rm /var/ld/ld.config
497 497 # date
498 498 Thu May 29 17:52:00 PDT 2008
499 499
500 500
501 501
502 502
503 503 Note, the reason the configuration file is bad is because the system
504 504 default search paths are not present. Hence, the date utility is not
505 505 able to locate the system dependencies that it required. In this case,
506 506 the -u option should have been used.
507 507
508 508 Example 4 Creating and Displaying a New Default Search Path and New
509 509 Trusted Directory for ELF Objects
510 510
511 511
512 512 The following example creates and displays a new default search path
513 513 and new trusted directory for ELF objects.
514 514
515 515
516 516 # crle -l /local/lib -l /lib -l /usr/lib -s /local/lib
517 517 # crle
518 518
519 519 Configuration file [version 4]: /var/ld/ld.config
520 520 Platform: 32-bit MSB SPARC
521 521 Default Library Path (ELF): /local/lib:/lib:/usr/lib
522 522 Trusted Directories (ELF): /local/lib
523 523
524 524 Command line:
525 525 crle -l /local/lib:/lib:/usr/lib -s /local/lib
526 526
527 527
528 528
529 529
530 530 With this configuration file, third party applications could be
531 531 installed in /local/bin and their associated dependencies in
532 532 /local/lib. The default search path allows the applications to locate
533 533 their dependencies without the need to set LD_LIBRARY_PATH. The default
534 534 trusted directories have also been replaced with this example.
535 535
536 536
537 537 Example 5 Creating a Directory Cache for ELF Objects
538 538
539 539
540 540 The following example creates a directory cache for ELF objects.
541 541
542 542
543 543 $ crle -i /usr/dt/lib -i /usr/openwin/lib -i /lib -i /usr/lib \
544 544 -c config
545 545 $ ldd -s ./main
546 546 ....
547 547 find object=libc.so.1; required by ./main
548 548 search path=/usr/dt/lib:/usr/openwin/lib (RUNPATH/RPATH ./main)
549 549 trying path=/usr/dt/lib/libc.so.1
550 550 trying path=/usr/openwin/lib/libc.so.1
551 551 search path=/lib (default)
552 552 trying path=/lib/libc.so.1
553 553 libc.so.1 => /lib/libc.so.1
554 554
555 555 $ LD_CONFIG=config ldd -s ./main
556 556 ....
557 557 find object=libc.so.1; required by ./main
558 558 search path=/usr/dt/lib:/usr/openwin/lib (RUNPATH/RPATH ./main)
559 559 search path=/lib (default)
560 560 trying path=/lib/libc.so.1
561 561 libc.so.1 => /lib/libc.so.1
562 562
563 563
564 564
565 565
566 566 With this configuration, the cache reflects that the system library
567 567 libc.so.1 does not exist in the directories /usr/dt/lib or
568 568 /usr/openwin/lib. Therefore, the search for this system file ignores
569 569 these directories even though the application's runpath indicates these
570 570 paths should be searched.
571 571
572 572
573 573 Example 6 Creating an Alternative Object Cache for an ELF Executable
574 574
575 575
576 576 The following example creates an alternative object cache for an ELF
577 577 executable.
578 578
579 579
580 580 $ crle -c /local/$HOST/.xterm/ld.config.xterm \
581 581 -f RTLD_REL_ALL -G /usr/openwin/bin/xterm
582 582 $ ln -s /local/$HOST/.xterm/xterm /local/$HOST/xterm
583 583 $ ldd /usr/local/$HOST/xterm
584 584 libXaw.so.5 => /local/$HOST/.xterm/libWaw.so.5 (alternate)
585 585 libXmu.so.4 => /local/$HOST/.xterm/libXmu.so.4 (alternate)
586 586 ....
587 587 libc.so.1 => /local/$HOST/.xterm/libc.so.1 (alternate)
588 588 ....
589 589
590 590
591 591
592 592
593 593 With this configuration, a new xterm and its dependencies are created.
594 594 These new objects are fully relocated to each other, and result in
595 595 faster startup than the originating objects. The execution of this
596 596 application uses its own specific configuration file. This model is
597 597 generally more flexible than using the environment variable LD_CONFIG,
598 598 as the configuration file can not be erroneously used by other
599 599 applications such as ldd(1) or truss(1).
600 600
601 601
602 602 Example 7 Creating an Alternative Object Cache to Replace an ELF Shared
603 603 Object
604 604
605 605
606 606 The following example creates an alternative object cache to replace an
607 607 ELF shared object.
608 608
609 609
610 610 $ ldd /usr/bin/vi
611 611 libcurses.so.1 => /lib/libcurses.so.1
612 612 ....
613 613
614 614 # crle -a /lib/libcurses.so.1 -o /usr/ucblib
615 615 # crle
616 616
617 617 Configuration file [version 4]: /var/ld/ld.config
618 618 Platform: 32-bit MSB SPARC
619 619 Default Library Path (ELF): /lib:/usr/lib (system default)
620 620 Trusted Directories (ELF): /lib/secure:/usr/lib/secure \
621 621 (system default)
622 622
623 623 Directory: /lib
624 624 libcurses.so.1 (alternate: /usr/ucblib/libcurses.so.1)
625 625 ....
626 626
627 627 $ ldd /usr/bin/vi
628 628 libcurses.so.1 => /usr/ucblib/libcurses.so.1 (alternate)
629 629 ....
630 630
631 631
632 632
633 633
634 634 With this configuration, any dependency that would normally resolve to
635 635 /usr/lib/libcurses.so.1 instead resolves to /usr/ucblib/libcurses.so.1.
636 636
637 637
638 638 Example 8 Setting Replaceable and Permanent Environment Variables
639 639
640 640
641 641 The following example sets replaceable and permanent environment
642 642 variables.
643 643
644 644
645 645 # crle -e LD_LIBRARY_PATH=/local/lib \
646 646 -E LD_PRELOAD=preload.so.1
647 647 # crle
648 648 .....
649 649 Environment Variables:
650 650 LD_LIBRARY_PATH=/local/lib (replaceable)
651 651 LD_PRELOAD=preload.so.1 (permanent)
652 652
653 653 .....
654 654 $ LD_DEBUG=files LD_PRELOAD=preload.so.2 ./main
655 655 .....
656 656 18764: file=preload.so.2; preloaded
657 657 18764: file=/local/lib/preload.so.2 [ ELF ]; generating link map
658 658 .....
659 659 18764: file=preload.so.1; preloaded
660 660 18764: file=/local/lib/preload.so.1 [ ELF ]; generating link map
661 661 .....
662 662
663 663
664 664
665 665
666 666 With this configuration file, a replaceable search path has been
667 667 specified together with a permanent preload object which becomes
668 668 appended to the process environment definition.
669 669
670 670
671 671 EXIT STATUS
672 672 The creation or display of a configuration file results in a 0 being
673 673 returned. Otherwise, any error condition is accompanied with a
674 674 diagnostic message and a non-zero value being returned.
675 675
676 676 NOTES
677 677 The ability to tag an alternative application to use an application-
678 678 specific configuration file, is possible if the original application
679 679 contains one of the .dynamic tags DT_FLAGS_1 or DT_FEATURE_1. Without
680 680 these entries, a configuration file must be specified using the
681 681 LD_CONFIG environment variable. Care should be exercised with this
682 682 latter method as this environment variable is visible to any forked
683 683 applications.
684 684
685 685
686 686 The use of the -u option requires at least version 2 of crle. This
687 687 version level is evident from displaying the contents of a
688 688 configuration file.
689 689
690 690 $ crle
691 691
692 692 Configuration file [2]: /var/ld/ld.config
693 693 ......
694 694
695 695
696 696
697 697
698 698 With a version 2 configuration file, crle is capable of constructing
699 699 the command-line arguments required to regenerate the configuration
700 700 file. This command-line construction, provides full update capabilities
701 701 using the -u option. Although a version 1 configuration file update is
702 702 possible, the configuration file contents might be insufficient for
703 703 crle to compute the entire update requirements.
704 704
705 705
706 706 Configuration files contain platform specific binary data. A given
707 707 configuration file can only be interpreted by software with the same
708 708 machine class and byte ordering. However, the information necessary to
709 709 enforce this restriction was not included in configuration files until
710 710 SXCE build 41. As of this SXCE build, configuration files have system
711 711 identification information at the beginning of the file. This
712 712 additional information is used by crle and the runtime to check their
713 713 compatibility with configuration files. This information also allows
714 714 the file(1) command to properly identify configuration files. For
715 715 backward compatibility, older files that are missing this information
716 716 are still accepted, although without the identification and error
717 717 checking that would otherwise be possible. When processing an update
718 718 (-u) operation for an older file that lacks system information, crle
719 719 does not add system identification information to the result.
720 720
721 721 FILES
722 722 /var/ld/ld.config
723 723
724 724 Default configuration file for 32-bit applications.
725 725
726 726
727 727 /var/ld/64/ld.config
728 728
729 729 Default configuration file for 64-bit applications.
730 730
731 731
732 732 /var/tmp
733 733
734 734 Default location for temporary configuration file. See tempnam(3C).
735 735
736 736
737 737 /usr/lib/lddstub
738 738
739 739 Stub application that is employed to dldump(3C) 32-bit objects.
740 740
741 741
742 742 /usr/lib/64/lddstub
743 743
744 744 Stub application that is employed to dldump(3C) 64-bit objects.
745 745
746 746
747 747 /usr/lib/libcrle.so.1
748 748
749 749 Audit library that is employed to dldump(3C) 32-bit objects.
750 750
751 751
752 752 /usr/lib/64/libcrle.so.1
753 753
754 754 Audit library that is employed to dldump(3C) 64-bit objects.
755 755
756 756
757 757 ENVIRONMENT VARIABLES
758 758 There are no environment variables that are referenced by crle.
759 759 However, several environment variables affect the runtime linkers
760 760 behavior in regard to the processing of configuration files that are
761 761 created by crle.
762 762
763 763 LD_CONFIG, LD_CONFIG_32 and LD_CONFIG_64
764 764
765 765 Provide an alternative configuration file.
766 766
767 767
768 768 LD_NOCONFIG, LD_NOCONFIG_32 and LD_NOCONFIG_64
769 769
770 770 Disable configuration file processing.
771 771
772 772
773 773 LD_NODIRCONFIG, LD_NODIRCONFIG_32 and LD_NODIRCONFIG_64
774 774
775 775 Disable directory cache processing from a configuration file.
776 776
777 777
778 778 LD_NOENVCONFIG, LD_NOENVCONFIG_32 and LD_NOENVCONFIG_64
779 779
780 780 Disable environment variable processing from a configuration file.
781 781
782 782
783 783 LD_NOOBJALTER, LD_NOOBJALTER_32 and LD_NOOBJALTER_64
784 784
785 785 Disable alternative object processing from a configuration file.
786 786
787 787
788 788 ATTRIBUTES
789 789 See attributes(5) for descriptions of the following attributes.
790 790
791 791
792 792
793 793
794 794 +--------------------+-----------------+
795 795 | ATTRIBUTE TYPE | ATTRIBUTE VALUE |
796 796 +--------------------+-----------------+
797 797 |Interface Stability | Committed |
798 798 +--------------------+-----------------+
799 799
800 800 SEE ALSO
801 801 file(1), ld(1), ld.so.1(1), dldump(3C), tempnam(3C), attributes(5)
802 802
803 803
804 804 Linker and Libraries Guide
805 805
806 806
807 807
808 808 October 6, 2008 CRLE(1)
↓ open down ↓ |
750 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX