C 中的单元 SPU 错误
当我编译 SPU 程序时,出现以下编译错误:
(.text+0x28): relocation truncated to fit: SPU_ADDR18 against symbol `_end' defined in *ABS* section in spu
这是什么意思?
只有在我在一开始包含之后才会出现错误:
#define CACHE_NAME MY_CACHE
#define CACHED_TYPE double
#define CACHELINE_LOG2SIZE 11
#define CACHE_LOG2NWAY 2
#define CACHE_LOG2NSETS 4
#include <cache-api.h>
When I compile a SPU program, I get the following compilation error:
(.text+0x28): relocation truncated to fit: SPU_ADDR18 against symbol `_end' defined in *ABS* section in spu
What does it mean?
The error comes only after I have included at the very beginning:
#define CACHE_NAME MY_CACHE
#define CACHED_TYPE double
#define CACHELINE_LOG2SIZE 11
#define CACHE_LOG2NWAY 2
#define CACHE_LOG2NSETS 4
#include <cache-api.h>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该错误的含义是:
对象使用重定位模式 SPU_ADDR18 引用符号 '_end'
符号 '_end' 的实际地址是对于所使用的引用模式来说太大。
_end
是传统上定义在代码和数据段末尾的符号。因此,您拥有的代码和静态数据很可能多于 SPU 支持的数量。 (SPU支持256Kb,即18位地址,所以我猜重定位类型SPU_ADDR18是最灵活的)。The error means:
an object references the symbol '_end' using the relocation mode SPU_ADDR18
the actual adress of the symbol '_end' is too big for the mode of reference used.
_end
is a symbol traditionally defined at the end of code and data segment. So most probably, you have more code and static data than the SPU support. (SPU support 256Kb that is 18 bits of address, so I guess that the relocation kind SPU_ADDR18 is the most flexible one).该错误意味着您正在构建的 elf 可执行文件不适合 SPU 内存;可能是因为
cache-api.h
标头定义了一些静态/全局变量。请注意,您的可执行文件不能使用超过 251Kb 的内存(其中一部分可能是作业内核、代码和数据的一部分)。The error means that the elf executable that you're building doesn't fit into SPU memory; probably because the
cache-api.h
header defines some static/global variables. Notice that your executable can't use more than 251Kb of memory (part of which will likely be part of the job kernel, code and data).