I was struggling with the function pointer in Dallas 390 contiguous mode. It seems that the linker might not relocate the correct address in function pointer. Check the following code:
void Test(void) { UINT32 u32Tmp; u32Tmp = 0x12345678ul; TASK_PRN(("u32Func = %lx\n", u32Tmp)); u32Tmp = Test; TASK_PRN(("u32Func = %lx\n", u32Tmp)); }
The bug is in your expectations, not in the linker. What on earth made you assume you knew what the result of casting a pointer to an integer was, better than the tools that actually use those pointers? Do you know what terms like "undefined behaviour" or "unspecified result" mean? Not only is your expectation unfounded, it actually contradicts the documented behaviour, too.