- Follow the instructions for creating a custom copy of the startup files from the installation area, as described in the preceding sections. Specifically, copy over the particular versions of crtn.s and xcrtinit.s that suit your application. For example, if your application is being bootstrapped and profiled, copy crt2.s and pg-crtinit.s from the installation area.
- Modify pg-crtinit.s to remove the following
brlid r15, __init /* Invoke language initialization functions */ nop
brlid r15, __fini /* Invoke language cleanup functions */ nop
This avoids referencing the extra code usually pulled in for constructor and destructor handling, reducing code size.
- Compile these files into .o files and place them in a directory of your choice, or include them as a part of your application sources.
- Add the -nostartfiles switch to the compiler. Add the -B directory switch if you have chosen to assemble the files in a particular folder.
- Compile your application.
If your application is executing in a different mode, then you must pick the appropriate CRT files based on the description in Startup Files.