Creating weak symbols in the linker command file sometimes causes incorrect diagnostic warning #10202-D: no suitable entry-point found; setting to 0

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Medium
    • Code Generation Tools
    • CODEGEN-13602
    • Hide
      MSP430_21.6.0.LTS
      MSP430_21.6.1.LTS
      Show
      MSP430_21.6.0.LTS MSP430_21.6.1.LTS
    • Hide
      MSP430_NEXT*
      MSP430_21.6.2.LTS*
      Show
      MSP430_NEXT* MSP430_21.6.2.LTS*
    • default
    • Hide
      There are a couple of issues at play in the provided test case ...

      First, there is a defect in the provided linker command file in that the RHS of the weak linker symbol assignments specified are not well-defined values. For example, in the example linker file, there are assignment expressions like this:

      weak(TBCCCR1_CC_ISR)=__TI_ISR_TRAP;

      But "__TI_ISR_TRAP" is not a defined symbol at the time that the assignment expression is encountered by the linker. It should be a reference to an earlier defined symbol or an integer constant. Unfortunately, this is not detected by the linker and no diagnostic is emitted to alert the user of the problem. The failure to detect and report the problem to the user is a legitimate linker defect. This linker defect is what eventually leads to the linker crashing on the provided test case.

      From comments in the linker command file in question, it appears that the intent of the above linkerf symbol assignment is to map the "TBCCR1_CC_ISR" symbol to the "__TI_ISR_TRAP" symbol. This can be accomplished using the linker's --symbol_map optoin as follows:

      --symbol_map=TBCCR1_CC_ISR=__TI_ISR_TRAP

      That is, any reference to the symbol "TBCCR1_CC_ISR" will be resolved to the definition of the symbol "__TI_ISR_TRAP".
      Show
      There are a couple of issues at play in the provided test case ... First, there is a defect in the provided linker command file in that the RHS of the weak linker symbol assignments specified are not well-defined values. For example, in the example linker file, there are assignment expressions like this: weak(TBCCCR1_CC_ISR)=__TI_ISR_TRAP; But "__TI_ISR_TRAP" is not a defined symbol at the time that the assignment expression is encountered by the linker. It should be a reference to an earlier defined symbol or an integer constant. Unfortunately, this is not detected by the linker and no diagnostic is emitted to alert the user of the problem. The failure to detect and report the problem to the user is a legitimate linker defect. This linker defect is what eventually leads to the linker crashing on the provided test case. From comments in the linker command file in question, it appears that the intent of the above linkerf symbol assignment is to map the "TBCCR1_CC_ISR" symbol to the "__TI_ISR_TRAP" symbol. This can be accomplished using the linker's --symbol_map optoin as follows: --symbol_map=TBCCR1_CC_ISR=__TI_ISR_TRAP That is, any reference to the symbol "TBCCR1_CC_ISR" will be resolved to the definition of the symbol "__TI_ISR_TRAP".

      Extract the attached test case to an empty directory. Run this command ...

      % cl430 -@top_level.txt
      

      Run it several times. Once every 5-10 times it ends with ...

      warning #10202-D: no suitable entry-point found; setting to 0
      

      Note that --rom_model is used, and thus the entry is _c_int00.

      Edit lnk_msp430f2620_problem.cmd. Find these lines ...

      /* UNCOMMENT TO SEE CRASH */
      /* #define USE_GROUPS     */
      

      Uncomment the second line. Then every build causes ...

      C:\linker_bug>cl430 -@top_level.txt
      <Linking>
      remark #10371-D: (ULP 1.1) Detected no uses of low power mode state changing instructions
      remark #10372-D: (ULP 4.1) Detected uninitialized Port 1 in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins.
      remark #10372-D: (ULP 4.1) Detected uninitialized Port 2 in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins.
      remark #10372-D: (ULP 4.1) Detected uninitialized Port 3 in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins.
      remark #10372-D: (ULP 4.1) Detected uninitialized Port 4 in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins.
      remark #10372-D: (ULP 4.1) Detected uninitialized Port 5 in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins.
      remark #10372-D: (ULP 4.1) Detected uninitialized Port 6 in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins.
      remark #10372-D: (ULP 4.1) Detected uninitialized Port 7 in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins.
      remark #10372-D: (ULP 4.1) Detected uninitialized Port 8 in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins.
      remark #10372-D: (ULP 4.1) Detected uninitialized Port A in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins.
      
      INTERNAL ERROR: lnk430 had an internal inconsistency and aborted
      
      This is caused by a defect in the TI Linker.
      TI Customer Support may be able to suggest a workaround to avoid this.
      
      Upgrading to the newest version of the compiler may fix this problem.
      
      Contact TI in the E2E support forums at http://e2e.ti.com under
      "Development Tools", "TI C/C++ Compiler".  See the link titled
      "Submitting an issue".
      
      We need to see this ENTIRE error message and a complete, reproducible
      test case including ALL of the command-line options.
      Include all of the object files, libraries, and linker command files
      used to link the program.
      
      
      >> Compilation failure
      

            Assignee:
            TI User
            Reporter:
            TI User
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                Connection: Intermediate to External PROD System
                EXTSYNC-5173 - Creating weak symbols in the linker...
                SYNCHRONIZED
                • Last Sync Date: