海湾合作委员会链接器意外地向后移动位置计数器
我正在开发新的rtems bsp,并且正在修改链接脚本,我
修改了我修改此链接器脚本文件
.rwbarrier : ALIGN_WITH_INPUT {
. = ALIGN (bsp_section_rwbarrier_align);
} > REGION_DATA AT > REGION_DATA
.vector : ALIGN_WITH_INPUT {
bsp_section_vector_begin = .;
. = . + DEFINED (bsp_vector_table_in_start_section) ? 0 : bsp_vector_table_size;
bsp_section_vector_end = .;
} > REGION_VECTOR AT > REGION_VECTOR
让我们假设我们需要将.vector部分放在某个内存区域的中间线:
.vector : ALIGN_WITH_INPUT {
. = ALIGN(128);
bsp_section_vector_begin = .;
现在我得到了此错误:
[build] linkcmds.base:xxx cannot move location counter backwards (from 0000000060022380 to 0000000060022370)
它直接指向此行,
. = . + DEFINED (bsp_vector_table_in_start_section) ? 0 : bsp_vector_table_size;
但是当将此行更改为:
. = . + bsp_vector_table_size;
没有错误时,链接器满足,系统异常正在工作。
我的问题是:这样的表达如何:
. = . + DEFINED (bsp_vector_table_in_start_section) ? 0 : bsp_vector_table_size;
以这样的方式进行评估,它试图将位置计数器向后移动?我确定bsp_vector_table_size
是正数,我的实验证实了这一点。 。 =。 + 0
也有效。这种兴趣是什么问题?
I am developing new RTEMS BSP and I am modifying linker scripts
I modified this linker script file
.rwbarrier : ALIGN_WITH_INPUT {
. = ALIGN (bsp_section_rwbarrier_align);
} > REGION_DATA AT > REGION_DATA
.vector : ALIGN_WITH_INPUT {
bsp_section_vector_begin = .;
. = . + DEFINED (bsp_vector_table_in_start_section) ? 0 : bsp_vector_table_size;
bsp_section_vector_end = .;
} > REGION_VECTOR AT > REGION_VECTOR
Lets suppose that we need to put .vector section in the middle of some memory region thus we need symbol bsp_section_vector_begin
to be aligned to 128, so I added this one line:
.vector : ALIGN_WITH_INPUT {
. = ALIGN(128);
bsp_section_vector_begin = .;
Now I get this error:
[build] linkcmds.base:xxx cannot move location counter backwards (from 0000000060022380 to 0000000060022370)
Which is pointing directly to this line
. = . + DEFINED (bsp_vector_table_in_start_section) ? 0 : bsp_vector_table_size;
But when changed this line to:
. = . + bsp_vector_table_size;
There is no error, linker is satisfied and system exceptions are working.
My question is: how can such an expression like this:
. = . + DEFINED (bsp_vector_table_in_start_section) ? 0 : bsp_vector_table_size;
evaluate in a such way it try to move location counter backward? I am sure bsp_vector_table_size
is positive number, and my experiment confirmed it. . = . + 0
works as well. What is wrong with this espression?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论