Intel® Itanium™ Processor- Specific Application Binary Interface (ABI)
Total Page:16
File Type:pdf, Size:1020Kb
Intel® Itanium™ Processor- specific Application Binary Interface (ABI) May 2001 Document Number: 245370-003 Information in this document is provided in connection with Intel® products. No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted by this document. Except as provided in Intel's Terms and Conditions of Sale for such products, Intel assumes no liability whatsoever, and Intel disclaims any express or implied warranty, relating to sale and/or use of Intel products including liability or warranties relating to fitness for a particular purpose, merchantability, or infringement of any patent, copyright or other intellectual property right. Intel products are not intended for use in medical, life saving, or life sustaining applications. Intel may make changes to specifications and product descriptions at any time, without notice. Designers must not rely on the absence or characteristics of any features or instructions marked “reserved” or “undefined.” Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. The Itanium processor may contain design defects or errors known as errata which may cause the product to deviate from published specifications. Current characterized errata are available on request. Contact your local Intel sales office or your distributor to obtain the latest specifications and before placing your product order. Copies of documents which have an order number and are referenced in this document, or other Intel literature, may be obtained by calling 1-800-548-4725, or by visiting Intel’s website at http://developer.intel.com/design/litcentr. Itanium and i386 are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. *Other brands and names may be claimed as the property of others. Copyright © 2001, Intel Corporation. Contents 1 Introduction.......................................................................................................1-1 1.1 The Intel® Itanium™ Architecture and the System V ABI .....................1-1 1.2 How to Use the System V ABI for Intel® Itanium™ Processors............1-1 1.3 Evolution of the ABI Specification .........................................................1-2 1.4 Additional Documents ...........................................................................1-2 2 Software Installation.........................................................................................2-1 3 Low-level System Information.........................................................................3-1 3.1 Introduction............................................................................................3-1 3.2 Machine Interface..................................................................................3-1 3.2.1 Fundamental Types ..............................................................3-1 3.3 Operating System Interface...................................................................3-2 3.3.1 Exception Interface ...............................................................3-2 3.3.2 Signal Delivery ......................................................................3-3 3.3.3 Signal Handler Interface........................................................3-5 3.3.4 Debugging Support ...............................................................3-6 3.3.5 Process Startup.....................................................................3-6 4 Object Files .......................................................................................................4-1 4.1 ELF Header ...........................................................................................4-1 4.1.1 Machine Information..............................................................4-1 4.2 Sections.................................................................................................4-3 4.2.1 Section Types .......................................................................4-3 4.2.2 Section Attribute Flags ..........................................................4-4 4.2.3 Special Sections....................................................................4-4 4.2.4 Architecture Extensions ........................................................4-6 4.3 Relocations............................................................................................4-6 4.3.1 Relocation Types ..................................................................4-6 5 Program Loading and Dynamic Linking.........................................................5-1 5.1 Program Header....................................................................................5-1 5.2 Program Loading...................................................................................5-1 5.2.1 Linktime and Runtime Addresses .........................................5-4 5.2.2 Initializations..........................................................................5-4 5.3 Dynamic Linking ....................................................................................5-4 5.3.1 Dynamic Linker .....................................................................5-4 5.3.2 Dynamic Section ...................................................................5-5 5.3.3 Shared Object Dependencies ...............................................5-5 5.3.4 Global Offset Table ...............................................................5-6 5.3.5 Function Addresses ..............................................................5-6 5.3.6 Procedure Linkage Table ......................................................5-7 5.3.7 Initialization and Termination Functions..............................5-10 6 Libraries.............................................................................................................6-1 6.1 Unwind Library Interface .......................................................................6-1 6.1.1 Exception Handler Framework..............................................6-1 6.1.2 Data Structures .....................................................................6-3 Intel® Itanium™ Processor-specific Application Binary Interface (ABI) iii 6.1.3 Throwing an Exception .........................................................6-5 6.1.4 Exception Object Management.............................................6-7 6.1.5 Context Management............................................................6-7 6.1.6 Personality Routine...............................................................6-9 7 Miscellaneous ...................................................................................................7-1 7.1 Introduction ...........................................................................................7-1 7.2 Development Environment....................................................................7-1 7.2.1 Pre-defined Preprocessor Symbols ......................................7-1 7.2.2 Pre-defined Preprocessor Assertions ...................................7-1 7.2.3 Compiler Pragmas ................................................................7-2 7.3 ILP32 ABI ..............................................................................................7-3 7.3.1 Objectives of the 32-bit Little-endian Runtime Architecture ..7-3 7.3.2 Changes from the 64-bit Software Conventions ...................7-3 7.3.3 Addressing and Protection....................................................7-4 7.3.4 Data Allocation......................................................................7-4 7.3.5 Local Memory Stack Variables..............................................7-4 7.3.6 Parameter Passing ...............................................................7-4 7.4 Synchronization Primitives ....................................................................7-4 7.4.1 Atomic Fetch-and-op Operations ..........................................7-5 7.4.2 Atomic Op-and-fetch Operations...........................................7-6 7.4.3 Atomic Compare-and-swap Operation..................................7-6 7.4.4 Atomic Synchronize Operation..............................................7-6 7.4.5 Atomic Lock-test-and-set Operation......................................7-7 7.4.6 Atomic Lock_release Operation............................................7-7 7.5 Thread-Local Storage ...........................................................................7-7 7.5.1 C/C++ Programming Interface ..............................................7-7 7.5.2 Compile-time Allocation of Thread-Local Storage.................7-8 7.5.3 Linker Treatment of Thread-Local Storage Sections ............7-9 7.5.4 Runtime Allocation of Thread-Local Storage ......................7-10 7.5.5 Code Sequences for Accessing Thread-Local Variables....7-13 7.5.6 ELF Relocations for Thread-Local Storage.........................7-15 7.5.7 TLS Variable References....................................................7-15 Figures 3-1 Double-extended (80-bit) Floating-point Formats ..............................................3-2 4-1 Instruction Bundle Layout...................................................................................4-7 4-2 Relocatable Fields..............................................................................................4-8 5-1 Example Executable File....................................................................................5-2 5-2 Example Program Header Segments ................................................................5-2