PC-relative displacement larger than 24-bit range

Cause: A call to a subroutine that is located in memory above the 24-bit offset range that can be used in PC-relative addressing. The compiler generates code using the pc relative forms of CALL and BR. This limits a single pc discontinuity to 24-bits of address. This severely limits where .text sections can be linked.

2 possible solutions:

  • move that routine to a closer section in memory OR
  • use register addressing to invoke that function. When using the C compiler you can force it to use the conditional forms of CALL and BR using a register to obtain a 32-bit address. You can use indirect calls to call functions anywhere in the address space. In C you do this by declaring a pointer to a function and then calling the function through the pointer:

int f();
int (*ptr_to_f)() = f;

main()
{

(*ptr_to_f)();
}

At present there are no plans to automatically compile normal calls into indirect calls.


Device: TMS320C3x
Category: TI Tools Information
Detail: Code Generation Tools
Detail2: General
Title: 24-bits of address
Source: Case from TMS320 Hotline
Date: 4/28/98
GenId: a2

© Copyright 1998 Texas Instruments Incorporated. All rights reserved.
Trademarks, Important Notice!