64-Bit ELF V2 ABI Specification May 10, 2017 Revision 1.4
Total Page:16
File Type:pdf, Size:1020Kb
www.openpowerfoundation.org 64-Bit ELF V2 ABI Specification May 10, 2017 Revision 1.4 64-Bit ELF V2 ABI Specification: Power Architecture System Software Work Group Revision 1.4 (May 10, 2017) Copyright © 2014-2017 OpenPOWER Foundation Copyright © 1999,2003, 2004, 2013, 2014 IBM Corporation Copyright © 2011 Power.org Copyright © 2003, 2004 Free Standards Group Copyright © 2002 Freescale Semiconductor, Inc Licensed under the GNU Free Documentation License, Version 1.3; with no Invariants Sections, with no Front-Cover Texts, and with no Back-Cover Texts (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.gnu.org/licenses/fdl-1.3.txt The limited permissions granted above are perpetual and will not be revoked by OpenPOWER or its successors or assigns. This document and the information contained herein is provided on an "AS IS" basis AND TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE OpenPOWER Foundation AS WELL AS THE AUTHORS AND DEVELOPERS OF THIS STANDARDS FINAL DELIVERABLE OR OTHER DOCUMENT HEREBY DISCLAIM ALL OTHER WARRANTIES AND CONDITIONS, EITHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES, DUTIES OR CONDITIONS OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR PURPOSE, OF ACCURACY OR COMPLETENESS OF RESPONSES, OF RESULTS, OF WORKMANLIKE EFFORT, OF LACK OF VIRUSES, OF LACK OF NEGLIGENCE OR NON-INFRINGEMENT. OpenPOWER, the OpenPOWER logo, and openpowerfoundation.org are trademarks or registered trademarks of OpenPOWER Foundation, Inc., registered in many jurisdictions worldwide. Other company, product, and service names may be trademarks or service marks of others. Abstract The Executable and Linking Format (ELF) defines a linking interface for executables and shared objects in two parts: the first part is the generic System V ABI, the second part is a processor-specific supple- ment. This document, the OpenPOWER ABI for Linux Supplement for the Power Architecture 64-bit ELF V2 ABI, is the OpenPOWER-compliant processor-specific supplement for use with ELF V2 on 64-bit IBM Power Architecture® systems. This is not a complete System V ABI supplement because it does not define any library interfaces. This document establishes both big-endian and little-endian application binary interfaces. OpenPOW- ER-compliant processors in the 64-bit Power Architecture can execute in either big-endian or little-endian mode. Executables and executable-generated data (in general) that subscribes to either byte ordering is not portable to a system running in the other mode. This document is a Standards Track, Work Group work product owned by the System Software Workgroup and handled in compliance with the requirements outlined in the OpenPOWER Founda- tion Work Group (WG) Process document. It was created using the Master Template Guide version 1.0. Comments, questions, etc. can be submitted to the public mailing list for this document at <[email protected]>. Workgroup Specification OpenPOWER Foundation ii Standard Track 64-Bit ELF V2 ABI Specification May 10, 2017 Revision 1.4 Table of Contents Preface .......................................................................................................................................... ix 1. Conventions ...................................................................................................................... ix 2. Document change history ................................................................................................... x About this Document ..................................................................................................................... xi 1. Notices .............................................................................................................................. xi 1. Introduction ................................................................................................................................ 1 1.1. Reference Documentation ............................................................................................... 1 2. Low-Level System Information ................................................................................................... 3 2.1. Machine Interface ............................................................................................................ 3 2.2. Function Calling Sequence ........................................................................................... 22 2.3. Coding Examples .......................................................................................................... 48 2.4. DWARF Definition ......................................................................................................... 72 2.5. Exception Handling ....................................................................................................... 73 3. Object Files .............................................................................................................................. 74 3.1. ELF Header .................................................................................................................. 74 3.2. Special Sections ............................................................................................................ 74 3.3. TOC .............................................................................................................................. 75 3.4. Symbol Table ................................................................................................................ 76 3.5. Relocation Types ........................................................................................................... 78 3.6. Assembler- and Linker-Mediated Executable Optimization ............................................. 88 3.7. Thread Local Storage ABI ............................................................................................. 90 3.8. System Support Functions and Extensions ................................................................. 101 4. Program Loading and Dynamic Linking .................................................................................. 104 4.1. Program Loading ......................................................................................................... 104 4.2. Dynamic Linking .......................................................................................................... 113 5. Libraries ................................................................................................................................. 119 5.1. Library Requirements .................................................................................................. 119 5.2. POWER ISA-Specific API and ABI Extensions ............................................................ 121 6. Vector Programming Interfaces .............................................................................................. 122 6.1. Vector Data Types ....................................................................................................... 122 6.2. Vector Operators ......................................................................................................... 123 6.3. Vector Layout and Element Numbering ....................................................................... 123 6.4. Vector Built-in Functions .............................................................................................. 124 6.5. Language-Specific Vector Support for Other Languages .............................................. 129 6.6. Library Interfaces ........................................................................................................ 131 A. Predefined Functions for Vector Programming ....................................................................... 133 A.1. Vector Built-In Functions ............................................................................................. 133 A.2. Built-In Vector Predicate Functions ............................................................................. 179 A.3. Coding Support ........................................................................................................... 187 A.4. VSCR Management Built-in Functions ........................................................................ 190 A.5. PowerSIMD API Named Constants ............................................................................. 190 A.6. Deprecated Compatibility Functions ............................................................................ 191 A.7. Deprecated Functions ................................................................................................. 198 B. Binary-Coded Decimal Built-In Functions ............................................................................... 215 B.1. BCD Header Functions ............................................................................................... 217 C. Glossary ................................................................................................................................ 221 D. OpenPOWER Foundation overview ....................................................................................... 223 D.1. Foundation documentation .......................................................................................... 223 Workgroup Specification OpenPOWER Foundation iii Standard Track 64-Bit ELF V2 ABI Specification May 10, 2017 Revision 1.4 D.2. Technical resources ...................................................................................................