"padding" section created with a dot expression is not being initialized if a fill operator is applied to it

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Medium
    • Code Generation Tools
    • CODEGEN-13308
    • ARMCLANG_4.0.1.LTS
    • Hide
      ARMCLANG_3.2.3.LTS
      ARMCLANG_4.0.2.LTS
      Show
      ARMCLANG_3.2.3.LTS ARMCLANG_4.0.2.LTS
    • default
    • Hide
      This issue can be avoided by defining an initialized data object with the desired value in an input section that is then allocated to the ".padding" output section.

      For example, in the above example, one could define a variable in a ".pad" section:

      __attribute__((section(".pad))) unsigned int dummy_pad = 0xffffffff;

      And then, in the linker command file add the ".pad" input section to the ".padding" output section like so:

      SECTION {
         ...
         GROUP {
            ...
            .padding: {
               *(.pad)
               . += 0xE0;
            } fill = 0xffffffff
            ...
         } > P_MEM
         ...
      }
      Show
      This issue can be avoided by defining an initialized data object with the desired value in an input section that is then allocated to the ".padding" output section. For example, in the above example, one could define a variable in a ".pad" section: __attribute__((section(".pad))) unsigned int dummy_pad = 0xffffffff; And then, in the linker command file add the ".pad" input section to the ".padding" output section like so: SECTION {    ...    GROUP {       ...       .padding: {          *(.pad)          . += 0xE0;       } fill = 0xffffffff       ...    } > P_MEM    ... }

      Consider a "padding" section defined using a ". += <const>" expression, with a fill expression applied to it:

      SECTIONS
      {
      GROUP {
      .reserved:

      { . += 0x101c; }

      (NOLOAD)
      .padding: fill = 0xffffffff

      { . += 0x00E4; }

      .intvecs: {} palign(4)
      .text: {} palign(4)
      .rodata: {} palign(4)
      .const: {} palign(4)
      .cinit: {} palign(4)
      } > P_MEM
      ...
      }

      Such a section is being marked as a RW data section and therefore treated as an uninitialized section.

      Given the .padding section has no content of its own to definitively say whether it is initialized or uninitialized, it must rely on the context in which it is specified to determine whether it is initialized or not.

      For the use case specified in the above linker command file snippet, if it has a fill operator applied to it, then the linker should treat it as an initialized output section.

      Note that this issue was introduced by a fix to a previously reported linker issue. The issue has been verified using the tiarmclang 4.0.1.LTS compiler tools.

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

              Created:
              Updated:
              Resolved:

                Connection: Intermediate to External PROD System
                EXTSYNC-5168 - "padding" section created with a do...
                SYNCHRONIZED
                • Last Sync Date: