嗨,
.bsct是包含page0中初始化数据的段
.ubsct是第0页中包含非初始化数据的段
.data是包含page0之外的初始化数据的段
.bss是包含page0之外的非初始化数据的段
如何将全局变量放在给定段中的示例:
@tiny char aa; //将转到.ubsct
@tiny char aa = 10; //将转到.bsct
@near char aa; //将转到.bss
@near char aa = 10; //将转到.data
如果您没有指定@tiny或@near,您使用的内存模型将由您决定(有关详细信息,请参阅手册)
page0的体系结构限制为256字节,但实际上这个数字可能更低:链接器将检查任何段的实际大小与链接器文件中为该段指定的-m参数(通常由stvd7自动创建) )
内存的其余部分(上面称为''out of Page0'')实际上仅限于您正在使用的特定设备上实现的RAM量:指定与设备一致的-m参数非常重要对于.data + .bss
总之,您看到的错误消息意味着存储的数据多于可用空间。如果您只是通过阅读源文件无法弄清楚原因,您可以按照以下步骤操作:
- 手动编辑.lkf文件并为-m参数设置“大”值
- 您的应用程序现在将编译和链接(但当然不会执行:因为您使用的RAM比实际可用的RAM多
- 检查地图文件中段的填充方式(哪个变量在哪个段中)
- 更正源,为-m恢复正确的值并构建应用程序
希望这可以帮助。
问候,
卢卡(宇宙)
以上来自于谷歌翻译
以下为原文
Hi,
.bsct is the segment that contains initialized data in page0
.ubsct is the segment that contains non-initialized data in page0
.data is the segment that contains initialized data out of page0
.bss is the segment that contains non-initialized data out of page0
examples of how to put a global variable in a given segment:
@tiny char aa; // will go to .ubsct
@tiny char aa = 10; // will go to .bsct
@near char aa; // will go to .bss
@near char aa = 10; // will go to .data
when you don't specify @tiny or @near the memory model you are using will decide for you (see the manual for details)
The page0 is architecture-limited to 256 bytes, but this number can be lower in reality: the linker will check the actual size of any segment versus the -m parameter specified for that segment in the linker file (that is often created automatically by stvd7)
The rest of the memory (referred to as ''out of Page0'' above) is actually limited to the amount of RAM implemented on the specific device you are using: it is important to specify a -m parameter that is coherent with the device for .data+.bss
In conclusion, the error message you see means that there is more data than available space to store it. If you can't figure out why by just reading the source file you can follow these steps:
- manually edit the .lkf file and set ''big'' values for the the -m parameter
- your application will now compile and link (but of course will not execute: because you are using more RAM than actually available
- check in the map file how the segments are filled (which variable goes in which segment)
- correct the source, restore the right values for -m and build your application
Hope this helps.
Regards,
Luca (Cosmic)