CrossWorks for ARM
Preface
Introduction
What is CrossWorks?
What we don't tell you
Release notes
Activating your product
Text conventions
Standard syntactic metalanguage
Requesting support and reporting problems
CrossStudio Reference
CrossStudio Tutorial
Activating CrossWorks
Managing support packages
Creating a project
Managing files in a project
Setting project options
Building projects
Exploring projects
Using the debugger
Low-level debugging
Debugging externally built applications
Overview
The title bar
The menu bar
The status bar
The editing workspace
Project management
Overview
Creating a project
Adding existing files to a project
Adding new files to a project
Removing a file, folder, project, or project link
Project properties
Project configurations
Project dependencies and build order
Project macros
Building projects
Source control
Debug expressions
Basic editing
Navigation
Bookmarks
Changing text
Using the clipboard
Drag and drop editing
Undo and redo
Indentation
File management
Find and replace
Regular expressions
Advanced editor features
Code templates
Memory map editor
Package management
Linking and section placement
CrossStudio Windows
Clipboard ring window
Breakpoints window
Call stack window
Execution counts window
Find and replace window
Globals window
Locals window
Memory window
Memory usage window
Register windows
Threads window
Trace window
Watch window
Help window
Output window
Project explorer
Properties window
Source navigator window
Symbol browser
Targets window
Terminal emulator window
Target interfaces
Macraigor Wiggler (20 and 14 pin) Target interface
Generic FT2232 device target interface
Amontec JTAGkey Target interface
Olimex ARM-USB-OCD Target interface
CrossConnect Target interface
Segger J-Link Target interface
ARM Simulator Target interface
ARM Target Support
Target startup code
Startup code
Memory map files
Project configurations
Target script file
TargetInterface Object
TargetInterface.beginDebugAccess
TargetInterface.delay
TargetInterface.downloadDebugHandler
TargetInterface.endDebugAccess
TargetInterface.eraseBytes
TargetInterface.error
TargetInterface.executeFunction
TargetInterface.getRegister
TargetInterface.idcode
TargetInterface.message
TargetInterface.peekByte
TargetInterface.peekBytes
TargetInterface.peekMultUint16
TargetInterface.peekMultUint32
TargetInterface.peekUint16
TargetInterface.peekUint32
TargetInterface.peekWord
TargetInterface.pokeByte
TargetInterface.pokeBytes
TargetInterface.pokeMultUint16
TargetInterface.pokeMultUint32
TargetInterface.pokeUint16
TargetInterface.pokeUint32
TargetInterface.pokeWord
TargetInterface.resetAndStop
TargetInterface.resetAndStopAtZero
TargetInterface.setDebugInterfaceProperty
TargetInterface.setDeviceType
TargetInterface.setICEBreakerBreakpoint
TargetInterface.setMaximumJTAGFrequency
TargetInterface.setNSRST
TargetInterface.setRegister
TargetInterface.stop
TargetInterface.stopAndReset
TargetInterface.trst
TargetInterface.waitForDebugState
Program loading
Dialogs
Debug file search editor
Environment Options Dialog
Building options
Debugging options
Environment options
Source Control options
Text Editor options
Language options
CrossStudio menu summary
File menu
New menu
Edit menu
Clipboard menu
Clipboard Ring menu
Macros menu
Edit Selection menu
Bookmarks menu
Advanced menu
View menu
Other Windows menu
Browser menu
Toolbars menu
Search menu
Project menu
Build menu
Debug menu
Debug Control menu
Breakpoint menu
Debug Windows menu
Tools menu
Window menu
Help menu
Tasking Library Tutorial
Overview
Tasks
Event sets
Semaphores
Message queues
Byte queues
Global interrupts control
Timer support
Programmable interrupt handling
Low-level interrupt handling
Memory areas
Library Reference
ARM Library Reference
<ctl_api.h> - Tasking functions
ctl_byte_queue_init
ctl_byte_queue_post
ctl_byte_queue_post_nb
ctl_byte_queue_receive
ctl_byte_queue_receive_nb
ctl_current_time
ctl_events_init
ctl_events_set_clear
ctl_events_wait
ctl_exit_isr
ctl_get_current_time
ctl_get_ticks_per_second
ctl_global_interrupts_disable
ctl_global_interrupts_enable
ctl_global_interrupts_re_enable_from_isr
ctl_global_interrupts_set
ctl_global_interrupts_un_re_enable_from_isr
ctl_handle_error
ctl_increment_tick_from_isr
ctl_interrupt_count
ctl_libc_mutex
ctl_mask_isr
ctl_memory_area_allocate
ctl_memory_area_free
ctl_memory_area_init
ctl_message_queue_init
ctl_message_queue_post
ctl_message_queue_post_nb
ctl_message_queue_receive
ctl_message_queue_receive_nb
ctl_semaphore_init
ctl_semaphore_signal
ctl_semaphore_wait
ctl_timeout_wait
ctl_set_isr
ctl_task_die
ctl_task_executing
ctl_task_init
ctl_task_list
ctl_task_remove
ctl_task_reschedule
ctl_task_run
ctl_task_set_priority
ctl_timeout_wait
ctl_timeslice_period
ctl_umask_isr
<cross_studio_io.h> - Debug I/O library
debug_break
debug_clearerr
debug_exit
debug_fclose
debug_feof
debug_ferror
debug_fflush
debug_fgetc
debug_fgetpos
debug_fgets
debug_filesize
debug_fopen
debug_fprintf
debug_fputc
debug_fputs
debug_fread
debug_freopen
debug_fscanf
debug_fseek
debug_setpos
debug_ftell
debug_fwrite
debug_getargs
debug_getch
debug_getchar
debug_getd
debug_getenv
debug_getf
debug_geti
debug_getl
debug_getll
debug_gets
debug_getu
debug_getul
debug_getull
debug_kbhit
debug_perror
debug_printf
debug_putchar
debug_puts
debug_remove
debug_rename
debug_rewind
debug_runtime_error
debug_scanf
debug_system
debug_time
debug_tmpfile
debug_tmpnam
debug_ungetc
debug_vfprintf
debug_vfscanf
debug_vprintf
debug_vscanf
<libarm.h> - ARM specific library
libarm.h File Reference
libarm_dcc_read
libarm_dcc_write
libarm_disable_irq
libarm_disable_irq_fiq
libarm_disable_fiq
libarm_enable_irq
libarm_enable_irq_fiq
libarm_enable_fiq
libarm_get_cpsr
libarm_isr_disable_irq
libarm_isr_enable_irq
libarm_mmu_flat_initialise_level_1_table
libarm_mmu_flat_initialise_level_2_small_page_table
libarm_mmu_flat_set_level_1_cacheable_region
libarm_mmu_flat_set_level_2_small_page_cacheable_region
libarm_restore_irq_fiq
libarm_run_dcc_port_server
libarm_set_cpsr
libarm_set_fiq
libarm_set_irq
Data Fields
Data Fields
File Index
<libmem.h> - Memory Programming library
libmem.h File Reference
Using LIBMEM
Light version of LIBMEM
Writing LIBMEM drivers
Data Structures
LIBMEM_ADDRESS_IN_RANGE
LIBMEM_ADDRESS_IS_ALIGNED
LIBMEM_ALIGNED_ADDRESS
LIBMEM_CFI_CMDSET_AMD_EXTENDED
LIBMEM_CFI_CMDSET_AMD_STANDARD
LIBMEM_CFI_CMDSET_INTEL_EXTENDED
LIBMEM_CFI_CMDSET_INTEL_STANDARD
LIBMEM_CFI_CMDSET_MITSUBISHI_EXTENDED
LIBMEM_CFI_CMDSET_MITSUBISHI_STANDARD
LIBMEM_CFI_CMDSET_NONE
LIBMEM_CFI_CMDSET_RESERVED
LIBMEM_CFI_CMDSET_SST_PAGE_WRITE
LIBMEM_CFI_CMDSET_WINBOND_STANDARD
LIBMEM_INLINE
LIBMEM_KB
LIBMEM_MB
LIBMEM_RANGE_OCCLUDES_RANGE
LIBMEM_RANGE_OVERLAPS_RANGE
LIBMEM_RANGE_WITHIN_RANGE
LIBMEM_STATUS_CFI_ERROR
LIBMEM_STATUS_ERROR
LIBMEM_STATUS_GEOMETRY_REGION_OVERFLOW
LIBMEM_STATUS_INVALID_DEVICE
LIBMEM_STATUS_INVALID_PARAMETER
LIBMEM_STATUS_INVALID_RANGE
LIBMEM_STATUS_INVALID_WIDTH
LIBMEM_STATUS_LOCKED
LIBMEM_STATUS_NOT_IMPLEMENTED
LIBMEM_STATUS_NO_DRIVER
LIBMEM_STATUS_SUCCESS
LIBMEM_STATUS_TIMEOUT
_libmem_driver_functions_t Struct Reference
_libmem_driver_functions_t::erase
_libmem_driver_functions_t::fill
_libmem_driver_functions_t::flush
_libmem_driver_functions_t::lock
_libmem_driver_functions_t::unlock
_libmem_driver_functions_t::write
_libmem_driver_handle_t Struct Reference
_libmem_driver_handle_t::driver_data
_libmem_driver_handle_t::driver_functions
_libmem_driver_handle_t::ext_driver_functions
_libmem_driver_handle_t::flash_info
_libmem_driver_handle_t::geometry
_libmem_driver_handle_t::next
_libmem_driver_handle_t::size
_libmem_driver_handle_t::start
_libmem_driver_handle_t::user_data
_libmem_ext_driver_functions_t Struct Reference
_libmem_ext_driver_functions_t::crc32
_libmem_ext_driver_functions_t::inrange
_libmem_ext_driver_functions_t::read
_libmem_flash_info_t Struct Reference
_libmem_flash_info_t::erase_chip_timeout_ticks
_libmem_flash_info_t::erase_sector_timeout_ticks
_libmem_flash_info_t::max_multi_program_bytes
_libmem_flash_info_t::pairing
_libmem_flash_info_t::primary_cmdset
_libmem_flash_info_t::width
_libmem_flash_info_t::write_timeout_ticks
_libmem_geometry_t Struct Reference
_libmem_geometry_t::count
_libmem_geometry_t::size
_libmem_sector_info_t Struct Reference
_libmem_sector_info_t::number
_libmem_sector_info_t::size
_libmem_sector_info_t::start
libmem_cfi_get_info
libmem_crc32
libmem_crc32_direct
libmem_driver_crc32_fn_t
libmem_driver_erase_fn_t
libmem_driver_fill_fn_t
libmem_driver_flush_fn_t
libmem_driver_functions_t
libmem_driver_handle_t
libmem_driver_inrange_fn_t
libmem_driver_lock_fn_t
libmem_driver_read_fn_t
libmem_driver_unlock_fn_t
libmem_driver_write_fn_t
libmem_drivers
libmem_enable_timeouts
libmem_erase
libmem_erase_all
libmem_ext_driver_functions_t
libmem_fill
libmem_flash_info_t
libmem_flush
libmem_foreach_driver
libmem_foreach_driver_fn_t
libmem_foreach_sector
libmem_foreach_sector_fn_t
libmem_foreach_sector_in_range
libmem_geometry_t
libmem_get_driver
libmem_get_geometry_size
libmem_get_number_of_regions
libmem_get_number_of_sectors
libmem_get_sector_info
libmem_get_sector_number
libmem_get_ticks
libmem_get_ticks_fn
libmem_get_ticks_fn_t
libmem_lock
libmem_lock_all
libmem_read
libmem_register_am29f200b_driver
libmem_register_am29f200t_driver
libmem_register_am29f400bb_driver
libmem_register_am29f400bt_driver
libmem_register_am29fxxx_driver
libmem_register_am29lv010b_driver
libmem_register_cfi_0001_16_driver
libmem_register_cfi_0001_8_driver
libmem_register_cfi_0002_16_driver
libmem_register_cfi_0002_8_driver
libmem_register_cfi_0003_16_driver
libmem_register_cfi_0003_8_driver
libmem_register_cfi_amd_driver
libmem_register_cfi_driver
libmem_register_cfi_intel_driver
libmem_register_driver
libmem_register_ram_driver
libmem_register_sst39xFx00A_16_driver
libmem_register_st_m28w320cb_driver
libmem_register_st_m28w320ct_driver
libmem_sector_info_t
libmem_ticks_per_second
libmem_unlock
libmem_unlock_all
libmem_write
<libmem_loader.h> - Loader functions
libmem_loader.h File Reference
libmem_rpc_loader_start
libmem_dcc_rpc_loader_start
libmem_dcc_loader_start
libmem_dcc_loader_set_param_fn_t
LIBMEM_RPC_LOADER_MAGIC_NUMBER
Standard C Library Reference
<assert.h> - Diagnostics
assert
<ctype.h> - Character handling
isalnum
isalpha
isblank
iscntrl
isdigit
isgraph
isupper
isprint
ispunct
isspace
isupper
isxdigit
tolower
toupper
<errno.h> - Errors
errno
<float.h> - Float numerical limits
<limits.h> - Integer numerical limits
CHAR_BIT
CHAR_MIN
CHAR_MAX
INT_MIN
INT_MAX
LLONG_MIN
LLONG_MAX
LONG_MIN
LONG_MAX
SCHAR_MIN
SCHAR_MAX
SHRT_MIN
SHRT_MAX
UCHAR_MAX
UINT_MAX
ULLONG_MAX
ULONG_MAX
USHRT_MAX
<locale.h> - C localization
<math.h> - Mathematics
acos
acosf
acosh
acoshf
asin
asinf
asinh
asinhf
atan
atan2
atan2f
atanf
atanh
atanhf
cbrt
cbrtf
ceil
ceilf
cos
cosf
cosh
coshf
exp
expf
fabs
fabsf
floor
floorf
fmax
fmaxf
fmin
fminf
fmod
fmodf
frexp
frexpf
hypot
hypotf
isfinite
isinf
isnan
ldexp
ldexpf
log
log10
log10f
logf
modf
modff
pow
powf
scalbn
scalbnf
sin
sinf
sinh
sinhf
sqrt
sqrtf
tan
tanf
tanh
tanhf
<setjmp.h> - Non-local jumps
jmp_buf
longjmp
setjmp
<stdarg.h> - Variable arguments
va_arg
va_copy
va_end
va_end
<stdio.h> - Input/output functions
Formatted output control strings
Formatted input control strings
getchar
gets
printf
putchar
puts
scanf
snprintf
sprintf
sscanf
vprintf
vscanf
vsnprintf
vsprintf
vsscanf
<stdlib.h> - General utilities
atexit
atof
atoi
atol
atoll
bsearch
calloc
div
div_t
exit
free
itoa
ldiv
ldiv_t
lldiv
lldiv_t
lltoa
ltoa
malloc
qsort
rand
RAND_MAX
realloc
srand
strtol
strtof
strtol
strtoll
strtoul
strtoull
ultoa
ultoa
utoa
<string.h> - String handling
memchr
memcmp
memcpy
memmove
memset
strcat
strchr
strcmp
strcoll
strcpy
strcspn
strerror
strlen
strncat
strncmp
strncpy
strpbrk
strrchr
strspn
strstr
strtok
<time.h> - C Time
asctime and asctime_r
ctime and ctime_r
difftime
gmtime and gmtime_r
localtime and localtime_r
mktime
strftime
struct tm
time_t
Standard C++ Library Reference
<new> - memory allocation
operator delete
operator new
set_new_handler
Command Line Tools
CrossBuild
CrossLoad
mkhdr - C/C++ header file generator
mkpkg - package creator
GNU C/C++ Compiler
Introduction
1 Programming Languages Supported by GCC
2 Language Standards Supported by GCC
3 GCC Command Options
3.1 Option Summary
3.2 Options Controlling the Kind of Output
3.3 Compiling C++ Programs
3.4 Options Controlling C Dialect
3.5 Options Controlling C++ Dialect
3.6 Options Controlling Objective-C and Objective-C++ Dialects
3.7 Options to Control Diagnostic Messages Formatting
3.8 Options to Request or Suppress Warnings
3.9 Options for Debugging Your Program or GCC
3.10 Options That Control Optimization
3.11 Options Controlling the Preprocessor
3.12 Passing Options to the Assembler
3.13 Options for Linking
3.14 Options for Directory Search
3.15 Specifying subprocesses and the switches to pass to them
3.16 Specifying Target Machine and Compiler Version
3.17 Hardware Models and Configurations
3.17.1 ARC Options
3.17.2 ARM Options
3.17.3 AVR Options
3.17.4 Blackfin Options
3.17.5 CRIS Options
3.17.6 CRX Options
3.17.7 Darwin Options
3.17.8 DEC Alpha Options
3.17.9 DEC Alpha/VMS Options
3.17.10 FRV Options
3.17.11 H8/300 Options
3.17.12 HPPA Options
3.17.13 Intel 386 and AMD x86-64 Options
3.17.14 IA-64 Options
3.17.15 M32C Options
3.17.16 M32R/D Options
3.17.17 M680x0 Options
3.17.18 M68hc1x Options
3.17.19 MCore Options
3.17.20 MIPS Options
3.17.21 MMIX Options
3.17.22 MN10300 Options
3.17.23 MT Options
3.17.24 PDP-11 Options
3.17.25 PowerPC Options
3.17.26 IBM RS/6000 and PowerPC Options
3.17.27 S/390 and zSeries Options
3.17.28 SH Options
3.17.29 SPARC Options
3.17.30 Options for System V
3.17.31 TMS320C3x/C4x Options
3.17.32 V850 Options
3.17.33 VAX Options
3.17.34 x86-64 Options
3.17.35 Xstormy16 Options
3.17.36 Xtensa Options
3.17.37 zSeries Options
3.18 Options for Code Generation Conventions
3.19 Environment Variables Affecting GCC
3.20 Using Precompiled Headers
3.21 Running Protoize
4 C Implementation-defined behavior
4.1 Translation
4.2 Environment
4.3 Identifiers
4.4 Characters
4.5 Integers
4.6 Floating point
4.7 Arrays and pointers
4.8 Hints
4.9 Structures, unions, enumerations, and bit-fields
4.10 Qualifiers
4.11 Declarators
4.12 Statements
4.13 Preprocessing directives
4.14 Library functions
4.15 Architecture
4.16 Locale-specific behavior
5 Extensions to the C Language Family
5.1 Statements and Declarations in Expressions
5.2 Locally Declared Labels
5.3 Labels as Values
5.4 Nested Functions
5.5 Constructing Function Calls
5.6 Referring to a Type with typeof
5.7 Conditionals with Omitted Operands
5.8 Double-Word Integers
5.9 Complex Numbers
5.10 Hex Floats
5.11 Arrays of Length Zero
5.12 Structures With No Members
5.13 Arrays of Variable Length
5.14 Macros with a Variable Number of Arguments.
5.15 Slightly Looser Rules for Escaped Newlines
5.16 Non-Lvalue Arrays May Have Subscripts
5.17 Arithmetic on void- and Function-Pointers
5.18 Non-Constant Initializers
5.19 Compound Literals
5.20 Designated Initializers
5.21 Case Ranges
5.22 Cast to a Union Type
5.23 Mixed Declarations and Code
5.24 Declaring Attributes of Functions
5.25 Attribute Syntax
5.26 Prototypes and Old-Style Function Definitions
5.27 C++ Style Comments
5.28 Dollar Signs in Identifier Names
5.29 The Character <ESC> in Constants
5.30 Inquiring on Alignment of Types or Variables
5.31 Specifying Attributes of Variables
5.31.1 M32R/D Variable Attributes
5.31.2 i386 Variable Attributes
5.31.3 Xstormy16 Variable Attributes
5.32 Specifying Attributes of Types
5.32.1 ARM Type Attributes
5.32.2 i386 Type Attributes
5.33 An Inline Function is As Fast As a Macro
5.34 Assembler Instructions with C Expression Operands
5.34.1 Size of an asm
5.34.2 i386 floating point asm operands
5.35 Constraints for asm Operands
5.35.1 Simple Constraints
5.35.2 Multiple Alternative Constraints
5.35.3 Constraint Modifier Characters
5.35.4 Constraints for Particular Machines
5.36 Controlling Names Used in Assembler Code
5.37 Variables in Specified Registers
5.37.1 Defining Global Register Variables
5.37.2 Specifying Registers for Local Variables
5.38 Alternate Keywords
5.39 Incomplete enum Types
5.40 Function Names as Strings
5.41 Getting the Return or Frame Address of a Function
5.42 Using vector instructions through built-in functions
5.43 Offsetof
5.44 Built-in functions for atomic memory access
5.45 Object Size Checking Builtins
5.46 Other built-in functions provided by GCC
5.47 Built-in Functions Specific to Particular Target Machines
5.47.1 Alpha Built-in Functions
5.47.2 ARM Built-in Functions
5.47.3 Blackfin Built-in Functions
5.47.4 FR-V Built-in Functions
5.47.4.1 Argument Types
5.47.4.2 Directly-mapped Integer Functions
5.47.4.3 Directly-mapped Media Functions
5.47.4.4 Raw read/write Functions
5.47.4.5 Other Built-in Functions
5.47.5 X86 Built-in Functions
5.47.6 MIPS DSP Built-in Functions
5.47.7 MIPS Paired-Single Support
5.47.7.1 Paired-Single Arithmetic
5.47.7.2 Paired-Single Built-in Functions
5.47.7.3 MIPS-3D Built-in Functions
5.47.8 PowerPC AltiVec Built-in Functions
5.47.9 SPARC VIS Built-in Functions
5.48 Format Checks Specific to Particular Target Machines
5.48.1 Solaris Format Checks
5.49 Pragmas Accepted by GCC
5.49.1 ARM Pragmas
5.49.2 M32C Pragmas
5.49.3 RS/6000 and PowerPC Pragmas
5.49.4 Darwin Pragmas
5.49.5 Solaris Pragmas
5.49.6 Symbol-Renaming Pragmas
5.49.7 Structure-Packing Pragmas
5.49.8 Weak Pragmas
5.50 Unnamed struct/union fields within structs/unions
5.51 Thread-Local Storage
5.51.1 ISO/IEC 9899:1999 Edits for Thread-Local Storage
5.51.2 ISO/IEC 14882:1998 Edits for Thread-Local Storage
6 Extensions to the C++ Language
6.1 When is a Volatile Object Accessed?
6.2 Restricting Pointer Aliasing
6.3 Vague Linkage
6.4 #pragma interface and implementation
6.5 Where's the Template?
6.6 Extracting the function pointer from a bound pointer to member function
6.7 C++-Specific Variable, Function, and Type Attributes
6.8 Strong Using
6.9 Java Exceptions
6.10 Deprecated Features
6.11 Backwards Compatibility
7 GNU Objective-C runtime features
7.1 +load: Executing code before main
7.1.1 What you can and what you cannot do in +load
7.2 Type encoding
7.3 Garbage Collection
7.4 Constant string objects
7.5 compatibility_alias
8 Binary Compatibility
9 gcov a Test Coverage Program
9.1 Introduction to gcov
9.2 Invoking gcov
9.3 Using gcov with GCC Optimization
9.4 Brief description of gcov data files
9.5 Data file relocation to support cross-profiling
10 Known Causes of Trouble with GCC
10.1 Actual Bugs We Haven't Fixed Yet
10.2 Cross-Compiler Problems
10.3 Interoperation
10.4 Incompatibilities of GCC
10.5 Fixed Header Files
10.6 Standard Libraries
10.7 Disappointments and Misunderstandings
10.8 Common Misunderstandings with GNU C++
10.8.1 Declare and Define Static Members
10.8.2 Name lookup, templates, and accessing members of base classes
10.8.3 Temporaries May Vanish Before You Expect
10.8.4 Implicit Copy-Assignment for Virtual Bases
10.9 Caveats of using protoize
10.10 Certain Changes We Don't Want to Make
10.11 Warning Messages and Error Messages
11 Reporting Bugs
11.1 Have You Found a Bug?
11.2 How and where to Report Bugs
12 How To Get Help with GCC
13 Contributing to GCC Development
Funding Free Software
The GNU Project and GNU/Linux
GNU GENERAL PUBLIC LICENSE
Preamble
Appendix: How to Apply These Terms to Your New Programs
GNU Free Documentation License
ADDENDUM: How to use this License for your documents
Contributors to GCC
Option Index
Keyword Index
GNU C Preprocessor
The C Preprocessor
1 Overview
1.1 Character sets
1.2 Initial processing
1.3 Tokenization
1.4 The preprocessing language
2 Header Files
2.1 Include Syntax
2.2 Include Operation
2.3 Search Path
2.4 Once-Only Headers
2.5 Computed Includes
2.6 Wrapper Headers
2.7 System Headers
3 Macros
3.1 Object-like Macros
3.2 Function-like Macros
3.3 Macro Arguments
3.4 Stringification
3.5 Concatenation
3.6 Variadic Macros
3.7 Predefined Macros
3.7.1 Standard Predefined Macros
3.7.2 Common Predefined Macros
3.7.3 System-specific Predefined Macros
3.7.4 C++ Named Operators
3.8 Undefining and Redefining Macros
3.9 Directives Within Macro Arguments
3.10 Macro Pitfalls
3.10.1 Misnesting
3.10.2 Operator Precedence Problems
3.10.3 Swallowing the Semicolon
3.10.4 Duplication of Side Effects
3.10.5 Self-Referential Macros
3.10.6 Argument Prescan
3.10.7 Newlines in Arguments
4 Conditionals
4.1 Conditional Uses
4.2 Conditional Syntax
4.2.1 Ifdef
4.2.2 If
4.2.3 Defined
4.2.4 Else
4.2.5 Elif
4.3 Deleted Code
5 Diagnostics
6 Line Control
7 Pragmas
8 Other Directives
9 Preprocessor Output
10 Traditional Mode
10.1 Traditional lexical analysis
10.2 Traditional macros
10.3 Traditional miscellany
10.4 Traditional warnings
11 Implementation Details
11.1 Implementation-defined behavior
11.2 Implementation limits
11.3 Obsolete Features
11.3.1 Assertions
11.3.2 Obsolete once-only headers
11.4 Differences from previous versions
12 Invocation
13 Environment Variables
GNU Free Documentation License
ADDENDUM: How to use this License for your documents
Index of Directives
Option Index
Concept Index
GNU Assember
Using as
1 Overview
1.1 Structure of this Manual
1.2 The GNU Assembler
1.3 Object File Formats
1.4 Command Line
1.5 Input Files
1.6 Output (Object) File
1.7 Error and Warning Messages
2 Command-Line Options
2.1 Enable Listings: -a[cdhlns]
2.2 --alternate
2.3 -D
2.4 Work Faster: -f
2.5 .include Search Path: -I path
2.6 Difference Tables: -K
2.7 Include Local Labels: -L
2.8 Configuring listing output: --listing
2.9 Assemble in MRI Compatibility Mode: -M
2.10 Dependency Tracking: --MD
2.11 Name the Object File: -o
2.12 Join Data and Text Sections: -R
2.13 Display Assembly Statistics: --statistics
2.14 Compatible Output: --traditional-format
2.15 Announce Version: -v
2.16 Control Warnings: -W, --warn, --no-warn, --fatal-warnings
2.17 Generate Object File in Spite of Errors: -Z
3 Syntax
3.1 Preprocessing
3.2 Whitespace
3.3 Comments
3.4 Symbols
3.5 Statements
3.6 Constants
3.6.1 Character Constants
3.6.1.1 Strings
3.6.1.2 Characters
3.6.2 Number Constants
3.6.2.1 Integers
3.6.2.2 Bignums
3.6.2.3 Flonums
4 Sections and Relocation
4.1 Background
4.2 Linker Sections
4.3 Assembler Internal Sections
4.4 Sub-Sections
4.5 bss Section
5 Symbols
5.1 Labels
5.2 Giving Symbols Other Values
5.3 Symbol Names
5.4 The Special Dot Symbol
5.5 Symbol Attributes
5.5.1 Value
5.5.2 Type
5.5.3 Symbol Attributes: a.out
5.5.3.1 Descriptor
5.5.3.2 Other
5.5.4 Symbol Attributes for COFF
5.5.4.1 Primary Attributes
5.5.4.2 Auxiliary Attributes
5.5.5 Symbol Attributes for SOM
6 Expressions
6.1 Empty Expressions
6.2 Integer Expressions
6.2.1 Arguments
6.2.2 Operators
6.2.3 Prefix Operator
6.2.4 Infix Operators
7 Assembler Directives
7.1 .abort
7.2 .ABORT
7.3 .align abs-expr , abs-expr , abs-expr
7.4 .ascii " string " ...
7.5 .asciz " string " ...
7.6 .balign[wl] abs-expr , abs-expr , abs-expr
7.7 .byte expressions
7.8 .comm symbol , length
7.9 .cfi_startproc
7.10 .cfi_endproc
7.11 .cfi_def_cfa register , offset
7.12 .cfi_def_cfa_register register
7.13 .cfi_def_cfa_offset offset
7.14 .cfi_adjust_cfa_offset offset
7.15 .cfi_offset register , offset
7.16 .cfi_rel_offset register , offset
7.17 .cfi_window_save
7.18 .cfi_escape expression[, ...]
7.19 .data subsection
7.20 .def name
7.21 .desc symbol , abs-expression
7.22 .dim
7.23 .double flonums
7.24 .eject
7.25 .else
7.26 .elseif
7.27 .end
7.28 .endef
7.29 .endfunc
7.30 .endif
7.31 .equ symbol , expression
7.32 .equiv symbol , expression
7.33 .err
7.34 .error " string "
7.35 .exitm
7.36 .extern
7.37 .fail expression
7.38 .file string
7.39 .fill repeat , size , value
7.40 .float flonums
7.41 .func name [, label ]
7.42 .global symbol, .globl symbol
7.43 .hidden names
7.44 .hword expressions
7.45 .ident
7.46 .if absolute expression
7.47 .incbin " file "[, skip [, count ]]
7.48 .include " file "
7.49 .int expressions
7.50 .internal names
7.51 .irp symbol , values ...
7.52 .irpc symbol , values ...
7.53 .lcomm symbol , length
7.54 .lflags
7.55 .line line-number
7.56 .linkonce [ type ]
7.57 .ln line-number
7.58 .mri val
7.59 .list
7.60 .long expressions
7.61 .macro
7.62 .altmacro
7.63 .noaltmacro
7.64 .nolist
7.65 .octa bignums
7.66 .org new-lc , fill
7.67 .p2align[wl] abs-expr , abs-expr , abs-expr
7.68 .previous
7.69 .popsection
7.70 .print string
7.71 .protected names
7.72 .psize lines , columns
7.73 .purgem name
7.74 .pushsection name , subsection
7.75 .quad bignums
7.76 .rept count
7.77 .sbttl " subheading "
7.78 .scl class
7.79 .section name
7.80 .set symbol , expression
7.81 .short expressions
7.82 .single flonums
7.83 .size
7.84 .sleb128 expressions
7.85 .skip size , fill
7.86 .space size , fill
7.87 .stabd, .stabn, .stabs
7.88 .string "str"
7.89 .struct expression
7.90 .subsection name
7.91 .symver
7.92 .tag structname
7.93 .text subsection
7.94 .title " heading "
7.95 .type
7.96 .uleb128 expressions
7.97 .val addr
7.98 .version " string "
7.99 .vtable_entry table , offset
7.100 .vtable_inherit child , parent
7.101 .warning " string "
7.102 .weak names
7.103 .word expressions
7.104 Deprecated Directives
8 Machine Dependent Features
8.1 AMD 29K Dependent Features
8.1.1 Options
8.1.2 Syntax
8.1.2.1 Macros
8.1.2.2 Special Characters
8.1.2.3 Register Names
8.1.3 Floating Point
8.1.4 AMD 29K Machine Directives
8.1.5 Opcodes
8.2 Alpha Dependent Features
8.2.1 Notes
8.2.2 Options
8.2.3 Syntax
8.2.3.1 Special Characters
8.2.3.2 Register Names
8.2.3.3 Relocations
8.2.4 Floating Point
8.2.5 Alpha Assembler Directives
8.2.6 Opcodes
8.3 ARC Dependent Features
8.3.1 Options
8.3.2 Syntax
8.3.2.1 Special Characters
8.3.2.2 Register Names
8.3.3 Floating Point
8.3.4 ARC Machine Directives
8.3.5 Opcodes
8.4 ARM Dependent Features
8.4.1 Options
8.4.2 Syntax
8.4.2.1 Special Characters
8.4.2.2 Register Names
8.4.3 Floating Point
8.4.4 ARM Machine Directives
8.4.5 Opcodes
8.4.6 Mapping Symbols
8.5 CRIS Dependent Features
8.5.1 Command-line Options
8.5.2 Instruction expansion
8.5.3 Symbols
8.5.4 Syntax
8.5.4.1 Special Characters
8.5.4.2 Symbols in position-independent code
8.5.4.3 Register names
8.5.4.4 Assembler Directives
8.6 D10V Dependent Features
8.6.1 D10V Options
8.6.2 Syntax
8.6.2.1 Size Modifiers
8.6.2.2 Sub-Instructions
8.6.2.3 Special Characters
8.6.2.4 Register Names
8.6.2.5 Addressing Modes
8.6.2.6 @WORD Modifier
8.6.3 Floating Point
8.6.4 Opcodes
8.7 D30V Dependent Features
8.7.1 D30V Options
8.7.2 Syntax
8.7.2.1 Size Modifiers
8.7.2.2 Sub-Instructions
8.7.2.3 Special Characters
8.7.2.4 Guarded Execution
8.7.2.5 Register Names
8.7.2.6 Addressing Modes
8.7.3 Floating Point
8.7.4 Opcodes
8.8 H8/300 Dependent Features
8.8.1 Options
8.8.2 Syntax
8.8.2.1 Special Characters
8.8.2.2 Register Names
8.8.2.3 Addressing Modes
8.8.3 Floating Point
8.8.4 H8/300 Machine Directives
8.8.5 Opcodes
8.9 H8/500 Dependent Features
8.9.1 Options
8.9.2 Syntax
8.9.2.1 Special Characters
8.9.2.2 Register Names
8.9.2.3 Addressing Modes
8.9.3 Floating Point
8.9.4 H8/500 Machine Directives
8.9.5 Opcodes
8.10 HPPA Dependent Features
8.10.1 Notes
8.10.2 Options
8.10.3 Syntax
8.10.4 Floating Point
8.10.5 HPPA Assembler Directives
8.10.6 Opcodes
8.11 ESA/390 Dependent Features
8.11.1 Notes
8.11.2 Options
8.11.3 Syntax
8.11.4 Floating Point
8.11.5 ESA/390 Assembler Directives
8.11.6 Opcodes
8.12 80386 Dependent Features
8.12.1 Options
8.12.2 AT&T Syntax versus Intel Syntax
8.12.3 Instruction Naming
8.12.4 Register Naming
8.12.5 Instruction Prefixes
8.12.6 Memory References
8.12.7 Handling of Jump Instructions
8.12.8 Floating Point
8.12.9 Intel's MMX and AMD's 3DNow! SIMD Operations
8.12.10 Writing 16-bit Code
8.12.11 AT&T Syntax bugs
8.12.12 Specifying CPU Architecture
8.12.13 Notes
8.13 Intel i860 Dependent Features
8.13.1 i860 Notes
8.13.2 i860 Command-line Options
8.13.2.1 SVR4 compatibility options
8.13.2.2 Other options
8.13.3 i860 Machine Directives
8.13.4 i860 Opcodes
8.13.4.1 Other instruction support (pseudo-instructions)
8.14 Intel 80960 Dependent Features
8.14.1 i960 Command-line Options
8.14.2 Floating Point
8.14.3 i960 Machine Directives
8.14.4 i960 Opcodes
8.14.4.1 callj
8.14.4.2 Compare-and-Branch
8.15 IA-64 Dependent Features
8.15.1 Options
8.15.2 Syntax
8.15.2.1 Special Characters
8.15.2.2 Register Names
8.15.2.3 IA-64 Processor-Status-Register (PSR) Bit Names
8.15.3 Opcodes
8.16 IP2K Dependent Features
8.16.1 IP2K Options
8.17 M32R Dependent Features
8.17.1 M32R Options
8.17.2 M32R Directives
8.17.3 M32R Warnings
8.18 M680x0 Dependent Features
8.18.1 M680x0 Options
8.18.2 Syntax
8.18.3 Motorola Syntax
8.18.4 Floating Point
8.18.5 680x0 Machine Directives
8.18.6 Opcodes
8.18.6.1 Branch Improvement
8.18.6.2 Special Characters
8.19 M68HC11 and M68HC12 Dependent Features
8.19.1 M68HC11 and M68HC12 Options
8.19.2 Syntax
8.19.3 Symbolic Operand Modifiers
8.19.4 Assembler Directives
8.19.5 Floating Point
8.19.6 Opcodes
8.19.6.1 Branch Improvement
8.20 Motorola M88K Dependent Features
8.20.1 M88K Machine Directives
8.21 MIPS Dependent Features
8.21.1 Assembler options
8.21.2 MIPS ECOFF object code
8.21.3 Directives for debugging information
8.21.4 Directives to override the size of symbols
8.21.5 Directives to override the ISA level
8.21.6 Directives for extending MIPS 16 bit instructions
8.21.7 Directive to mark data as an instruction
8.21.8 Directives to save and restore options
8.21.9 Directives to control generation of MIPS ASE instructions
8.22 MMIX Dependent Features
8.22.1 Command-line Options
8.22.2 Instruction expansion
8.22.3 Syntax
8.22.3.1 Special Characters
8.22.3.2 Symbols
8.22.3.3 Register names
8.22.3.4 Assembler Directives
8.22.4 Differences to mmixal
8.23 MSP 430 Dependent Features
8.23.1 Options
8.23.2 Syntax
8.23.2.1 Macros
8.23.2.2 Special Characters
8.23.2.3 Register Names
8.23.2.4 Assembler Extensions
8.23.3 Floating Point
8.23.4 MSP 430 Machine Directives
8.23.5 Opcodes
8.23.6 Profiling Capability
8.24 PDP-11 Dependent Features
8.24.1 Options
8.24.1.1 Code Generation Options
8.24.1.2 Instruction Set Extension Options
8.24.1.3 CPU Model Options
8.24.1.4 Machine Model Options
8.24.2 Assembler Directives
8.24.3 PDP-11 Assembly Language Syntax
8.24.4 Instruction Naming
8.24.5 Synthetic Instructions
8.25 picoJava Dependent Features
8.25.1 Options
8.26 PowerPC Dependent Features
8.26.1 Options
8.26.2 PowerPC Assembler Directives
8.27 Renesas / SuperH SH Dependent Features
8.27.1 Options
8.27.2 Syntax
8.27.2.1 Special Characters
8.27.2.2 Register Names
8.27.2.3 Addressing Modes
8.27.3 Floating Point
8.27.4 SH Machine Directives
8.27.5 Opcodes
8.28 SuperH SH64 Dependent Features
8.28.1 Options
8.28.2 Syntax
8.28.2.1 Special Characters
8.28.2.2 Register Names
8.28.2.3 Addressing Modes
8.28.3 SH64 Machine Directives
8.28.4 Opcodes
8.29 SPARC Dependent Features
8.29.1 Options
8.29.2 Enforcing aligned data
8.29.3 Floating Point
8.29.4 Sparc Machine Directives
8.30 TIC54X Dependent Features
8.30.1 Options
8.30.2 Blocking
8.30.3 Environment Settings
8.30.4 Constants Syntax
8.30.5 String Substitution
8.30.6 Local Labels
8.30.7 Math Builtins
8.30.8 Extended Addressing
8.30.9 Directives
8.30.10 Macros
8.30.11 Memory-mapped Registers
8.31 Z8000 Dependent Features
8.31.1 Options
8.31.2 Syntax
8.31.2.1 Special Characters
8.31.2.2 Register Names
8.31.2.3 Addressing Modes
8.31.3 Assembler Directives for the Z8000
8.31.4 Opcodes
8.32 VAX Dependent Features
8.32.1 VAX Command-Line Options
8.32.2 VAX Floating Point
8.32.3 Vax Machine Directives
8.32.4 VAX Opcodes
8.32.5 VAX Branch Improvement
8.32.6 VAX Operands
8.32.7 Not Supported on VAX
8.33 v850 Dependent Features
8.33.1 Options
8.33.2 Syntax
8.33.2.1 Special Characters
8.33.2.2 Register Names
8.33.3 Floating Point
8.33.4 V850 Machine Directives
8.33.5 Opcodes
8.34 Xtensa Dependent Features
8.34.1 Command Line Options
8.34.2 Assembler Syntax
8.34.2.1 Opcode Names
8.34.2.2 Register Names
8.34.3 Xtensa Optimizations
8.34.3.1 Using Density Instructions
8.34.3.2 Automatic Instruction Alignment
8.34.4 Xtensa Relaxation
8.34.4.1 Conditional Branch Relaxation
8.34.4.2 Function Call Relaxation
8.34.4.3 Other Immediate Field Relaxation
8.34.5 Directives
8.34.5.1 schedule
8.34.5.2 longcalls
8.34.5.3 transform
8.34.5.4 literal
8.34.5.5 literal_position
8.34.5.6 literal_prefix
8.34.5.7 absolute-literals
9 Reporting Bugs
9.1 Have You Found a Bug?
9.2 How to Report Bugs
10 Acknowledgements
Appendix A GNU Free Documentation License
ADDENDUM: How to use this License for your documents
Index
GNU Linker
Using ld
1 Overview
2 Invocation
2.1 Command Line Options
2.1.1 Options Specific to i386 PE Targets
2.2 Environment Variables
3 Linker Scripts
3.1 Basic Linker Script Concepts
3.2 Linker Script Format
3.3 Simple Linker Script Example
3.4 Simple Linker Script Commands
3.4.1 Setting the Entry Point
3.4.2 Commands Dealing with Files
3.4.3 Commands Dealing with Object File Formats
3.4.4 Other Linker Script Commands
3.5 Assigning Values to Symbols
3.5.1 Simple Assignments
3.5.2 PROVIDE
3.5.3 Source Code Reference
3.6 SECTIONS Command
3.6.1 Output Section Description
3.6.2 Output Section Name
3.6.3 Output Section Address
3.6.4 Input Section Description
3.6.4.1 Input Section Basics
3.6.4.2 Input Section Wildcard Patterns
3.6.4.3 Input Section for Common Symbols
3.6.4.4 Input Section and Garbage Collection
3.6.4.5 Input Section Example
3.6.5 Output Section Data
3.6.6 Output Section Keywords
3.6.7 Output Section Discarding
3.6.8 Output Section Attributes
3.6.8.1 Output Section Type
3.6.8.2 Output Section LMA
3.6.8.3 Forced Input Alignment
3.6.8.4 Output Section Region
3.6.8.5 Output Section Phdr
3.6.8.6 Output Section Fill
3.6.9 Overlay Description
3.7 MEMORY Command
3.8 PHDRS Command
3.9 VERSION Command
3.10 Expressions in Linker Scripts
3.10.1 Constants
3.10.2 Symbol Names
3.10.3 The Location Counter
3.10.4 Operators
3.10.5 Evaluation
3.10.6 The Section of an Expression
3.10.7 Builtin Functions
3.11 Implicit Linker Scripts
4 Machine Dependent Features
4.1 ld and the H8/300
4.2 ld and the Intel 960 Family
4.3 ld and the ARM family
4.4 ld and HPPA 32-bit ELF Support
4.5 ld and MMIX
4.6 ld and MSP430
4.7 ld's Support for Various TI COFF Versions
4.8 ld and WIN32 (cygwin/mingw)
4.9 ld and Xtensa Processors
5 BFD
5.1 How It Works: An Outline of BFD
5.1.1 Information Loss
5.1.2 The BFD canonical object-file format
6 Reporting Bugs
6.1 Have You Found a Bug?
6.2 How to Report Bugs
Appendix A MRI Compatible Script Files
Appendix B GNU Free Documentation License
ADDENDUM: How to use this License for your documents
Index
GNU BINUTILS
Introduction
1 ar
1.1 Controlling ar on the Command Line
1.2 Controlling ar with a Script
2 nm
3 objcopy
4 objdump
5 ranlib
6 size
7 strings
8 strip
9 c++filt
10 addr2line
11 nlmconv
12 windres
13 dlltool
13.1 The format of the dlltool .def file
14 readelf
15 Selecting the Target System
15.1 Target Selection
15.2 Architecture Selection
16 Reporting Bugs
16.1 Have You Found a Bug?
16.2 How to Report Bugs
Appendix A GNU Free Documentation License
ADDENDUM: How to use this License for your documents
Index
Appendices
Legal
Copyright, disclaimer, and trademarks
Rowley Associates license statement
Activating your product
Technical
File formats
Memory Map file format
Section Placement file format
Project file format
Project Templates file format
Property Groups file format
Project Property Reference
Build Properties
Compilation Properties
Debugging Properties
External Build Project Properties
File Properties
Folder Properties
Library Properties
Linker Properties
Staging And Combining Project Properties
Target Interface Properties
ARM Simulator Properties
Code editor command summary
Binary editor command summary
Frequently Asked Questions
Linux Frequently Asked Questions
Glossary