This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

relocating segments

Hello,

I asked a similar question a while ago concerning relocation of library segments that the linker (by default) places in common area.

I have been happily relocating any ?PR? segment (e.g. ?PR?PRINTF?PRINTF)that appeared in the common area into one of my two code banks without any problems, but I read (today) in the BL linker guide that this shouldn't be done- Has anyone any experience of the conditions that this practise would cause problems?

Also, I'm curious to know whether the following would be considered 'safe':
Assuming two code segments ?PR?B0INTT0 and ?PR?TIMER0_INT?B0INTT0 have been located in common area. The actual interrupt function (timer0_int) must stay in common area, but can I move ?PR?B0INTT0 into a different code bank?

Also, does the ?C?LIB_CODE segment have to reside in common area?

Many thanks

David

Parents
  • I have been happily relocating any ?PR? segment (e.g. ?PR?PRINTF?PRINTF)that appeared in the common area into one of my two code banks without any problems, but I read (today) in the BL linker guide that this shouldn't be done- Has anyone any experience of the conditions that this practise would cause problems?

    You can PROBABLY do this safely with some of the library functions. However, it is likely to cause problems with many of the helper routines that come from the library.

    but can I move ?PR?B0INTT0 into a different code bank?

    That should be OK.

    Also, does the ?C?LIB_CODE segment have to reside in common area?

    Probably. This segment contains code from the library that is not necessarily library functions but that are help routines for the compiler. It includes things like pointer operations and 32-bit math. You MIGHT be able to move them, but you would slow your program down a lot. If these routines are used in interrupts, this would force the interrupt to do a bank switch to get to them, too.

    Jon

Reply
  • I have been happily relocating any ?PR? segment (e.g. ?PR?PRINTF?PRINTF)that appeared in the common area into one of my two code banks without any problems, but I read (today) in the BL linker guide that this shouldn't be done- Has anyone any experience of the conditions that this practise would cause problems?

    You can PROBABLY do this safely with some of the library functions. However, it is likely to cause problems with many of the helper routines that come from the library.

    but can I move ?PR?B0INTT0 into a different code bank?

    That should be OK.

    Also, does the ?C?LIB_CODE segment have to reside in common area?

    Probably. This segment contains code from the library that is not necessarily library functions but that are help routines for the compiler. It includes things like pointer operations and 32-bit math. You MIGHT be able to move them, but you would slow your program down a lot. If these routines are used in interrupts, this would force the interrupt to do a bank switch to get to them, too.

    Jon

Children
No data