ARM linker with scatter file, overlay region error L6285E

Hi there,

I met a linking error about overlay attribute for execution region. I am using KEIL MDK(V5.36) and ARM compiler toolchain(V5.06 and V6.18) to build my code. The target is Cortex-M3.

The problem is, in a function which put in an overlay execution region, when I call another function in a absolute execution region, it failed at linking.

The following example may help understand this problem. the call of test_rom() in test_overlay_1() and test_overlay_2() will result in linking error L6285E.

Error: L6285E: Non-relocatable Load region LOAD_RAM contains R-Type dynamic relocations. First R-Type dynamic relocation found in test_pi_overlay.o(.overlay1) at offset 0x2.

I have seen the explanation of this error, but still not understanding.

From my point of view, in this case, the function call from OVERLAY region(TEST1) to ABSOLUTE region(RO_SECTION) cause this error. But there is no PI reference. The PI region(TEST_PI) is even empty. I think there is no relation between PI region and other regions.

And why linker cannot resolve the relocation information? I am not sure why the load region still contains the dynamic relocation.

I want to know is it not possible to do this, or just because ARM linker do not support this behaviour so far?

And is there any way to bypass this restriction?