Codewarrior Development Studio for Starcore 3900FP Dsps Application Binary Interface (ABI) Reference Manual
Total Page:16
File Type:pdf, Size:1020Kb
CodeWarrior Development Studio for StarCore 3900FP DSPs Application Binary Interface (ABI) Reference Manual Document Number: CWSCABIREF Rev. 10.9.0, 06/2015 CodeWarrior Development Studio for StarCore 3900FP DSPs Application Binary Interface (ABI) Reference Manual, Rev. 10.9.0, 06/2015 2 Freescale Semiconductor, Inc. Contents Section number Title Page Chapter 1 Introduction 1.1 Standards Covered............................................................................................................................................................ 7 1.2 Accompanying Documentation........................................................................................................................................ 8 1.3 Conventions...................................................................................................................................................................... 8 1.3.1 Numbering Systems............................................................................................................................................. 8 1.3.2 Typographic Notation.......................................................................................................................................... 9 1.3.3 Special Terms.......................................................................................................................................................9 Chapter 2 Low-level Binary Interface 2.1 StarCore Architectures......................................................................................................................................................11 2.2 Endian Support..................................................................................................................................................................12 2.3 Fundamental Data Types.................................................................................................................................................. 12 2.4 Aggregates and Unions.....................................................................................................................................................14 2.5 Bit Fields...........................................................................................................................................................................16 2.6 Function Calling Sequence............................................................................................................................................... 18 2.6.1 Argument Passing................................................................................................................................................ 19 2.6.2 Return Values.......................................................................................................................................................20 2.6.3 Processor Mode Bits............................................................................................................................................ 20 2.6.4 Variable Argument Lists......................................................................................................................................22 2.6.5 Stack.....................................................................................................................................................................23 2.6.6 Stack Frame Layout............................................................................................................................................. 23 2.6.7 Stack Unwinding..................................................................................................................................................24 2.6.8 Register Saving and Restoring Functions............................................................................................................ 26 2.6.9 Layout of setjmp and longjmp............................................................................................................................. 27 2.6.10 Frame and Global Pointers...................................................................................................................................28 2.6.11 Dynamic Memory Allocation.............................................................................................................................. 28 2.6.12 Hardware Loops...................................................................................................................................................29 CodeWarrior Development Studio for StarCore 3900FP DSPs Application Binary Interface (ABI) Reference Manual, Rev. 10.9.0, 06/2015 Freescale Semiconductor, Inc. 3 Section number Title Page 2.7 Address Modifier Modes.................................................................................................................................................. 29 2.8 Compatibility with SC3850.............................................................................................................................................. 29 2.9 Data Addressing Models...................................................................................................................................................30 Chapter 3 High-level Language Issues 3.1 C Preprocessor Predefines................................................................................................................................................ 31 3.2 C Name Mapping..............................................................................................................................................................31 3.3 C++ Name Mapping (Name Mangling)............................................................................................................................32 3.4 C System Calls..................................................................................................................................................................32 3.5 Compiler Assist Libraries................................................................................................................................................. 33 3.5.1 Floating-Point Routines....................................................................................................................................... 33 3.5.2 Integer and Fractional Arithmetic Routines.........................................................................................................37 3.5.3 Optional Integer Routines.................................................................................................................................... 38 3.6 Access to Architectural Features...................................................................................................................................... 39 Chapter 4 Object File Format 4.1 Interface Descriptions....................................................................................................................................................... 41 4.2 ELF Header.......................................................................................................................................................................42 4.3 Sections.............................................................................................................................................................................44 4.4 Relocation......................................................................................................................................................................... 45 4.4.1 Relocation Types..................................................................................................................................................47 4.4.2 Relocation Stack.................................................................................................................................................. 67 4.4.3 Instruction Address Versus VLES Address......................................................................................................... 69 4.5 Note Section......................................................................................................................................................................70 4.6 Program Headers...............................................................................................................................................................71 4.7 Debugging.........................................................................................................................................................................72 4.7.1 DWARF Register Number Mapping................................................................................................................... 72 Chapter 5 Assembler Syntax and Directives 5.1 Assembler Significant Characters.....................................................................................................................................75 CodeWarrior Development Studio for StarCore 3900FP DSPs Application Binary Interface (ABI) Reference Manual, Rev. 10.9.0, 06/2015 4 Freescale Semiconductor, Inc. Section number Title Page 5.2 Assembler Directives........................................................................................................................................................76 5.3 Assembler Syntax............................................................................................................................................................. 77 5.3.1 Symbol Names....................................................................................................................................................