I am using Eclipse to develop bare-metal applications. I link against newlib, so I provided my own implementation of _sbrk(). This function was normally included in my project, and everything was working great.
Now I try to move this function to a static library that I have developed over the last months.
During linking I get an undefined reference to _sbrk
error. The path the file is located is properly included to the Eclipse settings (other files in the same directory are linked correctly).
Obviously there is some problem with the order the linker goes through my code, and this function is discarded.
I tried using __attribute__((used))
, without luck.
How can I overcome this problem, through the Eclipse settings? (Makefile based or command line compilation is not the solution I need).