7.2.3. Data in Thumb code areas

You must use the DATA directive when you define data within a Thumb code area.

When the linker relocates a label in a Thumb code area, it assumes that the label represents the address of a Thumb code routine. Consequently it sets bit 0 of the label so that the processor is switched to Thumb state if the routine is called with a BX instruction.

The linker cannot distinguish between code and data within a code area. If the label represents a data item, rather than an address, the linker adds 1 to the value of the data item.

The DATA directive marks a label as pointing to data within a code area and the linker does not add 1 to its value. For example:

			AREA code, CODE
Thumb_fn			; ...
			MOV	pc, lr
Thumb_Data			DATA
			DCB	1, 3, 4, ...

Note that the DATA directive must be on the same line as the symbol. Refer to the description of the DATA directive in the ARM Software Development Toolkit Reference Guide for more information.

Copyright © 1997, 1998 ARM Limited. All rights reserved.ARM DUI 0040D
Non-Confidential