[arm-gnu] Linking error on arm-none-eabi.
Carlos O'Donell
carlos_odonell at mentor.com
Mon Jun 11 12:55:42 UTC 2012
On 6/11/2012 8:42 AM, 42Bastian wrote:
> Hi
>
>> D:\toolchain_4.2.3\arm-none-eabi\bin\../lib\libc.a(lib_a-sbrkr.o): In
>> function `_sbrk_r':sbrkr.c:(.text+0x18): undefined reference to `_sbrk'.
>
> Try adding a C file with these two functions:
>
> #ifdef __GNUC__
> void __aeabi_unwind_cpp_pr0()
> {
> /* empty */
> }
> void __aeabi_unwind_cpp_pr1()
> {
> /* empty */
> }
> #endif
>
Or try adding an _sbrk implementation.
Although you may have no malloc (or related functions) calls, you could
still have an _sbrk call used by the runtime to allocate heap.
Generate a link map with -Wl,-Map,linkmap.txt and use the dependency
information to determine which object file required _sbrk. This will
help you track down what required _sbrk and change it to use a static
buffer (or work around the issue in the runtime).
Cheers,
Carlos.
--
Carlos O'Donell
Mentor Graphics / CodeSourcery
carlos_odonell at mentor.com
carlos at codesourcery.com
+1 (613) 963 1026
More information about the arm-gnu
mailing list