Question: Restrictions on location of .const and .bss

Answer:

The .const and .bss sections generated by the compiler are accessed using " direct addressing " that uses the processor's DP register. For this reason, there are special restrictions regarding their locations:

-Restrictions under Floating-Point compiler:

When using small memory model, sections .const and .bss MUST be linked in the same data page (i.e the 16 MSBits of their memory address should be the same) because the compiler uses direct addressing to access them. Otherwise, this could cause wrong execution of the program. This doesn't apply to the large memory model.

-Restrictions under Fixed-Point compiler:

No restriction exists in the location of .bss and .const because the Fixed-point compiler always initializes the DP before accessing each memory location.


Device: TMS320C4x
Category: TI Tools
Detail:  Code Generation Tools
Detail2: Compiler
Title: Location of .const and .bss
Source: Case from TMS320 Hotline
Date: 4/30/98
GenId: a2

© Copyright 1998 Texas Instruments Incorporated. All rights reserved.
Trademarks, Important Notice!