Greetings all, I'm fairly new to the Keil Toolset and had a question regarding the C51 code optimization levels. It seems that on Level 8: Reuse Common Entry Code (default), the main() entry function gets completely optimized out if the main() function grows too large. I can avoid this by either changing the optimization level, or by adding the debug flag in the Output tab. The actual assembly is correct in the .LST file, but if I check the hex file, the main() function doesn't appear at the location specified by the map file. Is this normal behaviour? Is there some setting I'm misinterpreting somewhere? TIA, JG.
If main appears in the map file, then it is in the absolute object module. Are you certain that the HEX file includes all the stuff from the object file? Have you loaded the application into the uVision2 Debugger? This loads the object file and will let you know if the problem is in the linker or in the object-hex converter. If the problem is in the object-hex converter, maybe there is an option that shouldn't be there. Are there ANY linker or object-hex errors or warnings? If you can't figure this out, then you should definitely contact technical support and let them help you find the problem. Jon
Hi there, I'm trying to generate a small test case as per Stefan's suggestion, but the problem seems to be code-related (i.e. if the size of the main() function changes, so does the behaviour). Changing optimization levels makes the problem seem to go away in this case. Level 8 is the only one that manifests this problem and changing the speed/size emphasis has no effect. The versions are: C51.exe V7.00 A51.exe V7.00a BL51.exe V5.00 LIB51.exe V4.23 OH51.exe V2.6 I loaded the application into the debugger and checked the disassembly and it looks like the main() is zeroed out, so I guess this means the object file already is missing the main(). There are no compiler errors or warnings, but during linking, I get 9 "L16: Uncalled Segment, Ignored for Overlay Process" warnings. Thanks again for all your help. V.
I get 9 "L16: Uncalled Segment, Ignored for Overlay Process" warnings. What segments are uncalled? Jon
View all questions in Keil forum