Note that there are some explanatory texts on larger screens.

plurals
  1. POUndefined reference to _sbrk
    primarykey
    data
    text
    <p>I am having a problem with _sbrk. In a link phase of compilation i use below comand to link my objects and i get undefined reference to _sbrk.</p> <pre><code>arm-none-eabi-ld -static -T linkerscript.ld -o exe timer_example.o /home/ziga/projects/cs_lite/arm-none-eabi/lib/libc.a /home/ziga/projects/cs_lite/lib/gcc/arm-none-eabi/4.5.1/libgcc.a </code></pre> <p>I am compiling for arm926ej-s and in ARM mode so i think i have chosen the right multilib (libc.a and libgcc.a) which is located in folder home/ziga/projects/cs_lite/arm-none-eabi/lib/.</p> <p>I have been searching internet for _sbrk function and it is some sort of a memory managment call which isnt included in standard C libraries as it is dependant on microprocessor. Soo do i have to write _sbrk function on my own? How do i do it? Do you have any example for arm926ej-s? After writing this function i intend to compile it into an object file and link it together with other objects, libraries.</p> <p>With kind regards, Ziga.</p> <hr> <p>I solved this problem and will post solution here so i give something back to comunity. The function _sbrk is located inside NXP CDL package for ARM. Package is available for download (link is for all who dont know this already) here: <a href="http://www.lpclinux.com/Downloads/WebHome">http://www.lpclinux.com/Downloads/WebHome</a> In subfolder CDL_v005/csps/lpc313x/bsps/ea3131/source you will find source file named libnosys_gnu.c which should be added to the project and compiled to object file and after that linked to executable file alongside other objects and libraries.</p> <p>Best wishes and a lot of sucess.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload