Keil Logo

ARM Compiler User Guide

ARM® Compiler User Guide

Version 6.7


Table of Contents

Preface
About this book
Using this book
Glossary
Typographic conventions
Feedback
Other information
1 Getting Started
1.1 Introduction to ARM® Compiler 6
1.2 Installing ARM® Compiler
1.3 Accessing ARM® Compiler from ARM® DS-5
1.4 Accessing ARM® Compiler from Keil® µVision®
1.5 Compiling a Hello World example
1.6 Using the integrated assembler
1.7 Running bare-metal images
1.8 ARM architectures supported by the toolchain
2 Using Common Compiler Options
2.1 Mandatory armclang options
2.2 Selecting source language options
2.3 Selecting optimization options
2.4 Building to aid debugging
2.5 Linker options for mapping code and data to target memory
2.6 Controlling diagnostic messages
2.7 Selecting floating-point options
2.8 Compilation tools command-line option rules
3 Writing Optimized Code
3.1 Optimizing loops
3.2 Inlining functions
3.3 Examining stack usage
3.4 Packing data structures
4 Using Assembly and Intrinsics in C or C++ Code
4.1 Using intrinsics
4.2 Writing inline assembly code
4.3 Calling assembly functions from C and C++
5 Mapping Code and Data to the Target
5.1 What the linker does to create an image
5.1.1 What you can control with a scatter file
5.2 Placing data items for target peripherals with a scatter file
5.3 Placing the stack and heap with a scatter file
5.4 Root region
5.4.1 Effect of the ABSOLUTE attribute on a root region
5.4.2 Effect of the FIXED attribute on a root region
5.5 Placing functions and data in a named section
5.6 Placing functions and data at specific addresses
5.6.1 Placing __at sections at a specific address
5.6.2 Restrictions on placing __at sections
5.6.3 Automatically placing __at sections
5.6.4 Manually placing __at sections
5.6.5 Placing a key in flash memory with an __at section
5.6.6 Placing constants at fixed locations
5.6.7 Placing jump tables in ROM
5.6.8 Placing a variable at a specific address without scatter-loading
5.6.9 Placing a variable at a specific address with scatter-loading
5.7 Placing ARM® C and C++ library code
5.7.1 Placing code in a root region
5.7.2 Placing ARM® C library code
5.7.3 Placing ARM® C++ library code
5.8 Placing unassigned sections
5.8.1 Default rules for placing unassigned sections
5.8.2 Command-line options for controlling the placement of unassigned sections
5.8.3 Prioritizing the placement of unassigned sections
5.8.4 Specify the maximum region size permitted for placing unassigned sections
5.8.5 Examples of using placement algorithms for .ANY sections
5.8.6 Example of next_fit algorithm showing behavior of full regions, selectors, and priority
5.8.7 Examples of using sorting algorithms for .ANY sections
5.8.8 Behavior when .ANY sections overflow because of linker-generated content
5.9 Placing veneers with a scatter file
5.10 Preprocessing a scatter file
5.10.1 Default behavior for armclang -E in a scatter file
5.10.2 Using other preprocessors in a scatter file
5.11 Reserving an empty block of memory
5.11.1 Characteristics of a reserved empty block of memory
5.11.2 Example of reserving an empty block of memory
5.12 Aligning regions to page boundaries
5.13 Aligning execution regions and input sections
A Supporting reference information
A.1 Support level definitions
A.2 Standards compliance in ARM® Compiler
A.3 Compliance with the ABI for the ARM Architecture (Base Standard)
A.4 GCC compatibility provided by ARM® Compiler 6
A.5 Toolchain environment variables
A.6 Clang and LLVM documentation
A.7 Further reading

Release Information

Document History
Issue Date Confidentiality Change
0606-00 04 November 2016 Non-Confidential ARM Compiler v6.6 Release
0607-00 05 April 2017 Non-Confidential ARM Compiler v6.7 Release

Non-Confidential Proprietary Notice

This document is protected by copyright and other related rights and the practice or implementation of the information contained in this document may be protected by one or more patents or pending patent applications. No part of this document may be reproduced in any form by any means without the express prior written permission of ARM. No license, express or implied, by estoppel or otherwise to any intellectual property rights is granted by this document unless specifically stated.

Your access to the information in this document is conditional upon your acceptance that you will not use or permit others to use the information for the purposes of determining whether implementations infringe any third party patents.

THIS DOCUMENT IS PROVIDED “AS IS”. ARM PROVIDES NO REPRESENTATIONS AND NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, SATISFACTORY QUALITY, NON-INFRINGEMENT OR FITNESS FOR A PARTICULAR PURPOSE WITH RESPECT TO THE DOCUMENT. For the avoidance of doubt, ARM makes no representation with respect to, and has undertaken no analysis to identify or understand the scope and content of, third party patents, copyrights, trade secrets, or other rights.

This document may include technical inaccuracies or typographical errors.

TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL ARM BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE, OR CONSEQUENTIAL DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF ANY USE OF THIS DOCUMENT, EVEN IF ARM HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

This document consists solely of commercial items. You shall be responsible for ensuring that any use, duplication or disclosure of this document complies fully with any relevant export laws and regulations to assure that this document or any portion thereof is not exported, directly or indirectly, in violation of such export laws. Use of the word “partner” in reference to ARM’s customers is not intended to create or refer to any partnership relationship with any other company. ARM may make changes to this document at any time and without notice.

If any of the provisions contained in these terms conflict with any of the provisions of any signed written agreement covering this document with ARM, then the signed written agreement prevails over and supersedes the conflicting provisions of these terms. This document may be translated into other languages for convenience, and you agree that if there is any conflict between the English version of this document and any translation, the terms of the English version of the Agreement shall prevail.

Words and logos marked with ® or ™ are registered trademarks or trademarks of ARM Limited or its affiliates in the EU and/or elsewhere. All rights reserved. Other brands and names mentioned in this document may be the trademarks of their respective owners. Please follow ARM’s trademark usage guidelines at http://www.arm.com/about/trademark-usage-guidelines.php

Copyright © 2016, 2017, ARM Limited or its affiliates. All rights reserved.

ARM Limited. Company 02557590 registered in England.

110 Fulbourn Road, Cambridge, England CB1 9NJ.

LES-PRE-20349

Confidentiality Status

This document is Non-Confidential. The right to use, copy and disclose this document may be subject to license restrictions in accordance with the terms of the agreement entered into by ARM and the party that ARM delivered this document to.

Unrestricted Access is an ARM internal classification.

Product Status

The information in this document is Final, that is for a developed product.

Web Address

Non-ConfidentialPDF file icon PDF versionARM 100748_0607_00_en
Copyright © 2016, 2017 ARM Limited or its affiliates. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.