非连续内存区域的gnu链接器部分 [英] gnu linker section of non-contiguous memory region
问题描述
我正在尝试编写一个链接描述文件,以将一个部分的内容写到两个不连续的内存区域中.
I'm trying to write a linker script to write one section content into two non-contiguous memory regions.
我在此邮件列表中找到了一个关于此的旧主题: "ld链接程序脚本和不连续的内存区域" http://sourceware.org/ml/binutils/2012-01/msg00188.html
I have found an old thread in this mail list about this: "ld linker script and non-contiguous memory region" http://sourceware.org/ml/binutils/2012-01/msg00188.html
我知道C28x编译器针对此问题提供的功能是 将这些部分划分为多个内存段:(带有或函数)
I know a feature from the C28x Compiler for this problem is spliting the sections across multiple memory segments: (with an or function)
部分{.text:{*(.text)} >> FLASH1 | FLASH3}
SECTIONS { .text: { *(.text) } >> FLASH1| FLASH3 }
在这里描述: http://processors.wiki.ti.com/index.php/C28x_Compiler_-_Understanding_Linking
我尝试过但没有成功. 此刻,我必须手动填充拳头内存区域.但是很难搜索部分代码女巫 将来我不会改变,完全适合并填充第一个内存区域.
I have try it without success. At the moment I have to manually fill the fist memory region. but is a difficult to search parts of code witch I will not change in the future and fit and fill completely the first memory region.
GNU链接器中是否实现了这样的功能?还是有人有更好的主意 我怎么解决这个问题?
Is such feature in the GNU linker implemented? Or does anyone has a better idea how can I solve this problem?
推荐答案
我认为最简单的方法(也许是唯一的方法)是将您的部分分成两部分,然后将一个部分分配给第一个内存区域,第二部分到第二内存区域.
I think the easiest way (and maybe the only way) would be to split your section up into two sections, then assign one section to the first memory region, and the second section to the second memory region.
您可能已经看到了这一点,但这是对链接脚本的简洁描述: http://www.math.utah.edu/docs/info/ld_3.html
You have probably already seen this, but it is a pretty concise description of link scripts: http://www.math.utah.edu/docs/info/ld_3.html
这篇关于非连续内存区域的gnu链接器部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!