This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] TMS320C6678:如何在一个工程中使用 linker.cmd 文件加载不同目标文件的相同段

Guru**** 2551110 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/603661/tms320c6678-how-to-load-the-same-sections-of-different-object-files-within-one-project-with-the-linker-cmd-file

器件型号:TMS320C6678

您好!

我使用的是 C6678。

我有一个带有 CCS 项目应用程序的应用程序、并且该应用程序与基于静态库项目 ort 构建的 ort.lib 链接。 我想将.bss 和.neearort.lib 的.bss 和.neardata 设置为 L2、 并将应用的.bss 和.neardata 设置为 DDR。 我在项目应用程序的 linker.cmd 中添加以下行。

部分

    localdata:

    {

        "ORT.lib"(.bss)

       "ort.lib"(.neardata)

    } > L2

部分

   .bss > DDR

   .neardata > DDR

在构建项目应用程序后、我检查.map 文件、并看到段是 mappedd 到 cmd 描述的位置。 但是、当我尝试打印一个已初始化的本地静态变量的地址时、该变量在应用程序的源文件中使用 printf ("%x"、&V)进行定义; 它不是像0x8xxxxxxx 这样的地址、而是像0x88xxxx 这样的地址、这是一个奇怪的地址。 那么我的 linker.cmd 是否存在问题?

如何将应用程序和 ort.lib 的某些相同部分放置到不同的存储器段中(某些其他部分在应用程序和库中保持相同)?

谢谢!!