rename internal symbols contained in 56800ex library

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

rename internal symbols contained in 56800ex library

ソリューションへジャンプ
1,013件の閲覧回数
nxf49874
NXP Employee
NXP Employee

Hi DSC exports,

I'm working with CodeWorrior, whoes version information is below:

Installed Products:
- CodeWarrior for MCU
Version: 11.1
Build Id:181224

I'm using this tool to build a library and I need to rename the symbols in library to hide some technical details.

For ARM platform, I always use arm-none-eabi-objcopy to rename the symbols in library, such as:

arm-none-eabi-objcopy --redefine-sym security-check=func11 my.lib

I'm not sure if CW IDE contains similar tool to rename symbol name. If not, Do you have any suggestion or solution about this requirement.

Thanks in advance.

0 件の賞賛
1 解決策
941件の閲覧回数
nxf49874
NXP Employee
NXP Employee

I found that llvm toolchain could support DSC platform very well. So we could close this ticket. Thank you.

元の投稿で解決策を見る

0 件の賞賛
6 返答(返信)
942件の閲覧回数
nxf49874
NXP Employee
NXP Employee

I found that llvm toolchain could support DSC platform very well. So we could close this ticket. Thank you.

0 件の賞賛
892件の閲覧回数
Lorenzo_Mch_IT
Contributor IV

Question: "support DSC platform very well" as "LLVM toolchain's ELF utilities also support DSC" or as "Clang can target DSC" ?

0 件の賞賛
883件の閲覧回数
nxf49874
NXP Employee
NXP Employee

Yes llvm ELF tool can support DSC platforms very well.

0 件の賞賛
982件の閲覧回数
Lorenzo_Mch_IT
Contributor IV

Codewarrior for MCU uses .ar file format for libraries and ELF file format for .o and .elf files.
IIRC any recent version of objcopy can be used to rename symbols as you do with ARM libraries.
Since it is just symbol modifications, it's very likely that even your build for arm ( arm-none-eabi-objcopy ) can be used for that.

0 件の賞賛
972件の閲覧回数
nxf49874
NXP Employee
NXP Employee

First sight, I have same thought with you, but practice told me I'm wrong.

1. I tried to run `arm-none-eabi-objcopy.exe -F elf32-little --redefine-sym Faeai_model_init=F11 aeai.lib
` to rename one symbol.

Note: In above command line, I have to specify the target to elf32-little, otherwise objcopy will report error. 

2. Then I found objcopy file can rename the symbol correctly, but also it updated the ELF file header.

nxf49874_0-1710379336627.png

The original library machine information is: Freescale 56800EX Digital Signal Controller (DSC)

3. After I changed the machine value back by manual, I still met linker error:

nxf49874_1-1710379519321.png

In summary, objcopy needs to know the ELF target format even just for renaming symbol.

 

 

0 件の賞賛
950件の閲覧回数
Lorenzo_Mch_IT
Contributor IV

There is a last option if no other elf file utilities can do the job:

If you find acceptable to rename the symbols using another name having the same size, an option is using a binary editor and do a search & replace of the (NUL-terminated in the symbol string table of the .o files).

0 件の賞賛