When you define the SysTick_Handler
in cortex_handlers.c it defines the normal entry point. But it will overwrite the weak symbol only when the linker gets a request to link the specific object file (from libOS.a).
The libHardware.a usually defines the Interrupt vector table where the SysTick_Handler
is referenced. This is the only pointer this actual name comes in the game. (For the ARM it's just an entry in the vector table.) The same library already provides a weak symbol. Therefore the linker doesn't search for that symbols anymore. When you want to overwrite the symbol in cortex_handlers.c you need to reference any symbol in that file causing the linker to use cortex_handlers.o. That will kick off the weak symbol.
// cortex_handlers.c
void SysTick_Handler()
{
}
int link_my_cortex_handlers_file;
Just reference somewhere the symbol link_my_cortex_handlers_file
.