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 Code packing causing problems

Hi,
I am porting my code from compiler C51 ver6.23 and BL51 to the new compiler and linker , C51 ver 7.00 and LX51 ver3.30 . This was to take advantage of the optimisation features of the LX51's linker code packing.
The code when compiled and linked while disabling the Linker code packing works just fine. But once I enable the linker code packing the executable doesn't function properly on the target hardware. I feel some corruption of my data is occurring. Just by using this feature I could straight away reduce the code size by 3%.
Any suggestions on how I could debug this??

And another problem I faced is untill I decalare my PDATA variables as static PDATA the LX51 linker doesn't put them into PDATA Segment...!!

Thanks,
-Binu

Parents
  • Hi,
    Looks like I have found the cause of the problem.
    First from the SEGMENTS directive in the Linker directive control file(project.lin) I removed all the constant and code segments and allowed the linker to place the Constants and Code wherever it wanted inside the 48K code space.
    When I linked the project with linker code packing enabled my executable worked fine. One by one I placed my constants and code segments in the linker file and checked the executable, but when I added one particular module(quite a large module) the program crashes. Now I need to find out why its happening, because I have to bunch all the functions in that module at a particular location.
    Any suggestions why this could be happening??
    Thanks,
    -Binu

Reply
  • Hi,
    Looks like I have found the cause of the problem.
    First from the SEGMENTS directive in the Linker directive control file(project.lin) I removed all the constant and code segments and allowed the linker to place the Constants and Code wherever it wanted inside the 48K code space.
    When I linked the project with linker code packing enabled my executable worked fine. One by one I placed my constants and code segments in the linker file and checked the executable, but when I added one particular module(quite a large module) the program crashes. Now I need to find out why its happening, because I have to bunch all the functions in that module at a particular location.
    Any suggestions why this could be happening??
    Thanks,
    -Binu

Children