 RE: Ensure thread safety in ARM C/C++ libraries Jaroslav Fojtík I have obtained solution for this issue from Keil support: *** 2011-05-19 10:09 BST *** Barth, Andreas/ARM:1187425 andreas.barth@arm.com *** Dear Jaroslav, here my explanation of the problem. No, I think this does not depend on the amount of compiled code. You can activate this effect also in my example by using the C/C++ option "One ELF section per function" (which you have also enabled in your project). Then the following manual entry is also relevant: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0206j/CACCEEIF.html The functions _mutex_acquire and _mutex_release are only weakly referenced by the library. As there is no other object in the the ELF sections with this function, they will not pulled in by the linker. This explains the manual entry. So to solve the problem, don't use "One ELF section per function" or better, use the __attribute__((used)) on that 2 functions. __attribute__((used)) void _mutex_release (void* mutex) { } __attribute__((used)) void _mutex_acquire(void* mutex) { } Opposite to this, function _mutex_initialize is strongly referenced by the library and will not have this problem. I hope this information explains the situation. Best regards, Andreas Barth |