ROM_LIB  rom library option seems to turn off deadstripping of code

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

ROM_LIB  rom library option seems to turn off deadstripping of code

1,980 次查看
tminnich
Contributor I
I am writing a boostrap/flash programming code module and would like to include it in the main application code as a rom library. When I turn on the Link as ROM library option in Code Warrior deadstripping of the code stops working. I have two source files RTSHC08.c and checksum.c that have their origins in Code Warrior and while I could manually deadstrip the code I would prefer not to do the deadstripping manually. The situation was much worse when the project included ansiis.lib.:smileysurprised: I am hoping I am one link option away from streamlined code, but I can't seem to find a linker option that solves this problem.
 
The beginnings of the map file:
 
PROGRAM "C:\Documents and Settings\Tom\My Documents\boot7o\bin\Project.abs"
*********************************************************************************************
TARGET SECTION
---------------------------------------------------------------------------------------------
Processor   : Freescale HC08
Memory Model: SMALL
File Format : ELF\DWARF 2.0
Linker      : SmartLinker V-5.0.30 Build 7285, Oct 13 2007
*********************************************************************************************
FILE SECTION
---------------------------------------------------------------------------------------------
MC9S08QE128.C.o                         Model: SMALL,         Lang: ANSI-C
flashboot.c.o                           Model: SMALL,         Lang: ANSI-C
checksum.c.o                            Model: SMALL,         Lang: ANSI-C
rtshc08.c.o                             Model: SMALL,         Lang: ANSI-C
*********************************************************************************************
 
regards Tom M.
标签 (1)
0 项奖励
回复
2 回复数

724 次查看
CompilerGuru
NXP Employee
NXP Employee
The point about generating a ROM library (as compared to a normal app) is that ROM libraries are used by clients not known yet.
Did you try to explicitly list all the expected entry points in the prm file?
Given the purpose of ROM libraries to link everything makes sense, at least unless you did define a set of entries on your own.
Also just to make this clear, the purpose of a ROM library is to one and forever flash/program certain never changing code, so an separate application can use it for its purposes. That is not the same as the usual bootloader setup, so usually I would expect a bootloader to be a normal application and not a ROM library.

Daniel
0 项奖励
回复

724 次查看
tminnich
Contributor I
Thanks,
 
When ENTRIES is used is used to specify the two functions that are the interface to the rom library, the linker can then figure out what to deadstrip (and what not to deadstrip).:smileyvery-happy: I can now create rom libraries!
 
 regards Tom M.
 
 
0 项奖励
回复