I'm trying to compile a program for a stm32f4-discovery board using code
sourcery g++ lite and I'm having a peculiar problem. My program uses the
"new operator" and I had to implement the _sbrk function.
Here is the linker command:
arm-none-eabi-g++ -mthumb -mcpu=cortex-m4 -march=armv7e-m
-mfix-cortex-m3-ldrd -o main.elf -O2 -g -Wall -Werror
-Wl,-T/home/li/dev/arm_rc/ld/cs3.ld main.o start_cs3.o newlib_stubs.o
_sbrk is in newlib_stubs.c (.o). Knowing that order of the files on the
command line counts, I tried moving newlib_stubs.o as first/last
argument but with no success.
What could be wrong?
Note that the C version of the program that uses malloc is compiling
just fine (arm-none-eabi-gcc instead of arm-none-eabi-g++)