Linker does not preserve symbol placement for --relocatable objects when set by assignment expression

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Medium
    • Code Generation Tools
    • CODEGEN-15675
    • Hide
      ARMCLANG_3.2.3.LTS
      ARMCLANG_4.0.5.LTS
      C29_1.0.1.LTS
      ARMCLANG_5.1.1.LTS
      C29_2.2.0.LTS
      Show
      ARMCLANG_3.2.3.LTS ARMCLANG_4.0.5.LTS C29_1.0.1.LTS ARMCLANG_5.1.1.LTS C29_2.2.0.LTS
    • Hide
      ARMCLANG_5.1.2.LTS*
      C29_2.2.2.LTS*
      C29_3.0.0.LTS*
      ARMCLANG_3.2.4.LTS*
      ARMCLANG_4.0.6.LTS*
      C29_1.0.3.LTS*
      Show
      ARMCLANG_5.1.2.LTS* C29_2.2.2.LTS* C29_3.0.0.LTS* ARMCLANG_3.2.4.LTS* ARMCLANG_4.0.6.LTS* C29_1.0.3.LTS*
    • default
    • Hide
      Use --symbol_map option to point renamed_symbol to the current symbol.
      renamed_sym = sym; --> --symbol_map=renamed_sym=sym

      This ensures that the uses of the renamed_sym will correctly resolve to the address of sym.
      Show
      Use --symbol_map option to point renamed_symbol to the current symbol. renamed_sym = sym; --> --symbol_map=renamed_sym=sym This ensures that the uses of the renamed_sym will correctly resolve to the address of sym.

      When using the --relocatable option, symbol addresses defined via assignment expressions in the linker command file (e.g., renamed_sym = sym; ) are not preserved when the final absolute executable is built using a different linker command file than the one used during the relocatable link step.

      Reproduce with the following commands:

      c29clang main.c -Wl,-llnk1.cmd,--relocatable -o rel.out
      c29clang rel.out -Wl,-llnk2.cmd,-umain,-mtest.map

      This will reflect the following symbol placement:

      page  address   name                   
      ----  -------   ----                   
      0     200e0000  main                   
      0     100e0000  renamed_main           
      0     100e0010  renamed_test           
      0     200e0010  test       

       

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

              Created:
              Updated:

                Connection: Intermediate to External PROD System
                EXTSYNC-6781 - Linker does not preserve symbol pla...
                SYNCHRONIZED
                • Last Sync Date: