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.

undefined reference to `end' in sbrk.c in library libnosys.a !!

Other Parts Discussed in Thread: TM4C129XNCZAD

Hi all,

I am trying to build my project consisting of only c files in CCS version: 5.5.0.00077 

I am using the GNU V4.7.3  compiler and the target device is tm4c129xnczad.

I have referred to  http://processors.wiki.ti.com/index.php/Using_GCC_with_Tiva_in_CCSv6  document for using GNU compiler on CCS. 

My project build and runs correctly when using TI ARM compiler. But when i use GNU compiler i get the linker error as below:

" c:/ti/ccsv5/tools/compiler/gcc-arm-none-eabi-4_7-2012q4/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/armv7e-m/softfp\libnosys.a(sbrk.o): In function `_sbrk':

sbrk.c:(.text._sbrk+0x2): undefined reference to `end'
sbrk.c:(.text._sbrk+0x8): undefined reference to `end'
collect2.exe: error: ld returned 1 exit status
gmake: *** [acs_ccs_project_temp.out] Error 1
gmake: Target `all' not remade because of errors. "

I am not able to figure out what could be wrong. I have made sure the paths of the libraries and include files and pre processor directives have been given properly,

Thanks.

Regards,

Sreenivasa

  • You may have to link in a different set of libraries than the ones mentioned in that wiki page. That was simply an example to show where and how to list the libraries, but as for which libraries to pass to the linker for your application, that would be depedent on the code.

    We are not experts on the GCC toolchain so I would suggest posting your question to the GNU Tools Launchpad website: https://launchpad.net/gcc-arm-embedded. It might help to include your source code and command line being passed to the linker (which you can copy and paste from the CCS build console).

  • sreenivasa upadhyaya said:
    sbrk.c:(.text._sbrk+0x2): undefined reference to `end'
    sbrk.c:(.text._sbrk+0x8): undefined reference to `end'

    The symbol end needs to be defined in the .lds linker script, which is used to set the location of the heap.

    Looking at the .lds linker script generated in a ARM GNU example created in CCSv6 showed the following which defines end:

        .heap : {
            __heap_start__ = .;
            end = __heap_start__;
            _end = end;
            __end = end;
            KEEP(*(.heap))
            __heap_end__ = .;
            __HeapLimit = __heap_end__;
        } > REGION_HEAP