Menu

#2943 Non-deterministic segmentation behavior with GSFINAL of STM8 port

open
nobody
other
5
2019-12-10
2019-11-11
No

Hello everyone, My application need to relocation the default stack. I programmed a small injection into the section GSFINAL. At first it worked, but suddenly stopped. Compilation information in the attachment.

1 Attachments

Discussion

  • Philipp Klaus Krause

    I can reproduce the issue on current SDCC [r11453]: The section name is getting corrupted.

     
    • Vyacheslav Azarov

      Ok. That would be good, for beauty of solution of the startup sections. Thanks in advance.

       
  • Philipp Klaus Krause

    I'll look into it.

    For now, you can use the workaround of using the compiler option --codeseg, that one apparently works, unlike the pragma.

    Also, for your special case, of setting the stack pointer at startup, the optin --stack-loc might be the better alternative, as it doesn't require any inline asm.

     
    • Vyacheslav Azarov

      Yes, I will does as it possible. I wanted to do a hidden, otherwise implicit, initialization of the kernel. Thanks again.

       
      • Philipp Klaus Krause

        Hmm, I still don't understand what is happenign here. It seem shte segment name gets overwritten while on the stack.
        Apparently this is about interaction between #pragma codeseg and pragma save / restore; #pragma codeseg by itself seems to work.

         
        • Vyacheslav Azarov

          At first, it worked on. The error appears unpredictably, only when specifying a codeseg GSFINAL segment. The latest build of the compiler reproduce this error. This is reminiscent of an uninitialized variable error. The assembler text shows the spoiled name .area ??? I said true.

           
  • Philipp Klaus Krause

    • assigned_to: Philipp Klaus Krause --> nobody
     

Log in to post a comment.