If I just want to replace all refrences to IRQHandler
globally, I can use defsym
.
I.e. compile with
gcc main.c lib.c lib2.c -Wl,--defsym=IRQHandler=__wrap_IRQHandler -o prog
And then both IRQHandler
and g_IRQHANDLER
point to __wrap_IRQHandler