1、 INCITS/ISO/IEC 23360-2:20062010 (ISO/IEC 23360-2:2006, IDT) Linux Standard Base (LSB) core specification 3.1 - Part 2: Specification for IA32 architecture Reaffirmed as INCITS/ISO/IEC 23360-2:2006 R2015INCITS/ISO/IEC 23360-2:20062010 PDF disclaimer This PDF file may contain embedded typefaces. In a
2、ccordance with Adobes licensing policy, this file may be printed or viewed but shall not be edited unless the typefaces which are embedded are licensed to and installed on the computer performing the editing. In downloading this file, parties accept therein the responsibility of not infringing Adobe
3、s licensing policy. The ISO Central Secretariat accepts no liability in this area. Adobe is a trademark of Adobe Systems Incorporated. Details of the software products used to create this PDF file can be found in the General Info relative to the file; the PDF-creation parameters were optimized for p
4、rinting. Every care has been taken to ensure that the file is suitable for use by ISO member bodies. In the unlikely event that a problem relating to it is found, please inform the Central Secretariat at the address given below. Adopted by INCITS (InterNational Committee for Information Technology S
5、tandards) as an American National Standard. Date of ANSI Approval: 11/17/2010 Published by American National Standards Institute, 25 West 43rd Street, New York, New York 10036 Copyright 2010 by Information Technology Industry Council (ITI). All rights reserved. These materials are subject to copyrig
6、ht claims of International Standardization Organization (ISO), International Electrotechnical Commission (IEC), American National Standards Institute (ANSI), and Information Technology Industry Council (ITI). Not for resale. No part of this publication may be reproduced in any form, including an ele
7、ctronic retrieval system, without the prior written permission of ITI. All requests pertaining to this standard should be submitted to ITI, 1101 K Street NW, Suite 610, Washington DC 20005. Printed in the United States of America ii ITIC 2010 All rights reserved ISO/IEC 23360-2:2006(E) ISO/IEC 2006
8、All rights reserved iiiLinux Standard Base Core Specification for IA32 3.1 ISO/IEC 23360-2:2006(E) Copyright 2006 ISO/IEC This standard includes material that has been provided by the Free Standards Group under the GNU Free Documentation License Version 1.1 published by the Free Software Foundation.
9、 Portions of the text are copyrighted by the following parties: The Regents of the University of California Free Software Foundation Ian F. Darwin Paul Vixie BSDI (now Wind River) Andrew G Morgan Jean-loup Gailly and Mark Adler Massachusetts Institute of Technology These excerpts are being used in a
10、ccordance with their respective licenses. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. UNIX is a registered trademark of The Open Group. LSB is a trademark of the Free Standards Group in the United States and other countries. AMD is a trademark of Advanced Mic
11、ro Devices, Inc. Intel and Itanium are registered trademarks and Intel386 is a trademark of Intel Corporation. PowerPC is a registered trademark and PowerPC Architecture is a trademark of the IBM Corporation. S/390 is a registered trademark of the IBM Corporation. OpenGL is a registered trademark of
12、 Silicon Graphics, Inc. ISO/IEC 23360-2:2006(E) iv ISO/IEC 2006 All rights reservedContents 1 Scope11.1 General11.2 Module Specific Scope12 References.22.1 Normative References 22.2 Informative References/Bibliography .43 Requirements .63.1 Relevant Libraries .63.2 LSB Implementation Conformance 63.
13、3 LSB Application Conformance74 Definitions 95 Terminology .106 Documentation Conventions .12II Executable and Linking Format (ELF).137 Introduction148 Low Level System Information158.1 Machine Interface158.2 Function Calling Sequence.168.3 Operating System Interface .178.4 Process Initialization.18
14、8.5 Coding Examples 188.6 C Stack Frame 198.7 Debug Information209 Object Format.21 9.1 Introduction .219.2 ELF Header 219.3 Special Sections219.4 Symbol Table .229.5 Relocation.2210 Program Loading and Dynamic Linking .23 10.1 Introduction .2310.2 Program Header2310.3 Program Loading 2310.4 Dynamic
15、 Linking.23III Base Libraries .25 11 Libraries 2611.1 Program Interpreter/Dynamic Linker.2611.2 Interfaces for libc.2611.3 Data Definitions for libc .4011.4 Interfaces for libm .5311.5 Data Definitions for libm5711.6 Interface Definitions for libm 5911.7 Interfaces for libpthread.5911.8 Data Definit
16、ions for libpthread .6211.9 Interfaces for libgcc_s .6211.10 Data Definitions for libgcc_s6311.11 Interface Definitions for libgcc_s.6411.12 Interfaces for libdl .7011.13 Data Definitions for libdl .7111.14 Interfaces for libcrypt71I Introductory Elements .0 Foreword vii Introduction viii ISO/IEC 23
17、360-2:2006(E) ISO/IEC 2006 All rights reserved vIV Utility Libraries72 12 Libraries 7312.1 Interfaces for libz.7312.2 Data Definitions for libz .7312.3 Interfaces for libncurses7312.4 Data Definitions for libncurses7412.5 Interfaces for libutil.74V Package Format and Installation7613 Software Instal
18、lation .7713.1 Package Dependencies .7713.2 Package Architecture Considerations 77A Alphabetical Listing of Interfaces78A.1 libgcc_s78A.2 libm78ISO/IEC 23360-2:2006(E) vi ISO/IEC 2006 All rights reservedList of Tables 2-1 Normative References .22-2 Other References43-1 Standard Library Names.68-1 Sc
19、alar Types159-1 ELF Special Sections 219-2 Additional Special Sections 2111-1 libc Definition.2611-2 libc - RPC Function Interfaces 2611-3 libc - System Calls Function Interfaces .2711-4 libc - Standard I/O Function Interfaces2911-5 libc - Standard I/O Data Interfaces .3011-6 libc - Signal Handling
20、Function Interfaces .3011-7 libc - Signal Handling Data Interfaces 3111-8 libc - Localization Functions Function Interfaces 3111-9 libc - Localization Functions Data Interfaces .3111-10 libc - Socket Interface Function Interfaces 3211-11 libc - Wide Characters Function Interfaces.3211-12 libc - Stri
21、ng Functions Function Interfaces.3411-13 libc - IPC Functions Function Interfaces .3511-14 libc - Regular Expressions Function Interfaces 3511-15 libc - Character Type Functions Function Interfaces.3511-16 libc - Time Manipulation Function Interfaces3611-17 libc - Time Manipulation Data Interfaces .
22、3611-18 libc - Terminal Interface Functions Function Interfaces .3611-19 libc - System Database Interface Function Interfaces3711-20 libc - Language Support Function Interfaces .3711-21 libc - Large File Support Function Interfaces .3811-22 libc - Standard Library Function Interfaces3811-23 libc - S
23、tandard Library Data Interfaces .4011-24 libm Definition .5311-25 libm - Math Function Interfaces.5411-26 libm - Math Data Interfaces 5711-27 libpthread Definition.5911-28 libpthread - Realtime Threads Function Interfaces.6011-29 libpthread - Posix Threads Function Interfaces .6011-30 libpthread - T
24、hread aware versions of libc interfaces Function Interfaces 6211-31 libgcc_s Definition .6211-32 libgcc_s - Unwind Library Function Interfaces6311-33 libdl Definition .7011-34 libdl - Dynamic Loader Function Interfaces.7011-35 libcrypt Definition7111-36 libcrypt - Encryption Function Interfaces.7112
25、-1 libz Definition.7312-2 libncurses Definition .7412-3 libutil Definition.7412-4 libutil - Utility Functions Function Interfaces 75A-1 libgcc_s Function Interfaces 78A-2 libm Function Interfaces 78ISO/IEC 23360-2:2006(E) ISO/IEC 2006 All rights reserved viiForeword ISO (the International Organizati
26、on for Standardization) and IEC (the International Electrotechnical Commission) form the specialized system for worldwide standardization. National bodies that are members of ISO or IEC participate in the development of International Standards through technical committees established by the respecti
27、ve organization to deal with particular fields of technical activity. ISO and IEC technical committees collaborate in fields of mutual interest. Other international organizations, governmental and non-governmental, in liaison with ISO and IEC, also take part in the work. In the field of information
28、technology, ISO and IEC have established a joint technical committee, ISO/IEC JTC 1. International Standards are drafted in accordance with the rules given in the ISO/IEC Directives, Part 2. The main task of the joint technical committee is to prepare International Standards. Draft International Sta
29、ndards adopted by the joint technical committee are circulated to national bodies for voting. Publication as an International Standard requires approval by at least 75 % of the national bodies casting a vote. Attention is drawn to the possibility that some of the elements of this document may be the
30、 subject of patent rights. ISO and IEC shall not be held responsible for identifying any or all such patent rights. International Standard ISO/IEC 23360-2 was prepared by the Free Standards Group and was adopted, under the PAS procedure, by Joint Technical Committee ISO/IEC JTC 1, Information techno
31、logy, Subcommittee SC 22, Programming languages, their environments and system software interfaces. ISO/IEC 23360 consists of the following parts, under the general title Linux Standard Base (LSB) core specification 3.1: Part 1: Generic specification Part 2: Specification for IA32 architecture Part
32、3: Specification for IA64 architecture Part 4: Specification for AMD64 architecture Part 5: Specification for PPC32 architecture Part 6: Specification for PPC64 architecture Part 7: Specification for S390 architecture Part 8: Specification for S390X architecture ISO/IEC 23360-2:2006(E) viii ISO/IEC
33、2006 All rights reservedIntroduction The LSB defines a binary interface for application programs that are compiled and packaged for LSB-conforming implementations on many different hardware architectures. Since a binary specification includes information specific to the computer processor architectu
34、re for which it is intended, it is not possible for a single document to specify the interface for all possible LSB-conforming implementations. Therefore, the LSB is a family of specifications, rather than a single one. This document should be used in conjunction with the documents it references. Th
35、is document enumerates the system components it includes, but descriptions of those components may be included entirely or partly in this document, partly in other documents, or entirely in other reference documents. For example, the section that describes system service routines includes a list of
36、the system routines supported in this interface, formal declarations of the data structures they use that are visible to applications, and a pointer to the underlying referenced specification for information about the syntax and semantics of each call. Only those routines not described in standards
37、referenced by this document, or extensions to those standards, are described in detail. Information referenced in this way is as much a part of this document as is the information explicitly included here. The specification carries a version number of either the form x.y or x.y.z. This version numbe
38、r carries the following meaning: The first number (x) is the major version number. All versions with the same major version number should share binary compatibility. Any addition or deletion of a new library results in a new version number. Interfaces marked as deprecated may be removed from the spe
39、cification at a major version change. The second number (y) is the minor version number. Individual interfaces may be added if all certified implementations already had that (previously undocumented) interface. Interfaces may be marked as deprecated at a minor version change. Other minor changes may
40、 be permitted at the discretion of the LSB workgroup. The third number (z), if present, is the editorial level. Only editorial changes should be included in such versions. Since this specification is a descriptive Application Binary Interface, and not a source level API specification, it is not poss
41、ible to make a guarantee of 100% backward compatibility between major releases. However, it is the intent that those parts of the binary interface that are visible in the source level API will remain backward compatible from version to version, except where a feature marked as in one release may be
42、removed from a future release. Implementors are strongly encouraged to make use of symbol versioning to permit simultaneous support of applications conforming to different releases of this specification. This is version 3.1 of the Linux Standard Base Core Specification. This specification is part of
43、 a family of specifications under the general title “Linux Standard Base (LSB) core specification 3.1“. Developers of applications orimplementations interested in using the LSB trademark should see the Free Standards Group Certification Policy for details. deprecatedI Introductory Elements 1 Scope 1
44、.1 General The Linux Standard Base (LSB) defines a system interface for compiled applications and a minimal environment for support of installation scripts. Its purpose is to enable a uniform industry standard environment for high-volume applications conforming to the LSB. These specifications are c
45、omposed of two basic parts: A common specification (“LSB-generic“ or “generic LSB“), ISO/IEC 23360-1, describing those parts of the interface that remain constant across all implementations of the LSB, and an architecture-specific part (“LSB-arch“ or “archLSB“) describing the parts of the interface
46、that vary by processor architecture. Together, the LSB-generic and the relevant architecture-specific part of ISO/IEC 23360 for a single hardware architecture provide a complete interface specification for compiled application programs on systems that share a common hardware architecture. ISO/IEC 23
47、360-1, the LSB-generic document, should be used in conjunction with an architecture-specific part. Whenever a section of the LSB-generic specification is supplemented by architecture-specific information, the LSB-generic document includes a reference to the architecture part. Architecture-specific p
48、arts of ISO/IEC 23360 may also contain additional information that is not referenced in the LSB-generic document. The LSB contains both a set of Application Program Interfaces (APIs) and Application Binary Interfaces (ABIs). APIs may appear in the source code of portable applications, while the comp
49、iled binary of that application may use the larger set of ABIs. A conforming implementation provides all of the ABIs listed here. The compilation system may replace (e.g. by macro definition) certain APIs with calls to one or more of the underlying binary interfaces, and may insert calls to binary interfaces as needed. The LSB is primarily a binary interface definition. Not all of the source level APIs available to applications may be