This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Error while linking: reference to symbol in discarded location not allowed



Hi all,

I'm trying to build a CCSv5.1 project using a tx.a library ( I read that CCS supports .a files), but I get the following error:

fatal error #10232: relocation type "R_ARM_ABS32" in file "tx.a<tx_timer_create.o>" at offset 0x00000014 in section .iar.debug_line" references symbol ".debug_info18" in discarded section with id (18); references to this symbol from this location are not allowed

The file is used with IAR tools, will it work for CCS as well?

  • Jasmeet,

    What options, if any, were used when building the library with IAR tools? I may need to get some help on this one, but can you attach the library file (tx.a) here for us to take a look at?

    What is the CCSv5 command line seen in the build console for the linking step? Please cut and paste it here so we can see the full set of options.

  • The library tx.a was used with some other project in IAR tools, I'm not allowed to share the library file, sorry.

    The build console for linking step is pasted below:

    C:\ti\ccsv5\utils\bin\gmake -k all

    'Building target: ../GNSS_45nm.out'

    'Invoking: ARM Linker'

    "C:/ti/ccsv5/tools/compiler/tms470/bin/cl470" -mv7M3 --code_state=16 --abi=eabi -me -O3 -g --define="_DEBUG" --quiet --diag_warning=225 --display_error_number --obj_directory="D:/GNSS_45nm/Private/source/product/ti/GPS_ROM/projectfiles/TILinkAll/Build_45NM" -z --stack_size=256 -m"../GNSS_45nm.map" --heap_size=0 -i"C:/Documents and Settings/x0176474/Desktop" -i"C:/ti/ccsv5/tools/compiler/tms470/lib" -i"C:/ti/ccsv5/tools/compiler/tms470/include" -i"" -i"D:/threadx cortex m3 gnss/New Folder/TILinkAll" -i"D:/threadx cortex m3 gnss/New Folder/TILinkAll/../../projectfiles/TILinkAll" --reread_libs --warn_sections --rom_model -o "../GNSS_45nm.out" "../Gnss_45nmLink.cmd" -l"C:/GNSS_45nm/Private/source/product/ti/GPS_ROM/projectfiles/ai2/Build_45NM/ai_NoChkSum.lib" -l"C:/GNSS_45nm/Private/source/product/ti/GPS_ROM/projectfiles/lp/Build_45NM/lp.lib" -l"C:/GNSS_45nm/Private/source/product/ti/GPS_ROM/projectfiles/libs/Build_45NM/libs.lib" -l"C:/GNSS_45nm/Private/source/product/ti/GPS_ROM/projectfiles/cc/Build_45NM/cc.lib" -l"C:/GNSS_45nm/Private/source/product/ti/GPS_ROM/projectfiles/mc/Build_45NM/mc.lib" -l"C:\Documents and Settings\x0176474\Desktop\tx.a" -l"C:/GNSS_45nm/Private/source/product/ti/GPS_ROM/projectfiles/cd/Build_45NM/cd.lib" -l"C:/GNSS_45nm/Private/source/product/ti/GPS_ROM/projectfiles/nf/Build_45NM/nf.lib" "D:/GNSS_45nm/Private/source/product/ti/GPS_ROM/projectfiles/TILinkAll/Build_45NM/os_diag.obj" "D:/GNSS_45nm/Private/source/product/ti/GPS_ROM/projectfiles/TILinkAll/Build_45NM/os_api.obj" "D:/GNSS_45nm/Private/source/product/ti/GPS_ROM/projectfiles/TILinkAll/Build_45NM/fs_tou16.obj" "D:/GNSS_45nm/Private/source/product/ti/GPS_ROM/projectfiles/TILinkAll/Build_45NM/fd_tou16.obj" -l"Build_45NM/../fpu.lib" -l"C:/GNSS_45nm/Private/source/product/ti/GPS_ROM/projectfiles/meif/Build_45NM/meif.lib" -l"rtsv7M3_T_le_eabi.lib" "../fpu.lib"

    fatal error #10232: relocation type "R_ARM_ABS32" in file "C:\Documents and

    Settings\x0176474\Desktop\tx.a<tx_timer_create.o>" at offset 0x00000014 in

    section ".iar.debug_line" references symbol ".debug_info18" in discarded

    section with id (18); references to this symbol from this location are not

    allowed

    >> Compilation failure

    gmake: *** [../GNSS_45nm.out] Error 1

    gmake: Target `all' not remade because of errors.

    **** Build Finished ****

    I also tried to build a demo project with the same library in ARM RVDS tools, it gives me a similar error (but for a different object file)

    Here's the build console for that:

    'Building target: cortex_demo.axf'

    'Invoking: ARM RealView Linker'

    armlink --diag_style=ide --userlibpath="C:\Documents and Settings\x0176474\Desktop" "C:\Documents and Settings\x0176474\Desktop\tx.a" -o"cortex_demo.axf" ./demo_threadx.o

    armlink : error L6654: Rejected Local symbol .debug_info18 is referred to from a non group section .iar.debug_line in object tx_event_flags_create.o

    armlink : Finished: 0 information, 0 warning and 1 error messages.

    make: *** [cortex_demo.axf] Error 1

    make: Target `main-build' not remade because of errors.

    Build complete for project cortex_demo

  • Jasmeet,

    Since the linker fails in a similar manner with the ARM toolset as well, I suspect it has something to do with the way the library was created. I am not very familiar with the IAR tools, but maybe you can try to contact IAR and try to get their comments on what might trigger these types of messages. I'll also try to see if others here have any further ideas on this.

  • My guess is that the library is somehow corrupted.  Try extracting all of the library files from the archive and linking with those instead of the library.  If you get the same error, you know that one of the object files is corrupted, and you can focus on that file.  If you don't get the same error, something went wrong when building the library, which would be a problem with whatever toolset was used to create the library.