1 2 Linux Standard Base Core Specification 3.1 3 4 Copyright © 2004, 2005 Free Standards Group 5 6 Permission is granted to copy, distribute and/or modify this 7 document under the terms of the GNU Free Documentation 8 License, Version 1.1; with no Invariant Sections, with no 9 Front-Cover Texts, and with no Back-Cover Texts. A copy of the 10 license is included in the section entitled "GNU Free 11 Documentation License". 12 13 Portions of the text are copyrighted by the following parties: 14 15 * The Regents of the University of California 16 * Free Software Foundation 17 * Ian F. Darwin 18 * Paul Vixie 19 * BSDI (now Wind River) 20 * Andrew G Morgan 21 * Jean-loup Gailly and Mark Adler 22 * Massachusetts Institute of Technology 23 24 These excerpts are being used in accordance with their 25 respective licenses. 26 27 Linux is a trademark of Linus Torvalds. 28 29 UNIX a registered trademark of the Open Group in the United 30 States and other countries. 31 32 LSB is a trademark of the Free Standards Group in the USA and 33 other countries. 34 35 AMD is a trademark of Advanced Micro Devices, Inc. 36 37 Intel and Itanium are registered trademarks and Intel386 is a 38 trademarks of Intel Corporation. 39 40 PowerPC and PowerPC Architecture are trademarks of the IBM 41 Corporation. 42 43 OpenGL is a registered trademark of Silicon Graphics, Inc. 44 _________________________________________________________ 45 46 Table of Contents 47 Foreword 48 Introduction 49 I. Introductory Elements 50 51 1. Scope 52 53 1.1. General 54 1.2. Module Specific Scope 55 56 2. References 57 58 2.1. Normative References 59 2.2. Informative References/Bibliography 60 61 3. Requirements 62 63 3.1. Relevant Libraries 64 3.2. LSB Implementation Conformance 65 3.3. LSB Application Conformance 66 67 4. Definitions 68 5. Terminology 69 6. Documentation Conventions 70 7. Relationship To ISO/IEC 9945 POSIX 71 8. Relationship To Other Free Standards Group 72 Specifications 73 74 II. Executable And Linking Format (ELF) 75 76 9. Introduction 77 10. Low Level System Information 78 79 10.1. Operating System Interface 80 10.2. Machine Interface 81 82 11. Object Format 83 84 11.1. Object Files 85 11.2. Sections 86 11.3. Special Sections 87 11.4. Symbol Mapping 88 11.5. DWARF Extensions 89 11.6. Exception Frames 90 11.7. Symbol Versioning 91 11.8. ABI note tag 92 93 12. Dynamic Linking 94 95 12.1. Program Loading and Dynamic Linking 96 12.2. Program Header 97 12.3. Dynamic Entries 98 99 III. Base Libraries 100 101 13. Base Libraries 102 103 13.1. Introduction 104 13.2. Program Interpreter 105 13.3. Interfaces for libc 106 13.4. Data Definitions for libc 107 13.5. Interface Definitions for libc 108 13.6. Interfaces for libm 109 13.7. Data Definitions for libm 110 13.8. Interface Definitions for libm 111 13.9. Interfaces for libpthread 112 13.10. Data Definitions for libpthread 113 13.11. Interface Definitions for libpthread 114 13.12. Interfaces for libgcc_s 115 13.13. Data Definitions for libgcc_s 116 13.14. Interfaces for libdl 117 13.15. Data Definitions for libdl 118 13.16. Interface Definitions for libdl 119 13.17. Interfaces for librt 120 13.18. Interfaces for libcrypt 121 13.19. Interfaces for libpam 122 13.20. Data Definitions for libpam 123 13.21. Interface Definitions for libpam 124 125 IV. Utility Libraries 126 127 14. Utility Libraries 128 129 14.1. Introduction 130 14.2. Interfaces for libz 131 14.3. Data Definitions for libz 132 14.4. Interface Definitions for libz 133 14.5. Interfaces for libncurses 134 14.6. Data Definitions for libncurses 135 14.7. Interfaces for libutil 136 14.8. Interface Definitions for libutil 137 138 V. Commands and Utilities 139 140 15. Commands and Utilities 141 142 15.1. Commands and Utilities 143 15.2. Command Behavior 144 145 VI. Execution Environment 146 147 16. File System Hierarchy 148 149 16.1. /dev: Device Files 150 16.2. /etc: Host-specific system configuration 151 16.3. User Accounting Databases 152 16.4. Path For System Administration Utilities 153 154 17. Additional Recommendations 155 156 17.1. Recommendations for applications on ownership 157 and permissions 158 159 18. Additional Behaviors 160 161 18.1. Mandatory Optional Behaviors 162 163 19. Localization 164 165 19.1. Introduction 166 19.2. Regular Expressions 167 19.3. Pattern Matching Notation 168 169 VII. System Initialization 170 171 20. System Initialization 172 173 20.1. Cron Jobs 174 20.2. Init Script Actions 175 20.3. Comment Conventions for Init Scripts 176 20.4. Installation and Removal of Init Scripts 177 20.5. Run Levels 178 20.6. Facility Names 179 20.7. Script Names 180 20.8. Init Script Functions 181 182 VIII. Users & Groups 183 184 21. Users & Groups 185 186 21.1. User and Group Database 187 21.2. User & Group Names 188 21.3. User ID Ranges 189 21.4. Rationale 190 191 IX. Package Format and Installation 192 193 22. Software Installation 194 195 22.1. Introduction 196 22.2. Package File Format 197 22.3. Package Script Restrictions 198 22.4. Package Tools 199 22.5. Package Naming 200 22.6. Package Dependencies 201 22.7. Package Architecture Considerations 202 203 A. Alphabetical Listing of Interfaces 204 205 A.1. libc 206 A.2. libcrypt 207 A.3. libdl 208 A.4. libm 209 A.5. libncurses 210 A.6. libpam 211 A.7. libpthread 212 A.8. librt 213 A.9. libutil 214 A.10. libz 215 216 B. Future Directions (Informative) 217 218 B.1. Introduction 219 B.2. Commands And Utilities 220 221 lsbinstall -- installation tool for various types 222 of data 223 224 C. GNU Free Documentation License (Informative) 225 226 C.1. PREAMBLE 227 C.2. APPLICABILITY AND DEFINITIONS 228 C.3. VERBATIM COPYING 229 C.4. COPYING IN QUANTITY 230 C.5. MODIFICATIONS 231 C.6. COMBINING DOCUMENTS 232 C.7. COLLECTIONS OF DOCUMENTS 233 C.8. AGGREGATION WITH INDEPENDENT WORKS 234 C.9. TRANSLATION 235 C.10. TERMINATION 236 C.11. FUTURE REVISIONS OF THIS LICENSE 237 C.12. How to use this License for your documents 238 239 List of Figures 240 11-1. Version Definition Entries 241 11-2. Version Definition Auxiliary Entries 242 11-3. Version Needed Entries 243 11-4. Version Needed Auxiliary Entries 244 12-1. Dynamic Structure 245 246 List of Tables 247 2-1. Normative References 248 2-2. Other References 249 3-1. Standard Library Names 250 3-2. Standard Library Names defined in the Architecture 251 Specific Supplement 252 253 10-1. Scalar Types 254 11-1. ELF Section Types 255 11-2. Additional Section Types 256 11-3. ELF Special Sections 257 11-4. Additional Special Sections 258 11-5. DWARF Exception Header value format 259 11-6. DWARF Exception Header application 260 11-7. Additional DWARF Call Frame Instructions 261 11-8. Call Frame Information Format 262 11-9. Common Information Entry Format 263 11-10. Frame Description Entry Format 264 11-11. .eh_frame_hdr Section Format 265 12-1. Linux Segment Types 266 13-1. libc Definition 267 13-2. libc - RPC Function Interfaces 268 13-3. libc - System Calls Function Interfaces 269 13-4. libc - Standard I/O Function Interfaces 270 13-5. libc - Standard I/O Data Interfaces 271 13-6. libc - Signal Handling Function Interfaces 272 13-7. libc - Signal Handling Data Interfaces 273 13-8. libc - Localization Functions Function Interfaces 274 13-9. libc - Localization Functions Data Interfaces 275 13-10. libc - Socket Interface Function Interfaces 276 13-11. libc - Wide Characters Function Interfaces 277 13-12. libc - String Functions Function Interfaces 278 13-13. libc - IPC Functions Function Interfaces 279 13-14. libc - Regular Expressions Function Interfaces 280 13-15. libc - Character Type Functions Function Interfaces 281 13-16. libc - Time Manipulation Function Interfaces 282 13-17. libc - Time Manipulation Data Interfaces 283 13-18. libc - Terminal Interface Functions Function Interfaces 284 13-19. libc - System Database Interface Function Interfaces 285 13-20. libc - Language Support Function Interfaces 286 13-21. libc - Large File Support Function Interfaces 287 13-22. libc - Standard Library Function Interfaces 288 13-23. libc - Standard Library Data Interfaces 289 13-24. libm Definition 290 13-25. libm - Math Function Interfaces 291 13-26. libm - Math Data Interfaces 292 13-27. libpthread Definition 293 13-28. libpthread - Realtime Threads Function Interfaces 294 13-29. libpthread - Posix Threads Function Interfaces 295 13-30. libpthread - Thread aware versions of libc interfaces 296 Function Interfaces 297 298 13-31. libgcc_s Definition 299 13-32. libdl Definition 300 13-33. libdl - Dynamic Loader Function Interfaces 301 13-34. librt Definition 302 13-35. librt - Shared Memory Objects Function Interfaces 303 13-36. librt - Clock Function Interfaces 304 13-37. librt - Timers Function Interfaces 305 13-38. libcrypt Definition 306 13-39. libcrypt - Encryption Function Interfaces 307 13-40. libpam Definition 308 13-41. libpam - Pluggable Authentication API Function 309 Interfaces 310 311 14-1. libz Definition 312 14-2. libz - Compression Library Function Interfaces 313 14-3. libncurses Definition 314 14-4. libncurses - Curses Function Interfaces 315 14-5. libncurses - Curses Data Interfaces 316 14-6. libutil Definition 317 14-7. libutil - Utility Functions Function Interfaces 318 15-1. Commands And Utilities 319 15-2. Built In Utilities 320 15-1. Escape Sequences 321 21-1. Required User & Group Names 322 21-2. Optional User & Group Names 323 22-1. RPM File Format 324 22-2. Signature Format 325 22-3. Index Type values 326 22-4. Header Private Tag Values 327 22-5. Signature Tag Values 328 22-6. Signature Digest Tag Values 329 22-7. Signature Signing Tag Values 330 22-8. Package Info Tag Values 331 22-9. Installation Tag Values 332 22-10. File Info Tag Values 333 22-11. File Flags 334 22-12. Package Dependency Tag Values 335 22-13. Index Type values 336 22-14. Package Dependency Attributes 337 22-15. Other Tag Values 338 22-16. CPIO File Format 339 A-1. libc Function Interfaces 340 A-2. libc Data Interfaces 341 A-3. libcrypt Function Interfaces 342 A-4. libdl Function Interfaces 343 A-5. libm Function Interfaces 344 A-6. libm Data Interfaces 345 A-7. libncurses Function Interfaces 346 A-8. libncurses Data Interfaces 347 A-9. libpam Function Interfaces 348 A-10. libpthread Function Interfaces 349 A-11. librt Function Interfaces 350 A-12. libutil Function Interfaces 351 A-13. libz Function Interfaces 352 _________________________________________________________ 353 354 Foreword 355 356 This is version 3.1 of the Linux Standard Base Core 357 Specification. This specification is part of a family of 358 specifications under the general title "Linux Standard Base". 359 Developers of applications or implementations interested in 360 using the LSB trademark should see the Free Standards Group 361 Certification Policy for details. 362 _________________________________________________________ 363 364 Introduction 365 366 The LSB defines a binary interface for application programs 367 that are compiled and packaged for LSB-conforming 368 implementations on many different hardware architectures. 369 Since a binary specification shall include information 370 specific to the computer processor architecture for which it 371 is intended, it is not possible for a single document to 372 specify the interface for all possible LSB-conforming 373 implementations. Therefore, the LSB is a family of 374 specifications, rather than a single one. 375 376 This document should be used in conjunction with the documents 377 it references. This document enumerates the system components 378 it includes, but descriptions of those components may be 379 included entirely or partly in this document, partly in other 380 documents, or entirely in other reference documents. For 381 example, the section that describes system service routines 382 includes a list of the system routines supported in this 383 interface, formal declarations of the data structures they use 384 that are visible to applications, and a pointer to the 385 underlying referenced specification for information about the 386 syntax and semantics of each call. Only those routines not 387 described in standards referenced by this document, or 388 extensions to those standards, are described in the detail. 389 Information referenced in this way is as much a part of this 390 document as is the information explicitly included here. 391 392 The specification carries a version number of either the form 393 x.y or x.y.z. This version number carries the following 394 meaning: 395 396 * The first number (x) is the major version number. All 397 versions with the same major version number should share 398 binary compatibility. Any addition or deletion of a new 399 library results in a new version number. Interfaces marked 400 as deprecated may be removed from the specification at a 401 major version change. 402 * The second number (y) is the minor version number. 403 Individual interfaces may be added if all certified 404 implementations already had that (previously undocumented) 405 interface. Interfaces may be marked as deprecated at a 406 minor version change. Other minor changes may be permitted 407 at the discretion of the LSB workgroup. 408 * The third number (z), if present, is the editorial level. 409 Only editorial changes should be included in such 410 versions. 411 412 Since this specification is a descriptive Application Binary 413 Interface, and not a source level API specification, it is not 414 possible to make a guarantee of 100% backward compatibility 415 between major releases. However, it is the intent that those 416 parts of the binary interface that are visible in the source 417 level API will remain backward compatible from version to 418 version, except where a feature marked as "Deprecated" in one 419 release may be removed from a future release. 420 421 Implementors are strongly encouraged to make use of symbol 422 versioning to permit simultaneous support of applications 423 conforming to different releases of this specification. 424 425 I. Introductory Elements 426 427 Table of Contents 428 1. Scope 429 430 1.1. General 431 1.2. Module Specific Scope 432 433 2. References 434 435 2.1. Normative References 436 2.2. Informative References/Bibliography 437 438 3. Requirements 439 440 3.1. Relevant Libraries 441 3.2. LSB Implementation Conformance 442 3.3. LSB Application Conformance 443 444 4. Definitions 445 5. Terminology 446 6. Documentation Conventions 447 7. Relationship To ISO/IEC 9945 POSIX 448 8. Relationship To Other Free Standards Group Specifications 449 _________________________________________________________ 450 451 Chapter 1. Scope 452 453 1.1. General 454 455 The Linux Standard Base (LSB) defines a system interface for 456 compiled applications and a minimal environment for support of 457 installation scripts. Its purpose is to enable a uniform 458 industry standard environment for high-volume applications 459 conforming to the LSB. 460 461 These specifications are composed of two basic parts: A common 462 specification ("LSB-generic" or "generic LSB") describing 463 those parts of the interface that remain constant across all 464 implementations of the LSB, and an architecture-specific 465 supplement ("LSB-arch" or "archLSB") describing the parts of 466 the interface that vary by processor architecture. Together, 467 the LSB-generic and the architecture-specific supplement for a 468 single hardware architecture provide a complete interface 469 specification for compiled application programs on systems 470 that share a common hardware architecture. 471 472 The LSB-generic document shall be used in conjunction with an 473 architecture-specific supplement. Whenever a section of the 474 LSB-generic specification shall be supplemented by 475 architecture-specific information, the LSB-generic document 476 includes a reference to the architecture supplement. 477 Architecture supplements may also contain additional 478 information that is not referenced in the LSB-generic 479 document. 480 481 The LSB contains both a set of Application Program Interfaces 482 (APIs) and Application Binary Interfaces (ABIs). APIs may 483 appear in the source code of portable applications, while the 484 compiled binary of that application may use the larger set of 485 ABIs. A conforming implementation shall provide all of the 486 ABIs listed here. The compilation system may replace (e.g. by 487 macro definition) certain APIs with calls to one or more of 488 the underlying binary interfaces, and may insert calls to 489 binary interfaces as needed. 490 491 The LSB is primarily a binary interface definition. Not all of 492 the source level APIs available to applications may be 493 contained in this specification. 494 _________________________________________________________ 495 496 1.2. Module Specific Scope 497 498 This is the Core module of the Linux Standards Base (LSB). 499 This module provides the fundamental system interfaces, 500 libraries, and runtime environment upon which all conforming 501 applications and libraries depend. 502 503 Interfaces described in this module are mandatory except where 504 explicitly listed otherwise. Core interfaces may be 505 supplemented by other modules; all modules are built upon the 506 core. 507 _________________________________________________________ 508 509 Chapter 2. References 510 511 2.1. Normative References 512 513 The following referenced documents are indispensable for the 514 application of this document. For dated references, only the 515 edition cited applies. For undated references, the latest 516 edition of the referenced document (including any amendments) 517 applies. 518 519 Note: Where copies of a document are available on the World 520 Wide Web, a Uniform Resource Locator (URL) is given for 521 informative purposes only. This may point to a more recent 522 copy of the referenced specification, or may be out of 523 date. Reference copies of specifications at the revision 524 level indicated may be found at the Free Standards Group's 525 Reference Specifications site. 526 527 Table 2-1. Normative References 528 Name Title URL 529 Filesystem Hierarchy Standard Filesystem Hierarchy Standard 530 (FHS) 2.3 http://www.pathname.com/fhs/ 531 IEC 60559/IEEE 754 Floating Point IEC 60559:1989 Binary 532 floating-point arithmetic for microprocessor systems 533 http://www.ieee.org/ 534 ISO C (1999) ISO/IEC 9899: 1999, Programming Languages --C 535 ISO POSIX (2003) 536 537 ISO/IEC 9945-1:2003 Information technology -- Portable 538 Operating System Interface (POSIX) -- Part 1: Base Definitions 539 540 ISO/IEC 9945-2:2003 Information technology -- Portable 541 Operating System Interface (POSIX) -- Part 2: System 542 Interfaces 543 544 ISO/IEC 9945-3:2003 Information technology -- Portable 545 Operating System Interface (POSIX) -- Part 3: Shell and 546 Utilities 547 548 ISO/IEC 9945-4:2003 Information technology -- Portable 549 Operating System Interface (POSIX) -- Part 4: Rationale 550 551 Including Technical Cor. 1: 2004 552 http://www.unix.org/version3/ 553 Itanium C++ ABI Itanium C++ ABI (Revision 1.83) 554 http://refspecs.freestandards.org/cxxabi-1.83.html 555 Large File Support Large File Support 556 http://www.UNIX-systems.org/version2/whatsnew/lfs20mar.html 557 SUSv2 CAE Specification, January 1997, System Interfaces and 558 Headers (XSH),Issue 5 (ISBN: 1-85912-181-0, C606) 559 http://www.opengroup.org/publications/catalog/un.htm 560 SUSv2 Commands and Utilities The Single UNIX® 561 Specification(SUS) Version 2, Commands and Utilities (XCU), 562 Issue 5 (ISBN: 1-85912-191-8, C604) 563 http://www.opengroup.org/publications/catalog/un.htm 564 SVID Issue 3 American Telephone and Telegraph Company, System 565 V Interface Definition, Issue 3 ; Morristown, NJ, UNIX Press, 566 1989.(ISBN 0201566524) 567 SVID Issue 4 System V Interface Definition,Fourth Edition 568 System V ABI System V Application Binary Interface, Edition 569 4.1 http://www.caldera.com/developers/devspecs/gabi41.pdf 570 System V ABI Update System V Application Binary Interface - 571 DRAFT - 17 December 2003 572 http://www.caldera.com/developers/gabi/2003-12-17/contents.htm 573 l 574 X/Open Curses CAE Specification, May 1996, X/Open Curses, 575 Issue 4, Version 2 (ISBN: 1-85912-171-3, C610), plus 576 Corrigendum U018 577 http://www.opengroup.org/publications/catalog/un.htm 578 _________________________________________________________ 579 580 2.2. Informative References/Bibliography 581 582 In addition, the specifications listed below provide essential 583 background information to implementors of this specification. 584 These references are included for information only. 585 586 Table 2-2. Other References 587 Name Title URL 588 DWARF Debugging Information Format, Revision 2.0.0 DWARF 589 Debugging Information Format, Revision 2.0.0 (July 27, 1993) 590 http://refspecs.freestandards.org/dwarf/dwarf-2.0.0.pdf 591 DWARF Debugging Information Format, Revision 3.0.0 (Draft) 592 DWARF Debugging Information Format, Revision 3.0.0 (Draft) 593 http://refspecs.freestandards.org/dwarf/ 594 ISO/IEC TR14652 ISO/IEC Technical Report 14652:2002 595 Specification method for cultural conventions 596 ITU-T V.42 International Telecommunication Union 597 Recommendation V.42 (2002): Error-correcting procedures for 598 DCEs using asynchronous-to-synchronous conversionITUV 599 http://www.itu.int/rec/recommendation.asp?type=folders&lang=e& 600 parent=T-REC-V.42 601 Li18nux Globalization Specification LI18NUX 2000 Globalization 602 Specification, Version 1.0 with Amendment 4 603 http://www.li18nux.org/docs/html/LI18NUX-2000-amd4.htm 604 Linux Allocated Device Registry LINUX ALLOCATED DEVICES 605 http://www.lanana.org/docs/device-list/devices.txt 606 PAM Open Software Foundation, Request For Comments: 86.0 , 607 October 1995, V. Samar & R.Schemers (SunSoft) 608 http://www.opengroup.org/tech/rfc/mirror-rfc/rfc86.0.txt 609 RFC 1321: The MD5 Message-Digest Algorithm IETF RFC 1321: The 610 MD5 Message-Digest Algorithm 611 http://www.ietf.org/rfc/rfc1321.txt 612 RFC 1831/1832 RPC & XDR IETF RFC 1831 & 1832 613 http://www.ietf.org/ 614 RFC 1833: Binding Protocols for ONC RPC Version 2 IETF RFC 615 1833: Binding Protocols for ONC RPC Version 2 616 http://www.ietf.org/rfc/rfc1833.txt 617 RFC 1950: ZLIB Compressed Data Format Specication IETF RFC 618 1950: ZLIB Compressed Data Format Specification 619 http://www.ietf.org/rfc/rfc1950.txt 620 RFC 1951: DEFLATE Compressed Data Format Specification IETF 621 RFC 1951: DEFLATE Compressed Data Format Specification version 622 1.3 http://www.ietf.org/rfc/rfc1951.txt 623 RFC 1952: GZIP File Format Specification IETF RFC 1952: GZIP 624 file format specification version 4.3 625 http://www.ietf.org/rfc/rfc1952.txt 626 RFC 2440: OpenPGP Message Format IETF RFC 2440: OpenPGP 627 Message Format http://www.ietf.org/rfc/rfc2440.txt 628 RFC 2821:Simple Mail Transfer Protocol IETF RFC 2821: Simple 629 Mail Transfer Protocol http://www.ietf.org/rfc/rfc2821.txt 630 RFC 2822:Internet Message Format IETF RFC 2822: Internet 631 Message Format http://www.ietf.org/rfc/rfc2822.txt 632 RFC 791:Internet Protocol IETF RFC 791: Internet Protocol 633 Specification http://www.ietf.org/rfc/rfc791.txt 634 RPM Package Format RPM Package Format V3.0 635 http://www.rpm.org/max-rpm/s1-rpm-file-format-rpm-file-format. 636 html 637 zlib Manual zlib 1.2 Manual http://www.gzip.org/zlib/ 638 _________________________________________________________ 639 640 Chapter 3. Requirements 641 642 3.1. Relevant Libraries 643 644 The libraries listed in Table 3-1 shall be available on a 645 Linux Standard Base system, with the specified runtime names. 646 The libraries listed in Table 3-2 are architecture specific, 647 but shall be available on all LSB conforming systems. This 648 list may be supplemented or amended by the architecture 649 specific supplement. 650 651 Table 3-1. Standard Library Names 652 Library Runtime Name 653 libdl libdl.so.2 654 libcrypt libcrypt.so.1 655 libz libz.so.1 656 libncurses libncurses.so.5 657 libutil libutil.so.1 658 libpthread libpthread.so.0 659 librt librt.so.1 660 libpam libpam.so.0 661 libgcc_s libgcc_s.so.1 662 663 Table 3-2. Standard Library Names defined in the Architecture 664 Specific Supplement 665 Library Runtime Name 666 libm See archLSB 667 libc See archLSB 668 proginterp See archLSB 669 670 These libraries will be in an implementation-defined directory 671 which the dynamic linker shall search by default. 672 _________________________________________________________ 673 674 3.2. LSB Implementation Conformance 675 676 A conforming implementation is necessarily architecture 677 specific, and must provide the interfaces specified by both 678 the generic LSB Core specification and its relevant 679 architecture specific supplement. 680 681 Rationale: An implementation must provide at least the 682 interfaces specified in these specifications. It may also 683 provide additional interfaces. 684 685 A conforming implementation shall satisfy the following 686 requirements: 687 688 * A processor architecture represents a family of related 689 processors which may not have identical feature sets. The 690 architecture specific supplement to this specification for 691 a given target processor architecture describes a minimum 692 acceptable processor. The implementation shall provide all 693 features of this processor, whether in hardware or through 694 emulation transparent to the application. 695 * The implementation shall be capable of executing compiled 696 applications having the format and using the system 697 interfaces described in this document. 698 * The implementation shall provide libraries containing the 699 interfaces specified by this document, and shall provide a 700 dynamic linking mechanism that allows these interfaces to 701 be attached to applications at runtime. All the interfaces 702 shall behave as specified in this document. 703 * The map of virtual memory provided by the implementation 704 shall conform to the requirements of this document. 705 * The implementation's low-level behavior with respect to 706 function call linkage, system traps, signals, and other 707 such activities shall conform to the formats described in 708 this document. 709 * The implementation shall provide all of the mandatory 710 interfaces in their entirety. 711 * The implementation may provide one or more of the optional 712 interfaces. Each optional interface that is provided shall 713 be provided in its entirety. The product documentation 714 shall state which optional interfaces are provided. 715 * The implementation shall provide all files and utilities 716 specified as part of this document in the format defined 717 here and in other referenced documents. All commands and 718 utilities shall behave as required by this document. The 719 implementation shall also provide all mandatory components 720 of an application's runtime environment that are included 721 or referenced in this document. 722 * The implementation, when provided with standard data 723 formats and values at a named interface, shall provide the 724 behavior defined for those values and data formats at that 725 interface. However, a conforming implementation may 726 consist of components which are separately packaged and/or 727 sold. For example, a vendor of a conforming implementation 728 might sell the hardware, operating system, and windowing 729 system as separately packaged items. 730 * The implementation may provide additional interfaces with 731 different names. It may also provide additional behavior 732 corresponding to data values outside the standard ranges, 733 for standard named interfaces. 734 _________________________________________________________ 735 736 3.3. LSB Application Conformance 737 738 A conforming application is necessarily architecture specific, 739 and must conform to both the generic LSB Core specification 740 and its relevant architecture specific supplement. 741 742 A conforming application shall satisfy the following 743 requirements: 744 745 * Its executable files shall be either shell scripts or 746 object files in the format defined for the Object File 747 Format system interface. 748 * Its object files shall participate in dynamic linking as 749 defined in the Program Loading and Linking System 750 interface. 751 * It shall employ only the instructions, traps, and other 752 low-level facilities defined in the Low-Level System 753 interface as being for use by applications. 754 * If it requires any optional interface defined in this 755 document in order to be installed or to execute 756 successfully, the requirement for that optional interface 757 shall be stated in the application's documentation. 758 * It shall not use any interface or data format that is not 759 required to be provided by a conforming implementation, 760 unless: 761 + If such an interface or data format is supplied by 762 another application through direct invocation of that 763 application during execution, that application shall 764 be in turn an LSB conforming application. 765 + The use of that interface or data format, as well as 766 its source, shall be identified in the documentation 767 of the application. 768 * It shall not use any values for a named interface that are 769 reserved for vendor extensions. 770 771 A strictly conforming application shall not require or use any 772 interface, facility, or implementation-defined extension that 773 is not defined in this document in order to be installed or to 774 execute successfully. 775 _________________________________________________________ 776 777 Chapter 4. Definitions 778 779 For the purposes of this document, the following definitions, 780 as specified in the ISO/IEC Directives, Part 2, 2001, 4th 781 Edition, apply: 782 783 can 784 785 be able to; there is a possibility of; it is possible to 786 cannot 787 788 be unable to; there is no possibilty of; it is not possible to 789 may 790 791 is permitted; is allowed; is permissible 792 need not 793 794 it is not required that; no...is required 795 shall 796 797 is to; is required to; it is required that; has to; only...is 798 permitted; it is necessary 799 shall not 800 801 is not allowed [permitted] [acceptable] [permissible]; is 802 required to be not; is required that...be not; is not to be 803 should 804 805 it is recommended that; ought to 806 should not 807 808 it is not recommended that; ought not to 809 _________________________________________________________ 810 811 Chapter 5. Terminology 812 813 For the purposes of this document, the following terms apply: 814 815 archLSB 816 The architectural part of the LSB Specification which 817 describes the specific parts of the interface that are 818 platform specific. The archLSB is complementary to the 819 gLSB. 820 821 Binary Standard 822 The total set of interfaces that are available to be 823 used in the compiled binary code of a conforming 824 application. 825 826 gLSB 827 The common part of the LSB Specification that describes 828 those parts of the interface that remain constant 829 across all hardware implementations of the LSB. 830 831 implementation-defined 832 Describes a value or behavior that is not defined by 833 this document but is selected by an implementor. The 834 value or behavior may vary among implementations that 835 conform to this document. An application should not 836 rely on the existence of the value or behavior. An 837 application that relies on such a value or behavior 838 cannot be assured to be portable across conforming 839 implementations. The implementor shall document such a 840 value or behavior so that it can be used correctly by 841 an application. 842 843 Shell Script 844 A file that is read by an interpreter (e.g., awk). The 845 first line of the shell script includes a reference to 846 its interpreter binary. 847 848 Source Standard 849 The set of interfaces that are available to be used in 850 the source code of a conforming application. 851 852 undefined 853 Describes the nature of a value or behavior not defined 854 by this document which results from use of an invalid 855 program construct or invalid data input. The value or 856 behavior may vary among implementations that conform to 857 this document. An application should not rely on the 858 existence or validity of the value or behavior. An 859 application that relies on any particular value or 860 behavior cannot be assured to be portable across 861 conforming implementations. 862 863 unspecified 864 Describes the nature of a value or behavior not 865 specified by this document which results from use of a 866 valid program construct or valid data input. The value 867 or behavior may vary among implementations that conform 868 to this document. An application should not rely on the 869 existence or validity of the value or behavior. An 870 application that relies on any particular value or 871 behavior cannot be assured to be portable across 872 conforming implementations. 873 874 Other terms and definitions used in this document shall have 875 the same meaning as defined in Chapter 3 of the Base 876 Definitions volume of ISO POSIX (2003). 877 _________________________________________________________ 878 879 Chapter 6. Documentation Conventions 880 881 Throughout this document, the following typographic 882 conventions are used: 883 884 function() 885 886 the name of a function 887 command 888 889 the name of a command or utility 890 CONSTANT 891 892 a constant value 893 parameter 894 895 a parameter 896 variable 897 898 a variable 899 900 Throughout this specification, several tables of interfaces 901 are presented. Each entry in these tables has the following 902 format: 903 904 name 905 906 the name of the interface 907 (symver) 908 909 An optional symbol version identifier, if required. 910 [refno] 911 912 A reference number indexing the table of referenced 913 specifications that follows this table. 914 915 For example, 916 917 forkpty(GLIBC_2.0) [SUSv3] 918 919 refers to the interface named forkpty() with symbol version 920 GLIBC_2.0 that is defined in the SUSv3 reference. 921 922 Note: Symbol versions are defined in the architecture 923 specific supplements only. 924 _________________________________________________________ 925 926 Chapter 7. Relationship To ISO/IEC 9945 POSIX 927 928 This specification includes many interfaces described in ISO 929 POSIX (2003). Unless otherwise specified, such interfaces 930 should behave exactly as described in that specification. Any 931 conflict between the requirements described here and the ISO 932 POSIX (2003) standard is unintentional, except as explicitly 933 noted otherwise. 934 935 Note: In addition to the differences noted inline in this 936 specification, PDTR 24715 has extracted the differences 937 between this specification and ISO POSIX (2003) into a 938 single place. It is the long term plan of the Free 939 Standards Group to converge the LSB Core Specification with 940 ISO/IEC 9945 POSIX. 941 942 The LSB Specification Authority is responsible for deciding 943 the meaning of conformance to normative referenced standards 944 in the LSB context. Problem Reports regarding underlying or 945 referenced standards in any other context will be referred to 946 the relevant maintenance body for that standard. 947 _________________________________________________________ 948 949 Chapter 8. Relationship To Other Free Standards Group Specifications 950 951 The LSB is the base for several other specification projects 952 under the umbrella of the Free Standards Group (FSG). This 953 specification is the foundation, and other specifications 954 build on the interfaces defined here. However, beyond those 955 specifications listed as Normative References, this 956 specification has no dependencies on other FSG projects. 957 958 II. Executable And Linking Format (ELF) 959 960 Table of Contents 961 9. Introduction 962 10. Low Level System Information 963 964 10.1. Operating System Interface 965 10.2. Machine Interface 966 967 10.2.1. Data Representation 968 969 11. Object Format 970 971 11.1. Object Files 972 11.2. Sections 973 974 11.2.1. Introduction 975 11.2.2. Sections Types 976 977 11.3. Special Sections 978 979 11.3.1. Special Sections 980 981 11.4. Symbol Mapping 982 983 11.4.1. Introduction 984 985 11.5. DWARF Extensions 986 987 11.5.1. DWARF Exception Header Encoding 988 11.5.2. DWARF CFI Extensions 989 990 11.6. Exception Frames 991 992 11.6.1. The .eh_frame section 993 11.6.2. The .eh_frame_hdr section 994 995 11.7. Symbol Versioning 996 997 11.7.1. Introduction 998 11.7.2. Symbol Version Table 999 11.7.3. Version Definitions 1000 11.7.4. Version Requirements 1001 11.7.5. Startup Sequence 1002 11.7.6. Symbol Resolution 1003 1004 11.8. ABI note tag 1005 1006 12. Dynamic Linking 1007 1008 12.1. Program Loading and Dynamic Linking 1009 12.2. Program Header 1010 12.3. Dynamic Entries 1011 1012 12.3.1. Introduction 1013 12.3.2. Dynamic Entries 1014 _________________________________________________________ 1015 1016 Chapter 9. Introduction 1017 1018 Executable and Linking Format (ELF) defines the object format 1019 for compiled applications. This specification supplements the 1020 information found in System V ABI Update and is intended to 1021 document additions made since the publication of that 1022 document. 1023 _________________________________________________________ 1024 1025 Chapter 10. Low Level System Information 1026 1027 10.1. Operating System Interface 1028 1029 LSB-conforming applications shall assume that stack, heap and 1030 other allocated memory regions will be non-executable. The 1031 application must take steps to make them executable if needed. 1032 _________________________________________________________ 1033 1034 10.2. Machine Interface 1035 1036 10.2.1. Data Representation 1037 1038 LSB-conforming applications shall use the data representation 1039 as defined in the Arcitecture specific ELF documents. 1040 _________________________________________________________ 1041 1042 10.2.1.1. Fundamental Types 1043 1044 In addition to the fundamental types specified in the 1045 architecture specific supplement, a 1 byte data type is 1046 defined here. 1047 1048 Table 10-1. Scalar Types 1049 Type C C++ sizeof Alignment (bytes) Architecture 1050 Representation 1051 Integral _Bool bool 1 1 byte 1052 _________________________________________________________ 1053 1054 Chapter 11. Object Format 1055 1056 11.1. Object Files 1057 1058 LSB-conforming implementations shall support the object file 1059 Executable and Linking Format (ELF), which is defined by the 1060 following documents: 1061 1062 * System V ABI 1063 * System V ABI Update 1064 * this specification 1065 * an architecture specific supplement to this specification 1066 1067 Conforming implementations may also support other unspecified 1068 object file formats. 1069 _________________________________________________________ 1070 1071 11.2. Sections 1072 1073 11.2.1. Introduction 1074 1075 As described in System V ABI, an ELF object file contains a 1076 number of sections. 1077 _________________________________________________________ 1078 1079 11.2.2. Sections Types 1080 1081 The section header table is an array of Elf32_Shdr or 1082 Elf64_Shdr structures as described in System V ABI. The 1083 sh_type member shall be either a value from Table 11-1, drawn 1084 from the System V ABI, or one of the additional values 1085 specified in Table 11-2. 1086 1087 A section header's sh_type member specifies the sections's 1088 semantics. 1089 _________________________________________________________ 1090 1091 11.2.2.1. ELF Section Types 1092 1093 The following section types are defined in the System V ABI 1094 and the System V ABI Update. 1095 1096 Table 11-1. ELF Section Types 1097 Name Value Description 1098 SHT_DYNAMIC 0x6 The section holds information for dynamic 1099 linking. Currently, an object file shall have only one dynamic 1100 section, but this restriction may be relaxed in the future. 1101 See `Dynamic Section' in Chapter 5 for details. 1102 SHT_DYNSYM 0xb This section holds a minimal set of symbols 1103 adequate for dynamic linking. See also SHT_SYMTAB. Currently, 1104 an object file may have either a section of SHT_SYMTAB type or 1105 a section of SHT_DYNSYM type, but not both. This restriction 1106 may be relaxed in the future. 1107 SHT_FINI_ARRAY 0xf This section contains an array of pointers 1108 to termination functions, as described in `Initialization and 1109 Termination Functions' in Chapter 5. Each pointer in the array 1110 is taken as a parameterless procedure with a void return. 1111 SHT_HASH 0x5 The section holds a symbol hash table. Currently, 1112 an object file shall have only one hash table, but this 1113 restriction may be relaxed in the future. See `Hash Table' in 1114 the Chapter 5 for details. 1115 SHT_INIT_ARRAY 0xe This section contains an array of pointers 1116 to initialization functions, as described in `Initialization 1117 and Termination Functions' in Chapter 5. Each pointer in the 1118 array is taken as a parameterless procedure with a void 1119 return. 1120 SHT_NOBITS 0x8 A section of this type occupies no space in the 1121 file but otherwise resembles SHT_PROGBITS. Although this 1122 section contains no bytes, the sh_offset member contains the 1123 conceptual file offset. 1124 SHT_NOTE 0x7 The section holds information that marks the file 1125 in some way. See `Note Section' in Chapter 5 for details. 1126 SHT_NULL 0x0 This value marks the section header as inactive; 1127 it does not have an associated section. Other members of the 1128 section header have undefined values. 1129 SHT_PREINIT_ARRAY 0x10 This section contains an array of 1130 pointers to functions that are invoked before all other 1131 initialization functions, as described in `Initialization and 1132 Termination Functions' in Chapter 5. Each pointer in the array 1133 is taken as a parameterless proceure with a void return. 1134 SHT_PROGBITS 0x1 The section holds information defined by the 1135 program, whose format and meaning are determined solely by the 1136 program. 1137 SHT_REL 0x9 The section holds relocation entries without 1138 explicit addends, such as type Elf32_Rel for the 32-bit class 1139 of object files or type Elf64_Rel for the 64-bit class of 1140 object files. An object file may have multiple relocation 1141 sections. See "Relocation" 1142 SHT_RELA 0x4 The section holds relocation entries with 1143 explicit addends, such as type Elf32_Rela for the 32-bit class 1144 of object files or type Elf64_Rela for the 64-bit class of 1145 object files. An object file may have multiple relocation 1146 sections. `Relocation' b 1147 SHT_STRTAB 0x3 The section holds a string table. An object 1148 file may have multiple string table sections. See `String 1149 Table' below for details. 1150 SHT_SYMTAB 0x2 This section holds a symbol table. Currently, 1151 an object file may have either a section of SHT_SYMTAB type or 1152 a section of SHT_DYNSYM type, but not both. This restriction 1153 may be relaxed in the future. Typically, SHT_SYMTAB provides 1154 symbols for link editing, though it may also be used for 1155 dynamic linking. As a complete symbol table, it may contain 1156 many symbols unnecessary for dynamic linking. 1157 _________________________________________________________ 1158 1159 11.2.2.2. Additional Section Types 1160 1161 The following additional section types are defined here. 1162 1163 Table 11-2. Additional Section Types 1164 Name Value Description 1165 SHT_GNU_verdef 0x6ffffffd This section contains the symbol 1166 versions that are provided. 1167 SHT_GNU_verneed 0x6ffffffe This section contains the symbol 1168 versions that are required. 1169 SHT_GNU_versym 0x6fffffff This section contains the Symbol 1170 Version Table. 1171 _________________________________________________________ 1172 1173 11.3. Special Sections 1174 1175 11.3.1. Special Sections 1176 1177 Various sections hold program and control information. 1178 Sections in the lists below are used by the system and have 1179 the indicated types and attributes. 1180 _________________________________________________________ 1181 1182 11.3.1.1. ELF Special Sections 1183 1184 The following sections are defined in the System V ABI and the 1185 System V ABI Update. 1186 1187 Table 11-3. ELF Special Sections 1188 Name Type Attributes 1189 .bss SHT_NOBITS SHF_ALLOC+SHF_WRITE 1190 .comment SHT_PROGBITS 0 1191 .data SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1192 .data1 SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1193 .debug SHT_PROGBITS 0 1194 .dynamic SHT_DYNAMIC SHF_ALLOC+SHF_WRITE 1195 .dynstr SHT_STRTAB SHF_ALLOC 1196 .dynsym SHT_DYNSYM SHF_ALLOC 1197 .fini SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 1198 .fini_array SHT_FINI_ARRAY SHF_ALLOC+SHF_WRITE 1199 .hash SHT_HASH SHF_ALLOC 1200 .init SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 1201 .init_array SHT_INIT_ARRAY SHF_ALLOC+SHF_WRITE 1202 .interp SHT_PROGBITS SHF_ALLOC 1203 .line SHT_PROGBITS 0 1204 .note SHT_NOTE 0 1205 .preinit_array SHT_PREINIT_ARRAY SHF_ALLOC+SHF_WRITE 1206 .rodata SHT_PROGBITS SHF_ALLOC 1207 .rodata1 SHT_PROGBITS SHF_ALLOC 1208 .shstrtab SHT_STRTAB 0 1209 .strtab SHT_STRTAB SHF_ALLOC 1210 .symtab SHT_SYMTAB SHF_ALLOC 1211 .tbss SHT_NOBITS SHF_ALLOC+SHF_WRITE+SHF_TLS 1212 .tdata SHT_PROGBITS SHF_ALLOC+SHF_WRITE+SHF_TLS 1213 .text SHT_PROGBITS SHF_ALLOC+SHF_EXECINSTR 1214 1215 .bss 1216 1217 This section holds data that contributes to the program's 1218 memory image. The program may treat this data as 1219 uninitialized. However, the system shall initialize this data 1220 with zeroes when the program begins to run. The section 1221 occupies no file space, as indicated by the section type, 1222 SHT_NOBITS 1223 .comment 1224 1225 This section holds version control information. 1226 .data 1227 1228 This section holds initialized data that contribute to the 1229 program's memory image. 1230 .data1 1231 1232 This section holds initialized data that contribute to the 1233 program's memory image. 1234 .debug 1235 1236 This section holds information for symbolic debugging. The 1237 contents are unspecified. All section names with the prefix 1238 .debug hold information for symbolic debugging. The contents 1239 of these sections are unspecified. 1240 .dynamic 1241 1242 This section holds dynamic linking information. The section's 1243 attributes will include the SHF_ALLOC bit. Whether the 1244 SHF_WRITE bit is set is processor specific. See Chapter 5 for 1245 more information. 1246 .dynstr 1247 1248 This section holds strings needed for dynamic linking, most 1249 commonly the strings that represent the names associated with 1250 symbol table entries. See Chapter 5 for more information. 1251 .dynsym 1252 1253 This section holds the dynamic linking symbol table, as 1254 described in `Symbol Table'. See Chapter 5 for more 1255 information. 1256 .fini 1257 1258 This section holds executable instructions that contribute to 1259 the process termination code. That is, when a program exits 1260 normally, the system arranges to execute the code in this 1261 section. 1262 .fini_array 1263 1264 This section holds an array of function pointers that 1265 contributes to a single termination array for the executable 1266 or shared object containing the section. 1267 .hash 1268 1269 This section holds a symbol hash table. See `Hash Table' in 1270 Chapter 5 for more information. 1271 .init 1272 1273 This section holds executable instructions that contribute to 1274 the process initialization code. When a program starts to run, 1275 the system arranges to execute the code in this section before 1276 calling the main program entry point (called main for C 1277 programs) 1278 .init_array 1279 1280 This section holds an array of function pointers that 1281 contributes to a single initialization array for the 1282 executable or shared object containing the section. 1283 .interp 1284 1285 This section holds the path name of a program interpreter. If 1286 the file has a loadable segment that includes relocation, the 1287 sections' attributes will include the SHF_ALLOC bit; 1288 otherwise, that bit will be off. See Chapter 5 for more 1289 information. 1290 .line 1291 1292 This section holds line number information for symbolic 1293 debugging, which describes the correspondence between the 1294 source program and the machine code. The contents are 1295 unspecified. 1296 .note 1297 1298 This section holds information in the format that `Note 1299 Section' in Chapter 5 describes of the System V Application 1300 Binary Interface, Edition 4.1. 1301 .preinit_array 1302 1303 This section holds an array of function pointers that 1304 contributes to a single pre-initialization array for the 1305 executable or shared object containing the section. 1306 .rodata 1307 1308 This section holds read-only data that typically contribute to 1309 a non-writable segment in the process image. See `Program 1310 Header' in Chapter 5 for more information. 1311 .rodata1 1312 1313 This section hold sread-only data that typically contribute to 1314 a non-writable segment in the process image. See `Program 1315 Header' in Chapter 5 for more information. 1316 .shstrtab 1317 1318 This section holds section names. 1319 .strtab 1320 1321 This section holds strings, most commonly the strings that 1322 represent the names associated with symbol table entries. If 1323 the file has a loadable segment that includes the symbol 1324 string table, the section's attributes will include the 1325 SHF_ALLOC bit; otherwi 1326 .symtab 1327 1328 This section holds a symbol table, as `Symbol Table'. in this 1329 chapter describes. If the file has a loadable segment that 1330 includes the symbol table, the section's attributes will 1331 include the SHF_ALLOC bit; otherwise, that bit will be off. 1332 .tbss 1333 1334 This section holds uninitialized thread-local data that 1335 contribute to the program's memory image. By definition, the 1336 system initializes the data with zeros when the data is 1337 instantiated for each new execution flow. The section occupies 1338 no file space, as indicated by the section type, SHT_NOBITS. 1339 Implementations need not support thread-local storage. 1340 .tdata 1341 1342 This section holds initialized thread-local data that 1343 contributes to the program's memory image. A copy of its 1344 contents is instantiated by the system for each new execution 1345 flow. Implementations need not support thread-local storage. 1346 .text 1347 1348 This section holds the `text,' or executable instructions, of 1349 a program. 1350 _________________________________________________________ 1351 1352 11.3.1.2. Additional Special Sections 1353 1354 Object files in an LSB conforming application may also contain 1355 one or more of the additional special sections described 1356 below. 1357 1358 Table 11-4. Additional Special Sections 1359 Name Type Attributes 1360 .ctors SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1361 .data.rel.ro SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1362 .dtors SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1363 .eh_frame SHT_PROGBITS SHF_ALLOC 1364 .eh_frame_hdr SHT_PROGBITS SHF_ALLOC 1365 .gcc_except_table SHT_PROGBITS SHF_ALLOC 1366 .gnu.version SHT_GNU_versym SHF_ALLOC 1367 .gnu.version_d SHT_GNU_verdef SHF_ALLOC 1368 .gnu.version_r SHT_GNU_verneed SHF_ALLOC 1369 .got.plt SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1370 .jcr SHT_PROGBITS SHF_ALLOC+SHF_WRITE 1371 .note.ABI-tag SHT_NOTE SHF_ALLOC 1372 .stab SHT_PROGBITS 0 1373 .stabstr SHT_STRTAB 0 1374 1375 .ctors 1376 1377 This section contains a list of global constructor function 1378 pointers. 1379 .data.rel.ro 1380 1381 This section holds initialized data that contribute to the 1382 program's memory image. This section may be made read-only 1383 after relocations have been applied. 1384 .dtors 1385 1386 This section contains a list of global destructor function 1387 pointers. 1388 .eh_frame 1389 1390 This section contains information necessary for frame 1391 unwinding during exception handling. See Section 11.6.1. 1392 .eh_frame_hdr 1393 1394 This section contains a pointer to the .eh_frame section which 1395 is accessible to the runtime support code of a C++ 1396 application. This section may also contain a binary search 1397 table which may be used by the runtime support code to more 1398 efficiently access records in the .eh_frame section. See 1399 Section 11.6.2. 1400 .gcc_except_table 1401 1402 This section holds Language Specific Data. 1403 .gnu.version 1404 1405 This section contains the Symbol Version Table. See Section 1406 11.7.2. 1407 .gnu.version_d 1408 1409 This section contains the Version Definitions. See Section 1410 11.7.3. 1411 .gnu.version_r 1412 1413 This section contains the Version Requirements. See Section 1414 11.7.4. 1415 .got.plt 1416 1417 This section holds the read-only portion of the GLobal Offset 1418 Table. This section may be made read-only after relocations 1419 have been applied. 1420 .jcr 1421 1422 This section contains information necessary for registering 1423 compiled Java classes. The contents are compiler-specific and 1424 used by compiler initialization functions. 1425 .note.ABI-tag 1426 1427 Specify ABI details. See Section 11.8. 1428 .stab 1429 1430 This section contains debugging information. The contents are 1431 not specified as part of the LSB. 1432 .stabstr 1433 1434 This section contains strings associated with the debugging 1435 infomation contained in the .stab section. 1436 _________________________________________________________ 1437 1438 11.4. Symbol Mapping 1439 1440 11.4.1. Introduction 1441 1442 Symbols in a source program are translated by the compilation 1443 system into symbols that exist in the object file. 1444 _________________________________________________________ 1445 1446 11.4.1.1. C Language 1447 1448 External C symbols shall be unchanged in an object file's 1449 symbol table. 1450 _________________________________________________________ 1451 1452 11.5. DWARF Extensions 1453 1454 The LSB does not specify debugging information, however, some 1455 additional sections contain information which is encoded using 1456 the the encoding as specified by DWARF Debugging Information 1457 Format, Revision 2.0.0 with extensions defined here. 1458 1459 Note: The extensions specified here also exist in DWARF 1460 Debugging Information Format, Revision 3.0.0 (Draft). It is 1461 expected that future versions of the LSB will reference the 1462 final version of that document, and that the definitions 1463 here will be taken from that document instead of being 1464 specified here. 1465 _________________________________________________________ 1466 1467 11.5.1. DWARF Exception Header Encoding 1468 1469 The DWARF Exception Header Encoding is used to describe the 1470 type of data used in the .eh_frame and .eh_frame_hdr section. 1471 The upper 4 bits indicate how the value is to be applied. The 1472 lower 4 bits indicate the format of the data. 1473 1474 Table 11-5. DWARF Exception Header value format 1475 Name Value Meaning 1476 DW_EH_PE_absptr 0x00 The Value is a literal pointer whose size 1477 is determined by the architecture. 1478 DW_EH_PE_uleb128 0x01 Unsigned value is encoded using the 1479 Little Endian Base 128 (LEB128) as defined by DWARF Debugging 1480 Information Format, Revision 2.0.0. 1481 DW_EH_PE_udata2 0x02 A 2 bytes unsigned value. 1482 DW_EH_PE_udata4 0x03 A 4 bytes unsigned value. 1483 DW_EH_PE_udata8 0x04 An 8 bytes unsigned value. 1484 DW_EH_PE_sleb128 0x09 Signed value is encoded using the Little 1485 Endian Base 128 (LEB128) as defined by DWARF Debugging 1486 Information Format, Revision 2.0.0. 1487 DW_EH_PE_sdata2 0x0A A 2 bytes signed value. 1488 DW_EH_PE_sdata4 0x0B A 4 bytes signed value. 1489 DW_EH_PE_sdata8 0x0C An 8 bytes signed value. 1490 1491 Table 11-6. DWARF Exception Header application 1492 Name Value Meaning 1493 DW_EH_PE_pcrel 0x10 Value is relative to the current program 1494 counter. 1495 DW_EH_PE_textrel 0x20 Value is relative to the beginning of 1496 the .text section. 1497 DW_EH_PE_datarel 0x30 Value is relative to the beginning of 1498 the .got or .eh_frame_hdr section. 1499 DW_EH_PE_funcrel 0x40 Value is relative to the beginning of 1500 the function. 1501 DW_EH_PE_aligned 0x50 Value is aligned to an address unit 1502 sized boundary. 1503 1504 One special encoding, 0xff (DW_EH_PE_omit), shall be used to 1505 indicate that no value ispresent. 1506 _________________________________________________________ 1507 1508 11.5.2. DWARF CFI Extensions 1509 1510 In addition to the Call Frame Instructions defined in section 1511 6.4.2 of DWARF Debugging Information Format, Revision 2.0.0, 1512 the following additional Call Frame Instructions may also be 1513 used. 1514 1515 Table 11-7. Additional DWARF Call Frame Instructions 1516 Name Value Meaning 1517 DW_CFA_expression 0x10 The DW_CFA_expression instruction takes 1518 two operands: an unsigned LEB128 value representing a register 1519 number, and a DW_FORM_block value representing a DWARF 1520 expression. The required action is to establish the DWARF 1521 expression as the means by which the address in which the 1522 given register contents are found may be computed. The value 1523 of the CFA is pushed on the DWARF evaluation stack prior to 1524 execution of the DWARF expression. The DW_OP_call2, 1525 DW_OP_call4, DW_OP_call_ref and DW_OP_push_object_address 1526 DWARF operators (see Section 2.4.1 of DWARF Debugging 1527 Information Format, Revision 2.0.0) cannot be used in such a 1528 DWARF expression. 1529 DW_CFA_offset_extended_sf 0x11 The DW_CFA_offset_extended_sf 1530 instruction takes two operands: an unsigned LEB128 value 1531 representing a register number and a signed LEB128 factored 1532 offset. This instruction is identical to 1533 DW_CFA_offset_extended except that the second operand is 1534 signed. 1535 DW_CFA_def_cfa_sf 0x12 The DW_CFA_def_cfa_sf instruction takes 1536 two operands: an unsigned LEB128 value representing a register 1537 number and a signed LEB128 factored offset. This instruction 1538 is identical to DW_CFA_def_cfa except that the second operand 1539 is signed and factored. 1540 DW_CFA_def_cfa_offset_sf 0x13 The DW_CFA_def_cfa_offset_sf 1541 instruction takes a signed LEB128 operand representing a 1542 factored offset. This instruction is identical to 1543 DW_CFA_def_cfa_offset except that the operand is signed and 1544 factored. 1545 DW_CFA_GNU_args_size 0x2e The DW_CFA_GNU_args_size instruction 1546 takes an unsigned LEB128 operand representing an argument 1547 size. This instruction specifies the total of the size of the 1548 arguments which have been pushed onto the stack. 1549 DW_CFA_GNU_negative_offset_extended 0x2f The DW_CFA_def_cfa_sf 1550 instruction takes two operands: an unsigned LEB128 value 1551 representing a register number and an unsigned LEB128 which 1552 represents the magnitude of the offset. This instruction is 1553 identical to DW_CFA_offset_extended_sf except that the operand 1554 is subtracted to produce the offset. This instructions is 1555 obsoleted by DW_CFA_offset_extended_sf. 1556 _________________________________________________________ 1557 1558 11.6. Exception Frames 1559 1560 When using languages that support exceptions, such as C++, 1561 additional information must be provided to the runtime 1562 environment that describes the call frames that must be 1563 unwound during the processing of an exception. This 1564 information is contained in the special sections .eh_frame and 1565 .eh_framehdr. 1566 1567 Note: The format of the .eh_frame section is similar in 1568 format and purpose to the .debug_frame section which is 1569 specified in DWARF Debugging Information Format, Revision 1570 3.0.0 (Draft). Readers are advised that there are some 1571 subtle difference, and care should be taken when comparing 1572 the two sections. 1573 _________________________________________________________ 1574 1575 11.6.1. The .eh_frame section 1576 1577 The .eh_frame section shall contain 1 or more Call Frame 1578 Information (CFI) records. The number of records present shall 1579 be determined by size of the section as contained in the 1580 section header. Each CFI record contains a Common Information 1581 Entry (CIE) record followed by 1 or more Frame Description 1582 Entry (FDE) records. Both CIEs and FDEs shall be aligned to an 1583 addressing unit sized boundary. 1584 1585 Table 11-8. Call Frame Information Format 1586 Common Information Entry Record 1587 Frame Description Entry Record(s) 1588 _________________________________________________________ 1589 1590 11.6.1.1. The Common Information Entry Format 1591 1592 Table 11-9. Common Information Entry Format 1593 Length Required 1594 Extended Length Optional 1595 CIE ID Required 1596 Version Required 1597 Augmentation String Required 1598 Code Alignment Factor Required 1599 Data Alignment Factor Required 1600 Return Address Register Required 1601 Augmentation Data Length Optional 1602 Augmentation Data Optional 1603 Initial Instructions Required 1604 Padding 1605 1606 Length 1607 A 4 byte unsigned value indicating the length in bytes 1608 of the CIE structure, not including the Length field 1609 itself. If Length contains the value 0xffffffff, then 1610 the length is contained in the Extended Length field. 1611 If Length contains the value 0, then this CIE shall be 1612 considered a terminator and processing shall end. 1613 1614 Extended Length 1615 A 8 byte unsigned value indicating the length in bytes 1616 of the CIE structure, not including the Length and 1617 Extended Length fields. 1618 1619 CIE ID 1620 A 4 byte unsigned value that is used to distinguish CIE 1621 records from FDE records. This value shall always be 0, 1622 which indicates this record is a CIE. 1623 1624 Version 1625 A 1 byte value that identifies the version number of 1626 the frame information structure. This value shall be 1. 1627 1628 Augmentation String 1629 This value is a NUL terminated string that identifies 1630 the augmentation to the CIE or to the FDEs associated 1631 with this CIE. A zero length string indicates that no 1632 augmentation data is present. The augmentation string 1633 is case sensitive and shall be interpreted as described 1634 below. 1635 1636 Code Alignment Factor 1637 An unsigned LEB128 encoded value that is factored out 1638 of all advance location instructions that are 1639 associated with this CIE or its FDEs. This value shall 1640 be multiplied by the delta argument of an adavance 1641 location instruction to obtain the new location value. 1642 1643 Data Alignment Factor 1644 A signed LEB128 encoded value that is factored out of 1645 all offset instructions that are associated with this 1646 CIE or its FDEs. This value shall be multiplied by the 1647 register offset argument of an offset instruction to 1648 obtain the new offset value. 1649 1650 Augmentation Length 1651 An unsigned LEB128 encoded value indicating the length 1652 in bytes of the Augmentation Data. This field is only 1653 present if the Augmentation String contains the 1654 character 'z'. 1655 1656 Augmentation Data 1657 A block of data whose contents are defined by the 1658 contents of the Augmentation String as described below. 1659 This field is only present if the Augmentation String 1660 contains the character 'z'. The size of this data is 1661 given by the Augentation Length. 1662 1663 Initial Instructions 1664 Initial set of Call Frame Instructions. The number of 1665 instructions is determined by the remaining space in 1666 the CIE record. 1667 1668 Padding 1669 Extra bytes to align the CIE structure to an addressing 1670 unit size boundary. 1671 _________________________________________________________ 1672 1673 11.6.1.1.1. Augmentation String Format 1674 1675 The Agumentation String indicates the presence of some 1676 optional fields, and how those fields should be intepreted. 1677 This string is case sensitive. Each character in the 1678 augmentation string in the CIE can be interpreted as below: 1679 1680 'z' 1681 1682 A 'z' may be present as the first character of the string. If 1683 present, the Augmentation Data field shall be present. The 1684 contents of the Augmentation Data shall be intepreted 1685 according to other characters in the Augmentation String. 1686 'L' 1687 1688 A 'L' may be present at any position after the first character 1689 of the string. This character may only be present if 'z' is 1690 the first character of the string. If present, it indicates 1691 the presence of one argument in the Augmentation Data of the 1692 CIE, and a corresponding argument in the Augmentation Data of 1693 the FDE. The argument in the Augmentation Data of the CIE is 1694 1-byte and represents the pointer encoding used for the 1695 argument in the Augmentation Data of the FDE, which is the 1696 address of a language-specific data area (LSDA). The size of 1697 the LSDA pointer is specified by the pointer encoding used. 1698 'P' 1699 1700 A 'P' may be present at any position after the first character 1701 of the string. This character may only be present if 'z' is 1702 the first character of the string. If present, it indicates 1703 the presence of two arguments in the Augmentation Data of the 1704 CIE. The first argument is 1-byte and represents the pointer 1705 encoding used for the second argument, which is the address of 1706 a personality routine handler. The personality routine is used 1707 to handle language and vendor-specific tasks. The system 1708 unwind library interface accesses the language-specific 1709 exception handling semantics via the pointer to the 1710 personality routine. The personality routine does not have an 1711 ABI-specific name. The size of the personality routine pointer 1712 is specified by the pointer encoding used. 1713 'R' 1714 1715 A 'R' may be present at any position after the first character 1716 of the string. This character may only be present if 'z' is 1717 the first character of the string. If present, The 1718 Augmentation Data shall include a 1 byte argument that 1719 represents the pointer encoding for the address pointers used 1720 in the FDE. 1721 _________________________________________________________ 1722 1723 11.6.1.2. The Frame Description Entry Format 1724 1725 Table 11-10. Frame Description Entry Format 1726 Length Required 1727 Extended Length Optional 1728 CIE Pointer Required 1729 PC Begin Required 1730 PC Range Required 1731 Augmentation Data Length Optional 1732 Augmentation Data Optional 1733 Call Frame Instructions Required 1734 Padding 1735 1736 Length 1737 A 4 byte unsigned value indicating the length in bytes 1738 of the CIE structure, not including the Length field 1739 itself. If Length contains the value 0xffffffff, then 1740 the length is contained the Extended Length field. If 1741 Length contains the value 0, then this CIE shall be 1742 considered a terminator and processing shall end. 1743 1744 Extended Length 1745 A 8 byte unsigned value indicating the length in bytes 1746 of the CIE structure, not including the Length field 1747 itself. 1748 1749 CIE Pointer 1750 A 4 byte unsigned value that when subtracted from the 1751 offset of the current FDE yields the offset of the 1752 start of the associated CIE. This value shall never be 1753 0. 1754 1755 PC Begin 1756 An encoded value that indicates the address of the 1757 initial location associated with this FDE. The encoding 1758 format is specified in the Augmentation Data. 1759 1760 PC Range 1761 An absolute value that indicates the number of bytes of 1762 instructions associated with this FDE. 1763 1764 Augmentation Length 1765 An unsigned LEB128 encoded value indicating the length 1766 in bytes of the Augmentation Data. This field is only 1767 present if the Augmentation String in the associated 1768 CIE contains the character 'z'. 1769 1770 Augmentation Data 1771 A block of data whose contents are defined by the 1772 contents of the Augmentation String in the associated 1773 CIE as described above. This field is only present if 1774 the Augmentation String in the associated CIE contains 1775 the character 'z'. The size of this data is given by 1776 the Augentation Length. 1777 1778 Call Frame Instructions 1779 A set of Call Frame Instructions. 1780 1781 Padding 1782 Extra bytes to align the FDE structure to an addressing 1783 unit size boundary. 1784 _________________________________________________________ 1785 1786 11.6.2. The .eh_frame_hdr section 1787 1788 The .eh_frame_hdr section contains additional information 1789 about the .eh_frame section. A pointer to the start of the 1790 .eh_frame data, and optionally, a binary search table of 1791 pointers to the .eh_frame records are found in this section. 1792 1793 Data in this section is encoded according to Section 11.5.1. 1794 1795 Table 11-11. .eh_frame_hdr Section Format 1796 Encoding Field 1797 unsigned byte version 1798 unsigned byte eh_frame_ptr_enc 1799 unsigned byte fde_count_enc 1800 unsigned byte table_enc 1801 encoded eh_frame_ptr 1802 encoded fde_count 1803 binary search table 1804 1805 version 1806 1807 Version of the .eh_frame_hdr format. This value shall be 1. 1808 eh_frame_ptr_enc 1809 1810 The encoding format of the eh_frame_ptr field. 1811 fde_count_enc 1812 1813 The encoding format of the fde_count field. A value of 1814 DW_EH_PE_omit indicates the binary search table is not 1815 present. 1816 table_enc 1817 1818 The encoding format of the entries in the binary search table. 1819 A value of DW_EH_PE_omit indicates the binary search table is 1820 not present. 1821 eh_frame_ptr 1822 1823 The encoded value of the pointer to the start of the .eh_frame 1824 section. 1825 fde_count 1826 1827 The encoded value of the count of entries in the binary search 1828 table. 1829 binary search table 1830 1831 A binary search table containing fde_count entries. Each entry 1832 of the table consist of two encoded values, the initial 1833 location, and the address. The entries are sorted in an 1834 increasing order by the initial location value. 1835 _________________________________________________________ 1836 1837 11.7. Symbol Versioning 1838 1839 11.7.1. Introduction 1840 1841 This chapter describes the Symbol Versioning mechanism. All 1842 ELF objects may provide or depend on versioned symbols. Symbol 1843 Versioning is implemented by 3 section types: SHT_GNU_versym, 1844 SHT_GNU_verdef, and SHT_GNU_verneed. 1845 1846 The prefix Elfxx in the following descriptions and code 1847 fragments stands for either "Elf32" or "Elf64", depending on 1848 the architecture. 1849 1850 Versions are described by strings. The structures that are 1851 used for symbol versions also contain a member that holds the 1852 ELF hashing values of the strings. This allows for more 1853 efficient processing. 1854 _________________________________________________________ 1855 1856 11.7.2. Symbol Version Table 1857 1858 The special section .gnu.version which has a section type of 1859 SHT_GNU_versym shall contain the Symbol Version Table. This 1860 section shall have the same number of entries as the Dynamic 1861 Symbol Table in the .dynsym section. 1862 1863 The .gnu.version section shall contain an array of elements of 1864 type Elfxx_Half. Each entry specifies the version defined for 1865 or required by the corresponding symbol in the Dynamic Symbol 1866 Table. 1867 1868 The values in the Symbol Version Table are specific to the 1869 object in which they are located. These values are identifiers 1870 that are provided by the the vna_other member of the 1871 Elfxx_Vernaux structure or the vd_ndx member of the 1872 Elfxx_Verdef structure. 1873 1874 The values 0 and 1 are reserved. 1875 1876 0 1877 1878 The symbol is local, not available outside the object. 1879 1 1880 1881 The symbol is defined in this object and is globally 1882 available. 1883 1884 All other values are used to identify version strings located 1885 in one of the other Symbol Version sections. The value itself 1886 is not the version associated with the symbol. The string 1887 identified by the value defines the version of the symbol. 1888 _________________________________________________________ 1889 1890 11.7.3. Version Definitions 1891 1892 The special section .gnu.version_d which has a section type of 1893 SHT_GNU_verdef shall contain symbol version definitions. The 1894 number of entries in this section shall be contained in the 1895 DT_VERDEFNUM entry of the Dynamic Section .dynamic. The 1896 sh_link member of the section header (see figure 4-8 in the 1897 System V ABI) shall point to the section that contains the 1898 strings referenced by this section. 1899 1900 The section shall contain an array of Elfxx_Verdef structures, 1901 as described in Figure 11-1, optionally followed by an array 1902 of Elfxx_Verdaux structures, as defined in Figure 11-2. 1903 typedef struct { 1904 Elfxx_Half vd_version; 1905 Elfxx_Half vd_flags; 1906 Elfxx_Half vd_ndx; 1907 Elfxx_Half vd_cnt; 1908 Elfxx_Word vd_hash; 1909 Elfxx_Word vd_aux; 1910 Elfxx_Word vd_next; 1911 } Elfxx_Verdef; 1912 1913 Figure 11-1. Version Definition Entries 1914 1915 vd_version 1916 1917 Version revision. This field shall be set to 1. 1918 vd_flags 1919 1920 Version information flag bitmask. 1921 vd_ndx 1922 1923 Version index numeric value referencing the SHT_GNU_versym 1924 section. 1925 vd_cnt 1926 1927 Number of associated verdaux array entries. 1928 vd_hash 1929 1930 Version name hash value (ELF hash function). 1931 vd_aux 1932 1933 Offset in bytes to a corresponding entry in an array of 1934 Elfxx_Verdaux structures as defined in Figure 11-2 1935 vd_next 1936 1937 Offset to the next verdef entry, in bytes. 1938 typedef struct { 1939 Elfxx_Word vda_name; 1940 Elfxx_Word vda_next; 1941 } Elfxx_Verdaux; 1942 1943 Figure 11-2. Version Definition Auxiliary Entries 1944 1945 vda_name 1946 1947 Offset to the version or dependency name string in the section 1948 header, in bytes. 1949 vda_next 1950 1951 Offset to the next verdaux entry, in bytes. 1952 _________________________________________________________ 1953 1954 11.7.4. Version Requirements 1955 1956 The special section .gnu.version_r which has a section type of 1957 SHT_GNU_verneed shall contain required symbol version 1958 definitions. The number of entries in this section shall be 1959 contained in the DT_VERNEEDNUM entry of the Dynamic Section 1960 .dynamic. The sh_link member of the section header (see figure 1961 4-8 in System V ABI) shall point to the section that contains 1962 the strings referenced by this section. 1963 1964 The section shall contain an array of Elfxx_Verneed 1965 structures, as described in Figure 11-3, optionally followed 1966 by an array of Elfxx_Vernaux structures, as defined in Figure 1967 11-4. 1968 typedef struct { 1969 Elfxx_Half vn_version; 1970 Elfxx_Half vn_cnt; 1971 Elfxx_Word vn_file; 1972 Elfxx_Word vn_aux; 1973 Elfxx_Word vn_next; 1974 } Elfxx_Verneed; 1975 1976 Figure 11-3. Version Needed Entries 1977 1978 vn_version 1979 1980 Version of structure. This value is currently set to 1, and 1981 will be reset if the versioning implementation is incompatibly 1982 altered. 1983 vn_cnt 1984 1985 Number of associated verneed array entries. 1986 vn_file 1987 1988 Offset to the file name string in the section header, in 1989 bytes. 1990 vn_aux 1991 1992 Offset to a corresponding entry in the vernaux array, in 1993 bytes. 1994 vn_next 1995 1996 Offset to the next verneed entry, in bytes. 1997 typedef struct { 1998 Elfxx_Word vna_hash; 1999 Elfxx_Half vna_flags; 2000 Elfxx_Half vna_other; 2001 Elfxx_Word vna_name; 2002 Elfxx_Word vna_next; 2003 } Elfxx_Vernaux; 2004 2005 Figure 11-4. Version Needed Auxiliary Entries 2006 2007 vna_hash 2008 2009 Dependency name hash value (ELF hash function). 2010 vna_flags 2011 2012 Dependency information flag bitmask. 2013 vna_other 2014 2015 Object file version identifier used in the .gnu.version symbol 2016 version array. Bit number 15 controls whether or not the 2017 object is hidden; if this bit is set, the object cannot be 2018 used and the static linker will ignore the symbol's presence 2019 in the object. 2020 vna_name 2021 2022 Offset to the dependency name string in the section header, in 2023 bytes. 2024 vna_next 2025 2026 Offset to the next vernaux entry, in bytes. 2027 _________________________________________________________ 2028 2029 11.7.5. Startup Sequence 2030 2031 When loading a sharable object the system shall analyze 2032 version definition data from the loaded object to assure that 2033 it meets the version requirements of the calling object. This 2034 step is referred to as definition testing. The dynamic loader 2035 shall retrieve the entries in the caller's Elfxx_Verneed array 2036 and attempt to find matching definition information in the 2037 loaded Elfxx_Verdef table. 2038 2039 Each object and dependency shall be tested in turn. If a 2040 symbol definition is missing and the vna_flags bit for 2041 VER_FLG_WEAK is not set, the loader shall return an error and 2042 exit. If the vna_flags bit for VER_FLG_WEAK is set in the 2043 Elfxx_Vernaux entry, and the loader shall issue a warning and 2044 continue operation. 2045 2046 When the versions referenced by undefined symbols in the 2047 loaded object are found, version availability is certified. 2048 The test completes without error and the object shall be made 2049 available. 2050 _________________________________________________________ 2051 2052 11.7.6. Symbol Resolution 2053 2054 When symbol versioning is used in an object, relocations 2055 extend definition testing beyond the simple match of symbol 2056 name strings: the version of the reference shall also equal 2057 the name of the definition. 2058 2059 The same index that is used in the symbol table can be 2060 referenced in the SHT_GNU_versym section, and the value of 2061 this index is then used to acquire name data. The 2062 corresponding requirement string is retrieved from the 2063 Elfxx_Verneed array, and likewise, the corresponding 2064 definition string from the Elfxx_Verdef table. 2065 2066 If the high order bit (bit number 15) of the version symbolis 2067 set, the object cannot be used and the static linker shall 2068 ignore the symbol's presence in the object. 2069 2070 When an object with a reference and an object with the 2071 definition are being linked, the following rules shall govern 2072 the result: 2073 2074 * The object with the reference and the object with the 2075 definitions both use versioning. All described matching is 2076 processed in this case. A fatal error shall be triggered 2077 when no matching definition can be found in the object 2078 whose name is the one referenced by the vn_name element in 2079 the Elfxx_Verneed entry. 2080 * The object with the reference does not use versioning, 2081 while the object with the definitions does. In this 2082 instance, only the definitions with index numbers 1 and 2 2083 will be used in the reference match, the same identified 2084 by the static linker as the base definition. In cases 2085 where the static linker was not used, such as in calls to 2086 dlopen(), a version that does not have the base definition 2087 index shall be acceptable if it is the only version for 2088 which the symbol is defined. 2089 * The object with the reference uses versioning, but the 2090 object with the definitions specifies none. A matching 2091 symbol shall be accepted in this case. A fatal error shall 2092 be triggered if a corruption in the required symbols list 2093 obscures an outdated object file and causes a match on the 2094 object filename in the Elfxx_Verneed entry. 2095 * Neither the object with the reference nor the object with 2096 the definitions use versioning. The behavior in this 2097 instance shall default to pre-existing symbol rules. 2098 _________________________________________________________ 2099 2100 11.8. ABI note tag 2101 2102 Every executable shall contain a section named .note.ABI-tag 2103 of type SHT_NOTE. This section is structured as a note section 2104 as documented in the ELF spec. The section shall contain at 2105 least the following entry. The name field (namesz/name) 2106 contains the string "GNU". The type field shall be 1. The 2107 descsz field shall be at least 16, and the first 16 bytes of 2108 the desc field shall be as follows. 2109 2110 The first 32-bit word of the desc field shall be 0 (this 2111 signifies a Linux executable). The second, third, and fourth 2112 32-bit words of the desc field contain the earliest compatible 2113 kernel version. For example, if the 3 words are 2, 2, and 5, 2114 this signifies a 2.2.5 kernel. 2115 _________________________________________________________ 2116 2117 Chapter 12. Dynamic Linking 2118 2119 12.1. Program Loading and Dynamic Linking 2120 2121 LSB-conforming implementations shall support the object file 2122 information and system actions that create running programs as 2123 specified in the System V ABI and System V ABI Update and as 2124 further required by this specification and its architecture 2125 specific supplement. 2126 2127 Any shared object that is loaded shall contain sufficient 2128 DT_NEEDED records to satisfy the symbols on the shared 2129 library. 2130 _________________________________________________________ 2131 2132 12.2. Program Header 2133 2134 In addition to the Segment Types defined in the System V ABI 2135 and System V ABI Update the following Segment Types shall also 2136 be supported. 2137 2138 Table 12-1. Linux Segment Types 2139 Name Value 2140 PT_GNU_EH_FRAME 0x6474e550 2141 PT_GNU_STACK 0x6474e551 2142 PT_GNU_RELRO 0x6474e552 2143 2144 PT_GNU_EH_FRAME 2145 2146 The array element specifies the location and size of the 2147 exception handling information as defined by the .eh_frame_hdr 2148 section. 2149 PT_GNU_STACK 2150 2151 The p_flags member specifies the permissions on the segment 2152 containing the stack and is used to indicate wether the stack 2153 should be executable. The absense of this header indicates 2154 that the stack will be executable. 2155 PT_GNU_RELRO 2156 2157 The array element specifies the location and size of a segment 2158 which may be made read-only after relocation shave been 2159 processed. 2160 _________________________________________________________ 2161 2162 12.3. Dynamic Entries 2163 2164 12.3.1. Introduction 2165 2166 As described in System V ABI, if an object file 2167 CHAPTERicipates in dynamic linking, its program header table 2168 shall have an element of type PT_DYNAMIC. This `segment' 2169 contains the .dynamic section. A special symbol, _DYNAMIC, 2170 labels the section, which contains an array of the following 2171 structures. 2172 typedef struct { 2173 Elf32_Sword d_tag; 2174 union { 2175 Elf32_Word d_val; 2176 Elf32_Addr d_ptr; 2177 } d_un; 2178 } Elf32_Dyn; 2179 2180 extern Elf32_Dyn _DYNAMIC[]; 2181 2182 typedef struct { 2183 Elf64_Sxword d_tag; 2184 union { 2185 Elf64_Xword d_val; 2186 Elf64_Addr d_ptr; 2187 } d_un; 2188 } Elf64_Dyn; 2189 2190 extern Elf64_Dyn _DYNAMIC[]; 2191 2192 Figure 12-1. Dynamic Structure 2193 2194 For each object with this type, d_tag controls the 2195 interpretation of d_un. 2196 _________________________________________________________ 2197 2198 12.3.2. Dynamic Entries 2199 _________________________________________________________ 2200 2201 12.3.2.1. ELF Dynamic Entries 2202 2203 The following dynamic entries are defined in the System V ABI 2204 and System V ABI Update. 2205 2206 DT_BIND_NOW 2207 2208 Process relocations of object 2209 DT_DEBUG 2210 2211 For debugging; unspecified 2212 DT_FINI 2213 2214 Address of termination function 2215 DT_HASH 2216 2217 Address of symbol hash table 2218 DT_HIPROC 2219 2220 End of processor-specific 2221 DT_INIT 2222 2223 Address of init function 2224 DT_JMPREL 2225 2226 Address of PLT relocs 2227 DT_LOPROC 2228 2229 Start of processor-specific 2230 DT_NEEDED 2231 2232 Name of needed library 2233 DT_NULL 2234 2235 Marks end of dynamic section 2236 DT_PLTREL 2237 2238 Type of reloc in PLT 2239 DT_PLTRELSZ 2240 2241 Size in bytes of PLT relocs 2242 DT_REL 2243 2244 Address of Rel relocs 2245 DT_RELA 2246 2247 Address of Rela relocs 2248 DT_RELAENT 2249 2250 Size of one Rela reloc 2251 DT_RELASZ 2252 2253 Total size of Rela relocs 2254 DT_RELENT 2255 2256 Size of one Rel reloc 2257 DT_RELSZ 2258 2259 Total size of Rel relocs 2260 DT_RPATH 2261 2262 Library search path 2263 DT_SONAME 2264 2265 Name of shared object 2266 DT_STRSZ 2267 2268 Size of string table 2269 DT_STRTAB 2270 2271 Address of string table 2272 DT_SYMBOLIC 2273 2274 Start symbol search here 2275 DT_SYMENT 2276 2277 Size of one symbol table entry 2278 DT_SYMTAB 2279 2280 Address of symbol table 2281 DT_TEXTREL 2282 2283 Reloc might modify .text 2284 _________________________________________________________ 2285 2286 12.3.2.2. Additional Dynamic Entries 2287 2288 An LSB conforming object may also use the following additional 2289 Dynamic Entry types. 2290 2291 DT_ADDRRNGHI 2292 2293 Values from DT_ADDRRNGLO through DT_ADDRRNGHI are reserved for 2294 definition by an archLSB. 2295 DT_ADDRRNGLO 2296 2297 Values from DT_ADDRRNGLO through DT_ADDRRNGHI are reserved for 2298 definition by an archLSB. 2299 DT_AUXILIARY 2300 2301 Shared object to load before self 2302 DT_FILTER 2303 2304 Shared object to get values from 2305 DT_FINI_ARRAY 2306 2307 The address of an array of pointers to termination functions. 2308 DT_FINI_ARRAYSZ 2309 2310 Size in bytes of DT_FINI_ARRAY 2311 DT_HIOS 2312 2313 Values from DT_LOOS through DT_HIOS are reserved for 2314 definition by specific operating systems. 2315 DT_INIT_ARRAY 2316 2317 The address of an array of pointers to initialization 2318 functions. 2319 DT_INIT_ARRAYSZ 2320 2321 Size in bytes of DT_INIT_ARRAY 2322 DT_LOOS 2323 2324 Values from DT_LOOS through DT_HIOS are reserved for 2325 definition by specific operating systems. 2326 DT_NUM 2327 2328 Number of dynamic entry tags defined (excepting reserved 2329 ranges). 2330 DT_POSFLAG_1 2331 2332 Flags for DT_* entries, effecting the following DT_* entry 2333 DT_RELCOUNT 2334 2335 All Elf32_Rel R_*_RELATIVE relocations have been placed into a 2336 single block and this entry specifies the number of entries in 2337 that block. This permits ld.so.1 to streamline the processing 2338 of RELATIVE relocations. 2339 DT_RUNPATH 2340 2341 null-terminated library search path string 2342 DT_SYMINENT 2343 2344 Entry size of syminfo 2345 DT_SYMINFO 2346 2347 Address of the Syminfo table. 2348 DT_SYMINSZ 2349 2350 Size of syminfo table (in bytes) 2351 DT_VALRNGHI 2352 2353 Entries which fall between DT_VALRNGHI & DT_VALRNGLO use the 2354 Dyn.d_un.d_val field of the Elf*_Dyn structure. 2355 DT_VALRNGLO 2356 2357 Entries which fall between DT_VALRNGHI & DT_VALRNGLO use the 2358 Dyn.d_un.d_val field of the Elf*_Dyn structure. 2359 DT_VERDEF 2360 2361 Address of version definition table 2362 DT_VERDEFNUM 2363 2364 Number of version definitions 2365 DT_VERNEED 2366 2367 Address of table with needed versions 2368 DT_VERNEEDNUM 2369 2370 Number of needed versions 2371 DT_VERSYM 2372 2373 Address of the table provided by the .gnu.version section. 2374 2375 III. Base Libraries 2376 2377 Table of Contents 2378 13. Base Libraries 2379 2380 13.1. Introduction 2381 13.2. Program Interpreter 2382 13.3. Interfaces for libc 2383 2384 13.3.1. RPC 2385 13.3.2. System Calls 2386 13.3.3. Standard I/O 2387 13.3.4. Signal Handling 2388 13.3.5. Localization Functions 2389 13.3.6. Socket Interface 2390 13.3.7. Wide Characters 2391 13.3.8. String Functions 2392 13.3.9. IPC Functions 2393 13.3.10. Regular Expressions 2394 13.3.11. Character Type Functions 2395 13.3.12. Time Manipulation 2396 13.3.13. Terminal Interface Functions 2397 13.3.14. System Database Interface 2398 13.3.15. Language Support 2399 13.3.16. Large File Support 2400 13.3.17. Standard Library 2401 2402 13.4. Data Definitions for libc 2403 2404 13.4.1. arpa/inet.h 2405 13.4.2. assert.h 2406 13.4.3. ctype.h 2407 13.4.4. dirent.h 2408 13.4.5. err.h 2409 13.4.6. errno.h 2410 13.4.7. fcntl.h 2411 13.4.8. fmtmsg.h 2412 13.4.9. fnmatch.h 2413 13.4.10. ftw.h 2414 13.4.11. getopt.h 2415 13.4.12. glob.h 2416 13.4.13. grp.h 2417 13.4.14. iconv.h 2418 13.4.15. inttypes.h 2419 13.4.16. langinfo.h 2420 13.4.17. libgen.h 2421 13.4.18. libintl.h 2422 13.4.19. limits.h 2423 13.4.20. locale.h 2424 13.4.21. monetary.h 2425 13.4.22. net/if.h 2426 13.4.23. netdb.h 2427 13.4.24. netinet/in.h 2428 13.4.25. netinet/ip.h 2429 13.4.26. netinet/tcp.h 2430 13.4.27. netinet/udp.h 2431 13.4.28. nl_types.h 2432 13.4.29. poll.h 2433 13.4.30. pty.h 2434 13.4.31. pwd.h 2435 13.4.32. regex.h 2436 13.4.33. rpc/auth.h 2437 13.4.34. rpc/clnt.h 2438 13.4.35. rpc/pmap_clnt.h 2439 13.4.36. rpc/rpc_msg.h 2440 13.4.37. rpc/svc.h 2441 13.4.38. rpc/types.h 2442 13.4.39. rpc/xdr.h 2443 13.4.40. sched.h 2444 13.4.41. search.h 2445 13.4.42. setjmp.h 2446 13.4.43. signal.h 2447 13.4.44. stddef.h 2448 13.4.45. stdio.h 2449 13.4.46. stdlib.h 2450 13.4.47. string.h 2451 13.4.48. sys/file.h 2452 13.4.49. sys/ioctl.h 2453 13.4.50. sys/ipc.h 2454 13.4.51. sys/mman.h 2455 13.4.52. sys/msg.h 2456 13.4.53. sys/param.h 2457 13.4.54. sys/poll.h 2458 13.4.55. sys/resource.h 2459 13.4.56. sys/sem.h 2460 13.4.57. sys/shm.h 2461 13.4.58. sys/socket.h 2462 13.4.59. sys/stat.h 2463 13.4.60. sys/statvfs.h 2464 13.4.61. sys/time.h 2465 13.4.62. sys/timeb.h 2466 13.4.63. sys/times.h 2467 13.4.64. sys/types.h 2468 13.4.65. sys/uio.h 2469 13.4.66. sys/un.h 2470 13.4.67. sys/utsname.h 2471 13.4.68. sys/wait.h 2472 13.4.69. syslog.h 2473 13.4.70. termios.h 2474 13.4.71. time.h 2475 13.4.72. ucontext.h 2476 13.4.73. ulimit.h 2477 13.4.74. unistd.h 2478 13.4.75. utime.h 2479 13.4.76. utmp.h 2480 13.4.77. utmpx.h 2481 13.4.78. wchar.h 2482 13.4.79. wctype.h 2483 13.4.80. wordexp.h 2484 2485 13.5. Interface Definitions for libc 2486 2487 _IO_feof -- alias for feof 2488 _IO_getc -- alias for getc 2489 _IO_putc -- alias for putc 2490 _IO_puts -- alias for puts 2491 __assert_fail -- abort the program after false 2492 assertion 2493 2494 __ctype_b_loc -- accessor function for __ctype_b 2495 array for ctype functions 2496 2497 __ctype_get_mb_cur_max -- maximum length of a 2498 multibyte character in the current locale 2499 2500 __ctype_tolower_loc -- accessor function for 2501 __ctype_b_tolower array for ctype tolower() 2502 function 2503 2504 __ctype_toupper_loc -- accessor function for 2505 __ctype_b_toupper() array for ctype 2506 toupper() function 2507 2508 __cxa_atexit -- register a function to be called by 2509 exit or when a shared library is unloaded 2510 2511 __daylight -- daylight savings time flag 2512 __environ -- alias for environ - user environment 2513 __errno_location -- address of errno variable 2514 __fpending -- returns in bytes the amount of output 2515 pending on a stream 2516 2517 __getpagesize -- alias for getpagesize - get 2518 current page size 2519 2520 __getpgid -- get the process group id 2521 __h_errno_location -- address of h_errno variable 2522 __isinf -- test for infinity 2523 __isinff -- test for infinity 2524 __isinfl -- test for infinity 2525 __isnan -- test for infinity 2526 __isnanf -- test for infinity 2527 __isnanl -- test for infinity 2528 __libc_current_sigrtmax -- return number of 2529 available real-time signal with lowest 2530 priority 2531 2532 __libc_current_sigrtmin -- return number of 2533 available real-time signal with highest 2534 priority 2535 2536 __libc_start_main -- initialization routine 2537 __lxstat -- inline wrapper around call to lxstat 2538 __mempcpy -- copy given number of bytes of source 2539 to destination 2540 2541 __rawmemchr -- scan memory 2542 __register_atfork -- alias for register_atfork 2543 __sigsetjmp -- save stack context for non-local 2544 goto 2545 2546 __stpcpy -- alias for stpcpy 2547 __strdup -- alias for strdup 2548 __strtod_internal -- underlying function for strtod 2549 __strtof_internal -- underlying function for strtof 2550 __strtok_r -- alias for strtok_r 2551 __strtol_internal -- alias for strtol 2552 __strtold_internal -- underlying function for 2553 strtold 2554 2555 __strtoll_internal -- underlying function for 2556 strtoll 2557 2558 __strtoul_internal -- underlying function for 2559 strtoul 2560 2561 __strtoull_internal -- underlying function for 2562 strtoull 2563 2564 __sysconf -- get configuration information at 2565 runtime 2566 2567 __sysv_signal -- signal handling 2568 __timezone -- global variable containing timezone 2569 __tzname -- global variable containing the timezone 2570 __wcstod_internal -- underlying function for wcstod 2571 __wcstof_internal -- underlying function for wcstof 2572 __wcstol_internal -- underlying function for wcstol 2573 __wcstold_internal -- underlying function for 2574 wcstold 2575 2576 __wcstoul_internal -- underlying function for 2577 wcstoul 2578 2579 __xmknod -- make block or character special file 2580 __xstat -- get File Status 2581 __xstat64 -- get File Status 2582 _environ -- alias for environ - user environment 2583 _nl_msg_cat_cntr -- new catalog load counter 2584 _sys_errlist -- array containing the "C" locale 2585 strings used by strerror() 2586 2587 _sys_siglist -- array containing the names of the 2588 signal names 2589 2590 acct -- switch process accounting on or off 2591 adjtime -- correct the time to allow 2592 synchronization of the system clock 2593 2594 asprintf -- write formatted output to a dynamically 2595 allocated string 2596 2597 bind_textdomain_codeset -- specify encoding for 2598 message retrieval 2599 2600 bindresvport -- bind socket to privileged IP port 2601 bindtextdomain -- specify the location of a message 2602 catalog 2603 2604 cfmakeraw -- get and set terminal attributes 2605 cfsetspeed -- set terminal input and output data 2606 rate 2607 2608 daemon -- run in the background 2609 dcgettext -- perform domain and category specific 2610 lookup in message catalog 2611 2612 dcngettext -- perform domain and category specific 2613 lookup in message catalog with plural 2614 2615 dgettext -- perform lookup in message catalog for 2616 the current LC_MESSAGES locale 2617 2618 dngettext -- perform lookup in message catalog for 2619 the current locale 2620 2621 duplocale -- provide new handle for selection of 2622 locale 2623 2624 err -- display formatted error messages 2625 error -- print error message 2626 errx -- display formatted error message and exit 2627 fcntl -- file control 2628 fflush_unlocked -- non thread safe fflush 2629 fgetwc_unlocked -- non thread safe fgetwc 2630 flock -- apply or remove an advisory lock on an 2631 open file 2632 2633 freelocale -- free a locale object 2634 fscanf -- convert formatted input 2635 fwscanf -- convert formatted input 2636 getgrouplist -- get network group entry 2637 getloadavg -- get system load averages 2638 getopt -- parse command line options 2639 getopt_long -- parse command line options 2640 getopt_long_only -- parse command line options 2641 getsockopt -- get socket options 2642 gettext -- search message catalogs for a string 2643 getutent -- access user accounting database entries 2644 2645 getutent_r -- access user accounting database 2646 entries 2647 2648 glob64 -- find pathnames matching a pattern (Large 2649 File Support) 2650 2651 globfree64 -- free memory from glob64() (Large File 2652 Support) 2653 2654 initgroups -- initialize the supplementary group 2655 access list 2656 2657 ioctl -- control device 2658 sockio -- socket ioctl commands 2659 ttyio -- tty ioctl commands 2660 kill -- send a signal 2661 link -- create a link to a file 2662 mbsnrtowcs -- convert a multibyte string to a wide 2663 character string 2664 2665 memmem -- locate bytes 2666 memrchr -- scan memory for a character 2667 newlocale -- allocate a locale object 2668 ngettext -- search message catalogs for plural 2669 string 2670 2671 pmap_getport -- find the port number assigned to a 2672 service registered with a portmapper. 2673 2674 pmap_set -- establishes mapping to machine's RPC 2675 Bind service. 2676 2677 pmap_unset -- destroys RPC Binding 2678 psignal -- print signal message 2679 regexec -- regular expression matching 2680 scanf -- convert formatted input 2681 setbuffer -- stream buffering operation 2682 setgroups -- set list of supplementary group IDs 2683 sethostname -- set host name 2684 setsockopt -- set socket options 2685 setutent -- access user accounting database entries 2686 sigandset -- build a new signal set by combining 2687 the two input sets using logical AND 2688 2689 sigisemptyset -- check for empty signal set 2690 sigorset -- build a new signal set by combining the 2691 two input sets using logical OR 2692 2693 sigreturn -- return from signal handler and cleanup 2694 stack frame 2695 2696 sscanf -- convert formatted input 2697 stime -- set time 2698 stpcpy -- copy a string returning a pointer to its 2699 end 2700 2701 stpncpy -- copy a fixed-size string, returning a 2702 pointer to its end 2703 2704 strcasestr -- locate a substring ignoring case 2705 strerror_r -- reentrant version of strerror 2706 strndup -- return a malloc'd copy of at most the 2707 specified number of bytes of a string 2708 2709 strnlen -- determine the length of a fixed-size 2710 string 2711 2712 strptime -- parse a time string 2713 strsep -- extract token from string 2714 strsignal -- return string describing signal 2715 strtoq -- convert string value to a long or quad_t 2716 integer 2717 2718 strtouq -- convert a string to an unsigned long 2719 long 2720 2721 svc_register -- register Remote Procedure Call 2722 interface 2723 2724 svc_run -- waits for RPC requests to arrive and 2725 calls service procedure 2726 2727 svc_sendreply -- called by RPC service's dispatch 2728 routine 2729 2730 svctcp_create -- create a TCP/IP-based RPC service 2731 transport 2732 2733 svcudp_create -- create a UDP-based RPC service 2734 transport 2735 2736 swscanf -- convert formatted input 2737 system -- execute a shell command 2738 textdomain -- set the current default message 2739 domain 2740 2741 unlink -- remove a directory entry 2742 uselocale -- set locale for thread 2743 utmpname -- set user accounting database 2744 vasprintf -- write formatted output to a 2745 dynamically allocated string 2746 2747 vdprintf -- write formatted output to a file 2748 descriptor 2749 2750 verrx -- display formatted error message and exit 2751 vfscanf -- convert formatted input 2752 vfwscanf -- convert formatted input 2753 vscanf -- convert formatted input 2754 vsscanf -- convert formatted input 2755 vswscanf -- convert formatted input 2756 vsyslog -- log to system log 2757 vwscanf -- convert formatted input 2758 wait4 -- wait for process termination, BSD style 2759 waitpid -- wait for child process 2760 warn -- formatted error messages 2761 warnx -- formatted error messages 2762 wcpcpy -- copy a wide character string, returning a 2763 pointer to its end 2764 2765 wcpncpy -- copy a fixed-size string of wide 2766 characters, returning a pointer to its end 2767 2768 wcscasecmp -- compare two wide-character strings, 2769 ignoring case 2770 2771 wcsdup -- duplicate a wide-character string 2772 wcsncasecmp -- compare two fixed-size 2773 wide-character strings, ignoring case 2774 2775 wcsnlen -- determine the length of a fixed-size 2776 wide-character string 2777 2778 wcsnrtombs -- convert a wide character string to a 2779 multi-byte string 2780 2781 wcstoq -- convert wide string to long long int 2782 representation 2783 2784 wcstouq -- convert wide string to unsigned long 2785 long int representation 2786 2787 wscanf -- convert formatted input 2788 xdr_u_int -- library routines for external data 2789 representation 2790 2791 13.6. Interfaces for libm 2792 2793 13.6.1. Math 2794 2795 13.7. Data Definitions for libm 2796 2797 13.7.1. complex.h 2798 13.7.2. fenv.h 2799 13.7.3. math.h 2800 2801 13.8. Interface Definitions for libm 2802 2803 __fpclassify -- Classify real floating type 2804 __fpclassifyf -- Classify real floating type 2805 2806 13.9. Interfaces for libpthread 2807 2808 13.9.1. Realtime Threads 2809 13.9.2. Advanced Realtime Threads 2810 13.9.3. Posix Threads 2811 13.9.4. Thread aware versions of libc interfaces 2812 2813 13.10. Data Definitions for libpthread 2814 2815 13.10.1. pthread.h 2816 13.10.2. semaphore.h 2817 2818 13.11. Interface Definitions for libpthread 2819 2820 _pthread_cleanup_pop -- establish cancellation 2821 handlers 2822 2823 _pthread_cleanup_push -- establish cancellation 2824 handlers 2825 2826 13.12. Interfaces for libgcc_s 2827 2828 13.12.1. Unwind Library 2829 2830 13.13. Data Definitions for libgcc_s 2831 2832 13.13.1. unwind.h 2833 2834 13.14. Interfaces for libdl 2835 2836 13.14.1. Dynamic Loader 2837 2838 13.15. Data Definitions for libdl 2839 2840 13.15.1. dlfcn.h 2841 2842 13.16. Interface Definitions for libdl 2843 2844 dladdr -- find the shared object containing a given 2845 address 2846 2847 dlopen -- open dynamic object 2848 dlsym -- obtain the address of a symbol from a 2849 dlopen object 2850 2851 13.17. Interfaces for librt 2852 2853 13.17.1. Shared Memory Objects 2854 13.17.2. Clock 2855 13.17.3. Timers 2856 2857 13.18. Interfaces for libcrypt 2858 2859 13.18.1. Encryption 2860 2861 13.19. Interfaces for libpam 2862 2863 13.19.1. Pluggable Authentication API 2864 2865 13.20. Data Definitions for libpam 2866 2867 13.20.1. security/pam_appl.h 2868 2869 13.21. Interface Definitions for libpam 2870 2871 pam_acct_mgmt -- establish the status of a user's 2872 account 2873 2874 pam_authenticate -- authenticate the user 2875 pam_chauthtok -- change the authentication token 2876 for a given user 2877 2878 pam_close_session -- indicate that an authenticated 2879 session has ended 2880 2881 pam_end -- terminate the use of the PAM library 2882 pam_fail_delay -- specify delay time to use on 2883 authentication error 2884 2885 pam_get_item -- obtain the value of the indicated 2886 item. 2887 2888 pam_getenvlist -- returns a pointer to the complete 2889 PAM environment. 2890 2891 pam_open_session -- indicate session has started 2892 pam_set_item -- (re)set the value of an item. 2893 pam_setcred -- set the module-specific credentials 2894 of the user 2895 2896 pam_start -- initialize the PAM library 2897 pam_strerror -- returns a string describing the PAM 2898 error 2899 _________________________________________________________ 2900 2901 Chapter 13. Base Libraries 2902 2903 13.1. Introduction 2904 2905 An LSB-conforming implementation shall support the following 2906 base libraries which provide interfaces for accessing the 2907 operating system, processor and other hardware in the system. 2908 2909 * libc 2910 * libm 2911 * libgcc_s 2912 * libdl 2913 * librt 2914 * libcrypt 2915 * libpam 2916 2917 There are three main parts to the definition of each of these 2918 libraries. 2919 2920 The "Interfaces" section defines the required library name and 2921 version, and the required public symbols (interfaces and 2922 global data), as well as symbol versions, if any. 2923 2924 The "Interface Definitions" section provides complete or 2925 partial definitions of certain interfaces where either this 2926 specification is the source specification, or where there are 2927 variations from the source specification. If an interface 2928 definition requires one or more header files, one of those 2929 headers shall include the function prototype for the 2930 interface. 2931 2932 For source definitions of interfaces which include a reference 2933 to a header file, the contents of such header files form a 2934 part of the specification. The "Data Definitions" section 2935 provides the binary-level details for the header files from 2936 the source specifications, such as values for macros and 2937 enumerated types, as well as structure layouts, sizes and 2938 padding, etc. These data definitions, although presented in 2939 the form of header files for convenience, should not be taken 2940 a representing complete header files, as they are a supplement 2941 to the source specifications. Application developers should 2942 follow the guidelines of the source specifications when 2943 determining which header files need to be included to 2944 completely resolve all references. 2945 2946 Note: While the Data Definitions supplement the source 2947 specifications, this specification itself does not require 2948 conforming implementations to supply any header files. 2949 _________________________________________________________ 2950 2951 13.2. Program Interpreter 2952 2953 The Program Interpreter is specified in the appropriate 2954 architecture specific supplement. 2955 _________________________________________________________ 2956 2957 13.3. Interfaces for libc 2958 2959 Table 13-1 defines the library name and shared object name for 2960 the libc library 2961 2962 Table 13-1. libc Definition 2963 Library: libc 2964 SONAME: See archLSB. 2965 2966 The behavior of the interfaces in this library is specified by 2967 the following specifications: 2968 2969 [LFS] Large File Support 2970 [LSB] This Specification 2971 [SUSv2] SUSv2 2972 [SUSv3] ISO POSIX (2003) 2973 [SVID.3] SVID Issue 3 2974 [SVID.4] SVID Issue 4 2975 _________________________________________________________ 2976 2977 13.3.1. RPC 2978 _________________________________________________________ 2979 2980 13.3.1.1. Interfaces for RPC 2981 2982 An LSB conforming implementation shall provide the generic 2983 functions for RPC specified in Table 13-2, with the full 2984 mandatory functionality as described in the referenced 2985 underlying specification. 2986 2987 Table 13-2. libc - RPC Function Interfaces 2988 authnone_create [SVID.4] clnt_create [SVID.4] 2989 clnt_pcreateerror [SVID.4] clnt_perrno [SVID.4] 2990 clnt_perror [SVID.4] clnt_spcreateerror [SVID.4] clnt_sperrno 2991 [SVID.4] clnt_sperror [SVID.4] 2992 key_decryptsession [SVID.3] pmap_getport [LSB] pmap_set [LSB] 2993 pmap_unset [LSB] 2994 svc_getreqset [SVID.3] svc_register [LSB] svc_run [LSB] 2995 svc_sendreply [LSB] 2996 svcerr_auth [SVID.3] svcerr_decode [SVID.3] svcerr_noproc 2997 [SVID.3] svcerr_noprog [SVID.3] 2998 svcerr_progvers [SVID.3] svcerr_systemerr [SVID.3] 2999 svcerr_weakauth [SVID.3] svctcp_create [LSB] 3000 svcudp_create [LSB] xdr_accepted_reply [SVID.3] xdr_array 3001 [SVID.3] xdr_bool [SVID.3] 3002 xdr_bytes [SVID.3] xdr_callhdr [SVID.3] xdr_callmsg [SVID.3] 3003 xdr_char [SVID.3] 3004 xdr_double [SVID.3] xdr_enum [SVID.3] xdr_float [SVID.3] 3005 xdr_free [SVID.3] 3006 xdr_int [SVID.3] xdr_long [SVID.3] xdr_opaque [SVID.3] 3007 xdr_opaque_auth [SVID.3] 3008 xdr_pointer [SVID.3] xdr_reference [SVID.3] xdr_rejected_reply 3009 [SVID.3] xdr_replymsg [SVID.3] 3010 xdr_short [SVID.3] xdr_str