没有合适的资源?快使用搜索试试~ 我知道了~
GreenHills 2017.7 编译手册
5星 · 超过95%的资源 需积分: 46 171 下载量 84 浏览量
2019-03-28
14:09:27
上传
评论 10
收藏 8.82MB PDF 举报
温馨提示
试读
1066页
本手册是GreenHills2017.7.14 版编译器的软件使用手册。
资源推荐
资源详情
资源评论
MULTI: Building Applications for
Embedded Power Architecture
Green Hills Software
30 West Sola Street
Santa Barbara, California 93101
USA
Tel: 805-965-6044
Fax: 805-965-6343
www.ghs.com
LEGAL NOTICES AND DISCLAIMERS
GREEN HILLS SOFTWARE MAKES NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE
CONTENTS HEREOF AND SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY
OR FITNESS FOR ANY PARTICULAR PURPOSE. Further, Green Hills Software reserves the right to revise this
publication and to make changes from time to time in the content hereof without obligation of Green Hills Software to
notify any person of such revision or changes.
Copyright © 1983-2017 by Green Hills Software. All rights reserved. No part of this publication may be reproduced, stored
in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or
otherwise, without prior written permission from Green Hills Software.
Green Hills, the Green Hills logo, CodeBalance, GMART, GSTART, INTEGRITY, MULTI, and Slingshot are registered
trademarks of Green Hills Software. AdaMULTI, Built with INTEGRITY, EventAnalyzer, G-Cover, GHnet, GHnetLite,
Green Hills Probe, Integrate, ISIM, u-velOSity, PathAnalyzer, Quick Start, ResourceAnalyzer, Safety Critical Products,
SuperTrace Probe, TimeMachine, TotalDeveloper, DoubleCheck, and velOSity are trademarks of Green Hills Software.
All other company, product, or service names mentioned in this book may be trademarks or service marks of their respective
owners.
For a listing of Green Hills Software's periodically updated patent marking information, please visit
http://www.ghs.com/copyright_patent.html.
PubID: build_ppc_no_wmaade-589570
Branch: http://toolsvc/branches/release-branch-2017-1-comp
Date: April 9, 2017
Contents
Preface xxv
About This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvi
The MULTI Document Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvi
Conventions Used in the MULTI Document Set . . . . . . . . . . . . . . . . . . . xxvii
The Green Hills Toolchain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxx
The C and C++ Compiler Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxx
The Optimizing Compilers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxx
The asppc Assembler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxi
The ax Librarian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxi
The elxr Linker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxii
Optimized Libraries and Header Files . . . . . . . . . . . . . . . . . . . . . . . xxxii
Utility Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxiii
The Builder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxiii
Part I. Using the MULTI Compiler 1
1. The Compiler Driver 3
Compiler Driver Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Building an Executable from C or C++ Source Files . . . . . . . . . . . . . . 6
Working with Input Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Recognized Input File Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Passing Multiple Input File Types to the Driver . . . . . . . . . . . . . . 9
Passing Linker Directives Files to the Driver . . . . . . . . . . . . . . . . . 9
Generating Other Output File Types . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Creating Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Adding and Updating Files in Libraries . . . . . . . . . . . . . . . . . . . . 12
Driver Options for Intermediate Forms of Output . . . . . . . . . . . . 12
Output File Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Controlling Driver Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
iiiGreen Hills Software
Using a Driver Options File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Using Makeles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Driver Options for Individual Compiler Passes . . . . . . . . . . . . . . 21
Green Hills Equivalents to GNU Tools . . . . . . . . . . . . . . . . . . . . . 22
Generating Dependency and Header File Information . . . . . . . . 22
2. Developing for Power Architecture 25
Power Architecture Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Register Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Data Type Sizes and Alignment Requirements . . . . . . . . . . . . . . 28
Calling Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Structure Packing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Understanding Structure Packing . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Using #pragma pack to Pack All Instances of a Structure
Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Using the Packing Builder Option to Pack All Structures . . . . . 34
Pointing to Packed Structures with the __packed Type
Qualier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Specifying a Power Architecture Target . . . . . . . . . . . . . . . . . . . . . . . . 36
Power Architecture Processor Variants . . . . . . . . . . . . . . . . . . . . . 38
Enabling Debugging Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Generating Debugging Information . . . . . . . . . . . . . . . . . . . . . . . . 47
Generating Debugging Information for Applications Compiled
with Third-Party Compilers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Enabling Command Line Function Calls . . . . . . . . . . . . . . . . . . . 54
Obtaining Proling Information . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Enabling Run-Time Error Checking . . . . . . . . . . . . . . . . . . . . . . . 61
Enabling Run-Time Memory Checking . . . . . . . . . . . . . . . . . . . . 62
Using Your Own Header Files and Libraries . . . . . . . . . . . . . . . . . . . . 66
Instructing the Compiler to Search for Your Headers . . . . . . . . . 67
Instructing the Compiler to Link Against Your Libraries . . . . . . 69
Controlling the Assembler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Controlling the Linker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Working with Linker Directives Files . . . . . . . . . . . . . . . . . . . . . . 70
AltiVec Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
AltiVec Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
MULTI: Building Applications for Embedded Power Architectureiv
Contents
AltiVec Register Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
AltiVec Calling Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
AltiVec Data Alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Signal Processing Engine (SPE) Instructions . . . . . . . . . . . . . . . . . . . . 75
Decorated Load and Store Support . . . . . . . . . . . . . . . . . . . . . . . . 76
SPE and Embedded Floating-Point Instruction Support . . . . . . . 77
SPE Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
SPE Register Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
SPE Calling Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
SPE Data Alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Avoiding SPE Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
64-Bit Mode Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Text and Data Placement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Default Program Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Custom Program Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Aligned Data Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Individual Function and Variable Sections . . . . . . . . . . . . . . . . . . 87
Assigning Program Sections to ROM and RAM . . . . . . . . . . . . . 90
Storing Global Variables in Registers . . . . . . . . . . . . . . . . . . . . . . 93
Near and Far Function Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Special Data Area Optimizations . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Position Independent Code (PIC) . . . . . . . . . . . . . . . . . . . . . . . . 109
Position Independent Data (PID) . . . . . . . . . . . . . . . . . . . . . . . . . 111
Customizing the Green Hills Run-Time Environment . . . . . . . . . . . 113
Other Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Renaming the Output Executable . . . . . . . . . . . . . . . . . . . . . . . . 113
Specifying an Alternate Program Start Address . . . . . . . . . . . . 113
Interrupt Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Symbolic Memory-Mapped I/O . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Verifying Program Integrity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
3. Builder and Driver Options 119
Target Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Endianness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
32/64-bit Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Floating-Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Text and Data Placement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
vGreen Hills Software
Contents
剩余1065页未读,继续阅读
horse6508
- 粉丝: 10
- 资源: 73
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页