This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Overlays and optimizations on the 8051

Is there anyway to "skip" an optimization level on Keil C51 ver 5.20?

I continually get linker warnings about recursive calls. I have read app note 129 (many projects ago, and now do what it suggests as second nature). If I drop the optimizations down to "Dead Code Elimination" (the one below "Data Overlay"), all my linker warnings go away. As I have more RAM than I'll ever need in this project, I'd like to just skip overlay entirely, and avoid its problems. Unfortunately, code space is limited, and I cannot do without the other optimizations.

I know I can do optimizations on a file by file basis (and have), but I'd like to avoid this if possible, and it still leaves that one file unoptimized.

BTW: What exactly does the "enable variable overlay" under the linker menu do anyway... I cannot tell any difference from the map file.

-nelson

Parents
  • "The compiler optimizations have nothing to do with the warnings generated by the linker."

    This is not entirely true; different Compiler optimisations will produce different objects, with the result that certain Linker warnings may or may not be raised; eg, the following is on p260 of the "Assembler and Utilities User's Guide 07.2000:"

    "C code that is translated with the Cx51 compiler directive OPTIMIZE (1) does not use the relocation type OVERLAYABLE. Therefore the local data segments of this code portions (sic) cannot be overlaid."

    As the original post was due to problems with overlays, the choice of optimisation level could affect the generation (or not) of overlay-related Linker warnings!

Reply
  • "The compiler optimizations have nothing to do with the warnings generated by the linker."

    This is not entirely true; different Compiler optimisations will produce different objects, with the result that certain Linker warnings may or may not be raised; eg, the following is on p260 of the "Assembler and Utilities User's Guide 07.2000:"

    "C code that is translated with the Cx51 compiler directive OPTIMIZE (1) does not use the relocation type OVERLAYABLE. Therefore the local data segments of this code portions (sic) cannot be overlaid."

    As the original post was due to problems with overlays, the choice of optimisation level could affect the generation (or not) of overlay-related Linker warnings!

Children
No data