Disassembly fails in VS Code and GNU Arm objdump due to presence of .TI.phattrs section

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Medium
    • Code Generation Tools
    • CODEGEN-14115
    • Hide
      ARMCLANG_4.0.0.LTS
      ARMCLANG_3.2.0.LTS
      ARMCLANG_5.0.0.LTS*
      Show
      ARMCLANG_4.0.0.LTS ARMCLANG_3.2.0.LTS ARMCLANG_5.0.0.LTS*
    • Hide
      ARMCLANG_4.0.4.LTS*
      ARMCLANG_3.2.4.LTS*
      ARMCLANG_5.0.0.LTS*
      Show
      ARMCLANG_4.0.4.LTS* ARMCLANG_3.2.4.LTS* ARMCLANG_5.0.0.LTS*
    • default
    • Hide
      Use tiarmobjcopy to change the sh_type of section .TI.phattrs from SHT_TI_PHATTRS to SHT_PROGBITS.

      To change the file in place:
      tiarmobjcopy --set-section-type=.TI.phattrs=1 executable_file.out

      To keep the old file and create a new one:
      tiarmobjcopy --set-section-type=.TI.phattrs=1 executable_file.out new.out
      Show
      Use tiarmobjcopy to change the sh_type of section .TI.phattrs from SHT_TI_PHATTRS to SHT_PROGBITS. To change the file in place: tiarmobjcopy --set-section-type=.TI.phattrs=1 executable_file.out To keep the old file and create a new one: tiarmobjcopy --set-section-type=.TI.phattrs=1 executable_file.out new.out

      An executable file generated with the presence of TI-specific section `.TI.phattrs` is not debuggable within VS Code (OpenOCD with GDB) and will fail to disassemble.  This issue manifests with BLE examples in Simplelink SDK. Furthermore, GNU arm-none-eabi-objdump is used to disassemble the same executable, the following error is generated:

      arm-none-eabi-objdump: basic_ble_LP_EM_CC2340R53_freertos_ticlang.out: unknown type [0x7f000004] section `.TI.phattrs`
      
      basic_ble_LP_EM_CC2340R53_freertos_ticlang.out:     file format elf32-little
      
      arm-none-eabi-objdump: can't disassemble for architecture UNKNOWN!

      If the section is removed using tiarmobjcopy, or if the section type is changed using tiarmobjcopy, the disassembly will be displayed correctly, and breakpoints can be set in disassembly using VS Code.

      The section `.TI.phattrs` may be introduced during the link step when the location attribute is used or when overlapping memory regions are used.

      Note that SHT_TI_PHATTRS reflects a section type value within a range of processor specific values .  It is the responsibility of tools to skip unknown sections in this range, but the GNU tools and the underlying Binary File Descriptor (BFD) library presently don't.

            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-5645 - Disassembly fails in VS Code and GN...
                SYNCHRONIZED
                • Last Sync Date: