Keil™, An ARM® Company

L166 User's Guide

SECTIONS Linker Directive

Abbreviation SE
Arguments 

SECTIONS (section« %class » « (address) « [« ! »« storage »] » » « , ... »)

Default None.
µVision Options — L166 Misc — User Sections.
Description 

The SECTIONS directive defines a address, an order, or a storage address and execution address for the specified section(s). Specified sections are located sequentially in memory. The first section is located at the lowest possible address (usually 0000h or the value specified by the CLASSES or GROUPS directive). Subsequent sections are located in ascending address order.

You may define the starting address of one or all sections. If an address is specified the section is located at that memory address. A warning message is issued if sections overlap.

You may specify the execution address (address) and a storage address (storage) for a section. This allows you to create applications with sections that are stored in one place but executed from another. This may be used to create FLASH programming routines that execute from RAM but are stored in FLASH. When storing a section in a different location from where it executes, your application must copy the section to its execution address before it is invoked.

See Also CLASSES, DPPUSE, GROUPS
Example 
L166 abc.obj SECTIONS (?PR?ABC%NCODE (0x12000))

This example locates ?PR?ABC in NCODE address 12000h.


L166 abc.obj SECTIONS (?PR?ABC%NCODE (0x12000), &
                       ?CO?ABC%NCONST))

This example locates ?PR?ABC in NCODE address 12000h and ?CO?ABC in NCONST after ?PR?ABC.


L166 abc.obj SECTIONS (?CO?ABC%NCONST (0x2000), &
                       ?BI0?ABC%BIT0 (0FD20H.5)

This example locates ?CO?ABC in NCONST at address 2000h and ?BI?ABC in BIT0 to bit address 0FD20h.5.