ROM_LIB  rom library option seems to turn off deadstripping of code

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ROM_LIB  rom library option seems to turn off deadstripping of code

1,517 Views
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.
Labels (1)
0 Kudos
2 Replies

261 Views
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 Kudos

261 Views
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 Kudos