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.

[参考译文] TMDXRM57LHDK:参数在对象库中不可重定位。

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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1004715/tmdxrm57lhdk-parameters-are-not-relocatable-in-an-object-library

器件型号:TMDXRM57LHDK

您好!

我用汇编语言创建了一个应用程序。

我想移动库中的目标文件。

该库是使用 armar.exe 创建的。

我在源文件中使用以下语法插入一个参数:

                              全局 myParam

$myParam         .word   myParam            

该参数位于该文件的外部

然后使用以下语法加载参数:

                              LDR         r0、$myParam

当我在没有库的情况下编译工程时、一切都正常。

当我创建对象库时,它将使用参数的初始值。

但是、如果我更改 myParam 的值、编译后目标文件中的值不会更改。

我该怎么做?

感谢你的帮助。

Jerome

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

    Hello,

    The directive .global 在 ELF 文件中将符号声明为全局符号。 由于 myParam 是一个外部符号、您需要使用 .global 或.ref 指令在目标模块中声明 myParam 可见。