To use position-independent code or position-independent data in your program, you must
customize the runtime library. To customize the runtime library, follow these steps:
- Load project file EWL_Runtime_ARM_CORTEXM.mcp, from the folder \ARM_EABI_Support\ewl\EWL_Runtime
- Modify runtime functions.
- Open the file startup.c.
- 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.)
- As appropriate for your application, change or remove runtime function __fix_addr_references. (This function creates the relocation tables.)
- Change the prefix file.
- Open the C/C++ preference panel for your target.
- Make sure this panel specifies prefix file PICPIDRuntimePrefix.h.
- 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.