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

Linker mishandles REL22 relocation in ELF when the addend is non-zero

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • Code Generation Tools
    • CODEGEN-7957
    • Hide
      C2000_18.1.0.LTS
      C2000_20.8.0.STS
      C2000_18.12.0.LTS
      C2000_20.2.0.LTS
      Show
      C2000_18.1.0.LTS C2000_20.8.0.STS C2000_18.12.0.LTS C2000_20.2.0.LTS
    • Hide
      C2000_20.2.3.LTS*
      C2000_18.12.7.LTS*
      Show
      C2000_20.2.3.LTS* C2000_18.12.7.LTS*
    • default
    • Don't use any non-zero addends in symbolic operands where a 22-bit value is expected (e.g. MOVL). Instead add in the addend with a subsequent ADDL instruction.

      C2000 uses the REL22 relocation for instructions like MOVL with a symbolic immediate. If the symbolic immediate has an addend (for example, symbol+8) and the file format is ELF, the assembler will use a RELA relocation, indicating that an addend is present. For REL22 RELA relocations only, the linker will sometimes write the relocated value to the wrong place in the section. The exact place written is a function of what other relocations are present in the section, so it's not easy to predict.

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

              Created:
              Updated:
              Resolved: