Uploaded image for project: 'Embedded Software & Tools'
  1. Embedded Software & Tools
  2. EXT_EP-11489

LFU: for lfu builds, the linker incorrectly generates .cinit records for lfu "preserve" variables that are placed in output sections with type=NOINIT via DATA_SECTION pragma or section attribute

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • Code Generation Tools
    • CODEGEN-11690
    • Hide
      C2000_22.6.0.LTS
      C2000_21.6.0.LTS
      Show
      C2000_22.6.0.LTS C2000_21.6.0.LTS
    • Hide
      C2000_25.3.0.LTS*
      C2000_22.6.2.LTS*
      C2000_21.6.2.LTS*
      Show
      C2000_25.3.0.LTS* C2000_22.6.2.LTS* C2000_21.6.2.LTS*
    • default
    • Hide
      "preserve" variables:
      Use --lfu_default=none and then mark lfu preserve variables using __attribute__((preserve)), however, avoid marking any variables intended to be placed in an output section of type=NOINIT

      "update" variables get placed in .TI.update output section which by definition should not be type=NOINIT.
      Show
      "preserve" variables: Use --lfu_default=none and then mark lfu preserve variables using __attribute__((preserve)), however, avoid marking any variables intended to be placed in an output section of type=NOINIT "update" variables get placed in .TI.update output section which by definition should not be type=NOINIT.

      If the user marks lfu variables as "preserve" that have been placed in output sections with type=NOINIT ( via DATA_SECTION pragma or section attribute) then the compiler should not perform initialization on those variables.

      However the compiler is incorrectly generating cinit records for above case due to ignoring the DATA_SECTION or attribute(section) settings.

      A common use case for above is using --lfu_default=preserve, which will, by default, preserve all global variables. This will include variables being used for memory mapped register sections marked as type=NOINIT. With this bug, the linker will incorrectly generate .cinit records for these NOINIT variables. On cold start, the variables will be incorrectly zero initialized leading to unexpected behavior.

      "update" variables get placed in .TI.update output section which by definition should not be type=NOINIT, however if the .TI.update section is marked as type=NOINIT, then .cinit records will still be generated.

            syncuser TI User
            syncuser TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: