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.

[参考译文] 编译器/C6000-CGT:适用于 C6000的 objcopy 类工具

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

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/950523/compiler-c6000-cgt-objcopy-like-tool-for-c6000

器件型号:C6000-CGT

工具/软件:TI C/C++编译器

您好!

我使用 Utimaco 的 CryptoServer (LAN V5) HSM、后者使用 TI 的 C6000工具链进行编译。 我需要修改生成的.out 文件。 我正在寻找像 objcopy 这样的工具来修改其中一个段。 这是一个与我希望执行的操作等效的 GCC、

$ cat hello.c

#include

int moduleID __attribute__( section("ediman"))=0;

int main (int argc、char** argv){

   printf ("moduleID 为%d\n"、moduleID);

   返回0;

$ gcc hello.c

$./a.out

模数 ID 为0

$ objcopy --dump-section ediman=edithere.bin a.out

$ hexdump -C edithere.bin

00000000 00 00 00 00                                      |……|

$ printf "\x7f\x00\x00\x00"> edithere.bin

$ objcopy --update-section ediath=edithere.bin a.out

$./a.out

模数 ID 为127

我研究了雷达2、但令人惊讶的是、它似乎无法识别 TI COFF2格式。 您能告诉我如何使用 C6000工具执行相同的操作吗?

谢谢、

Krishnan

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

    遗憾的是、没有类似 objcopy 的工具。   

    有一个用于创建名为 tiobj2bin 的二进制映像文件的实用程序。  它是 代码生成工具 XML 处理实用程序的一部分。  它与此 objcopy 命令类似...

    objcopy -O 二进制 ti_execute.out binary_image.bin

    该实用程序有两种变体。  tiobj2bin.bat 是 Windows 批处理文件。  tiobj2bin 是 bash shell 脚本。  通读这些文件、了解它们的工作原理。  您将看到它取决于 TI 的其他实用程序:ofd6x hex6x。   C6000汇编工具手册中介绍了这些实用程序

    我很惊讶地看到有人提到...

    [引用 user="Saravanakrishnan KrishnamoOrthy1"] TI COFF2格式

    几年前、C6000编译器工具停止了对 COFF 的支持。  所有最新开发均使用 ELF 目标文件格式。

    谢谢、此致、

    乔治