Code removal??
The newest version of Crossworks (2.1.1) is removing functions that are not being called. This was not a problem until today. I have some function pointers that get set at run time. The linker claims to not to be able to find them. If I make fake calls to the real functions, it works. Is there a pragma or something to force the linker to keep a function??
Thanks
Michael Freeman
-
Okay got it fixed. It seems I was missing the include file with the prototypes for the functions. However I was tricked by tool into thinking it worked before. I was using code, still missing prototypes, that was part of the project somewhere else. Then I changed the functions that were only used in this spot and that when it broke.
The missing piece: extern boolean fnSerial0_Open(SCommSettings *psrSettings);
boolean (*g_pfnSerialOpen)(SCommSettings *psrSettings);
g_pfnSerialOpen = fnSerial0_Open; -
Thanks for the help Michael. I got hung up on your first reply where you mentioned a linker option, so I kept looking there. Turns out it's a build option. My mistake for not looking more thoroughly. I often find it hard to locate options I'm looking for since the project explorer window, the properties window, and the project manager window have overlapping information presented in similar yet subtly different ways. Couple that with the solution properties, project properties, debug, release, and common options, and it can get difficult to find what you're looking for.
Please sign in to leave a comment.
Comments
9 comments