
www.openpowerfoundation.org 64-Bit ELF V2 ABI Specification December 1, 2020 Revision 1.5 64-Bit ELF V2 ABI Specification: Power Architecture System Software Work Group <[email protected]> IBM Revision 1.5 (December 1, 2020) Copyright © 2014-2020 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 December 1, 2020 Revision 1.5 Table of Contents Preface ........................................................................................................................................... x 1. Conventions ....................................................................................................................... x 2. Document change history .................................................................................................. xi About this Document .................................................................................................................... xii 1. Introduction ................................................................................................................................ 1 1.1. Reference Documentation ............................................................................................... 1 1.2. Changes from Revision 1.4 ............................................................................................. 2 1.3. Conformance to this Specification ................................................................................... 2 2. Low-Level System Information ................................................................................................... 4 2.1. Machine Interface ............................................................................................................ 4 2.1.1. Processor Architecture ......................................................................................... 4 2.1.2. Data Representation ............................................................................................ 4 2.1.2.1. Byte Ordering ............................................................................................ 4 2.1.2.2. Fundamental Types ................................................................................... 7 2.1.2.3. Aggregates and Unions ........................................................................... 11 2.1.2.4. Bit Fields ................................................................................................. 19 2.1.3. Code Alignment .................................................................................................. 23 2.2. Function Calling Sequence ........................................................................................... 24 2.2.1. Function Call Linkage Protocols ......................................................................... 24 2.2.1.1. External Call, Caller Uses TOC ............................................................... 25 2.2.1.2. External Call, Caller Does Not Use TOC or Preserve r2 ........................... 25 2.2.1.3. Local Call, Caller Uses TOC, Callee Preserves r2 ................................... 25 2.2.1.4. Local Call, Caller Uses TOC, Callee Does Not Preserve r2 ...................... 25 2.2.1.5. Local Call, Caller Does Not Preserve r2, Callee Uses TOC ...................... 25 2.2.1.6. Local Call, Caller Does Not Preserve r2, Callee Does Not Use TOC ......... 26 2.2.2. Registers ............................................................................................................ 26 2.2.2.1. Register Roles ......................................................................................... 26 2.2.2.2. Limited-Access Bits ................................................................................. 31 2.2.3. The Stack Frame ............................................................................................... 33 2.2.3.1. General Stack Frame Requirements ........................................................ 34 2.2.3.2. Minimum Stack Frame Elements ............................................................. 35 2.2.3.3. Optional Save Areas ............................................................................... 36 2.2.3.4. Protected Zone ........................................................................................ 40 2.2.4. Parameter Passing in Registers ......................................................................... 40 2.2.4.1. Parameter Passing Register Selection Algorithm ..................................... 43 2.2.4.2. Parameter Passing Examples .................................................................. 46 2.2.5. Variable Argument Lists ...................................................................................... 50 2.2.6. Return Values ..................................................................................................... 51 2.3. Coding Examples .......................................................................................................... 51 2.3.1. Code Model Overview ........................................................................................ 52 2.3.1.1. Position-Dependent Code ........................................................................ 52 2.3.1.2. Position-Independent Code ...................................................................... 53 2.3.1.3. Code Models ........................................................................................... 55 2.3.2. Function Prologue and Epilogue ......................................................................... 55 2.3.2.1. Function Prologue ................................................................................... 55 2.3.2.2. Function Epilogue .................................................................................... 57 2.3.2.3. Rules for Prologue and Epilogue Sequences ........................................... 57 2.3.3. Register Save and Restore Functions ................................................................ 58 Workgroup Specification OpenPOWER Foundation iii Standard Track 64-Bit ELF V2 ABI Specification December 1, 2020 Revision 1.5 2.3.3.1. GPR Save and Restore Functions ........................................................... 58 2.3.3.2. FPR Save and Restore Functions ........................................................... 60 2.3.3.3. Vector Save and Restore Functions ......................................................... 61 2.3.4. Function Pointers ............................................................................................... 62 2.3.5. Static Data Objects ............................................................................................ 63 2.3.6. Function Calls ...................................................................................................
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages154 Page
-
File Size-