Position-Independent Code

To use position-independent code or position-independent data in your program, you must customize the runtime library. Follow these steps:

  1. Load project file EWL_RuntimeCF.mcp, from the folder \ColdFire_Support\ewl\EWL_Runtime.
  2. Modify runtime functions.
    1. Open file CF_startup.c.
    2. As appropriate for your application, change or remove runtime function __block_copy_section. (This function relocates the PIC/PID sections in the absence of an operating system.)
    3. As appropriate for your application, change or remove runtime function __fix_addr_references. (This function creates the relocation tables.)
  3. Change the prefix file.
    1. Open the C/C++ preference panel for your target.
    2. Make sure this panel specifies prefix file PICPIDRuntimePrefix.h.
  4. Recompile the runtime library for your target.

Once you complete this procedure, you are ready to use the modified runtime library in your PIC/PID project. Source-file comments and runtime-library release notes may provide additional information.