If a global or static variable is used (note that no error is reported if it is only defined but not used ),
The following error is reported (I used static variables in cCommon. cpp)
Error: l6265e: Non-rwpi section cCommon. O (. BSS) cannot be assigned to Pi exec region er_zi.
Error: l6248e: cCommon. O (I. _ CT _ 7 ccommonfv) in PI region 'er _ R' cannot have address type relocation. BSS $2 in PI region 'er _ zi '.
Nmake: Fatal error u1077: "C:/ARM/adsv12/bin/armlink": ReturnCode"0x1"
Solution:
1 download elf2mod.exe (my resources have free download, http://d.download.csdn.net/down/2244832/miyunhong)
2. Install elf2mod to the/ARM/adsv1_2 directory. The installation directory is C:/ARM/adsv1_2.
3. Modify the Mak file as follows:
(1). Convert hextool =$ (armbin)/fromelf # arm ads utility to create HEX file from Image
Replace with: hextool = $ (armbin)/elf2mod # arm ads utility to create HEX file from Image
(2) Set CPU =-CPU ARM7TDMI # ARM7TDMI target processor
Replace with: CPU =-CPU ARM926EJ-S # arm9tdmi target processor
(3). Set lflags =$ (ropilink)-rwpi-entry 0x8000 #
Replace with: lflags =-Split-reloc-entry aeemod_load