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

Linker vs. Compiler Optimization

There have been a lot of threads dealing with viewing the code from the LX linker (COD file) and comparing it to the compiler output (LST). All of which creates a major dilemma in debugging programs.

To me, the compiler output should always be in a final form. It is Ok to change long jumps to short ... it is NOT Ok to rearrange and generate new code.

I use the compiler output to validate code generation and to determine the best way to improve a specific function or sequence. When the linker generates new code this process is essentially useless. Following the linker output is like handling spagetti.

I just spent two days tracking an LX bug ... it was anything but obvious.

I, for one, would like to formally request that Keil put the optimizations in the compiler and to scratch doing it in the linker. We all know that more efficient compilers are a good thing ... we also know that we need to complete our projects.

Keil needs to remember that it's products are tools to help us write and debug code. The more straight forward the output, the easier it is to understand.

What are your thoughts?

P.S.
An alternative is to have the linker produce COD files for each module and to scrap the assembly option in LST files. If this alternative is selected, the COD files will need some sort of documentation ("C" source) to permit the user to follow the logic. A single project wide COD file with shuffled functions is not acceptable.