Description The compiler options '-zz' and '-zt' are important because they can help to minimise the ROM & RAM requirements for global data. They are described in the SDT 2.50 Reference Guide (p.2-27). Unfortunately, they were not documented in the SDT 2.11 Reference Guide. ' -zzN ' sets the zero initialized variable (bss) threshold to N (N=8 by default), i.e. it forces global variables of a size greater than N to remain of unknown status rather than forcing them to be RW, typically causing them to be placed in the ZI data area. The normal use is '-zz0', which results in all uninitialized global variables being placed in the ZI segment. '-zz-1' has been seen in some makefiles, which simply gives the same result as '-zz0'. For clarity, the use of '-zz0' is preferred over '-zz-1'. ' -zt ' disallows tentative declarations of the form:
int x; : other functions.. : int x=1; :
By disallowing tentative declarations, base pointer optimization of multiple global variables becomes possible (because the compiler knows at the declaration whether to put it in the RW or ZI area), which results in more compact code. These two options '-zz0' and '-zt' are commonly combined to give ' -zzt0 '. These are described in more detail in Application Note 36, Declaring C Global Data, section 3 at ARM Application Notes. We suggest that all your C code be compiled with ' -zzt0 ' with SDT. For the ADS compilers, the default is the equivalent of '-zzt0' (unless '-strict' is used) and the -zz & -zt options are now faulted.
|