没有合适的资源?快使用搜索试试~ 我知道了~
首页GreenHills 2017.7 编译手册
资源详情
资源评论
资源推荐
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币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- zigbee-cluster-library-specification
- JSBSim Reference Manual
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论10