Global variables (.bss) must not be accessed before relocation.
That memory is now overlayed with the .rel.dyn ELF relocation table.
Even if that was allowed, it would have no positive effect since
initialized value would not be relocated into RAM. It would be 0
again.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
/* Enable the decrementer */
val |= XSCUTIMER_CONTROL_ENABLE_MASK;
XScuTimer_WriteReg(XSCUTIMER_CONTROL_OFFSET, val);
-
- reset_timer_masked();
+
+ /* This must not be called before relocation */
+ /*reset_timer_masked();*/
return 0;
}
void reset_timer_masked(void)
{
/* reset time */
- lastdec = XScuTimer_GetCounterValue() / (TIMER_TICK_HZ/CONFIG_SYS_HZ);
+ lastdec = XScuTimer_GetCounterValue() / (TIMER_TICK_HZ/CONFIG_SYS_HZ);
timestamp = 0;
}