In a bare metal C/C++ project, I use gcc-arm-embedded (currently the most recent 4.9-2015-q2).
For some reasons, I have to avoid using some functions, like some of stdio et cetera (don't want to use retargeting or semihosting).
Further, I use FreeRtos with heap_4.c and had e.g. malloc() redirected directly to pvPortMalloc() like this:
void* malloc(size_t s) {
return pvPortMalloc(s);
}
Therefore, I don't want to have any parts of the toolchain's heap management code within my binary.
Now, there are some situations, as were a developer of my team means to use e.g. printf() which indirectly references _malloc_r() (and some more) and it's actually quite hard to find out where it's referenced from and so where to fix.
(The use printf() is just an example here. In my project, I have custom implementation of printf() which prints directly to uart without using stdio. But there are other cases, e.g. type info demangeling, …)
Currently, I have the situation that my project (which consists of about 200 c and c++ source files) compiles well without referencing _malloc_r() in any way - as long as I build with gcc 4.8.
But when building with gcc 4.9, I see unwanted references to _malloc_r and some more.
Might there be command line tool to analyze my elf file for finding out where specific functions are referenced from?
Aucun commentaire:
Enregistrer un commentaire