System initialization
It is likely that you need to adapt the system initialization. For example, your application might need to initialize memory-mapped special function registers (SFRs), or omit the default initialization of data sections performed by the system startup code.
You can do this by implementing your own version of the routine __low_level_init, which is called from the cmain.s file before the data sections are initialized. Modifying the cmain.s file directly should be avoided.
The code for handling system startup is located in the source files cstartup.s and low_level_init.c. cstartup.s is located in the arm\src\lib\arm, arm\src\lib\thumb (for Cortex-M), or arm\src\lib\a64 directory, and low_level_init.c is located in the arm\src\lib\runtime directory.
Note that normally, you do not need to customize either of the files cmain.s or cexit.s.
Note
Regardless of whether you implement your own version of __low_level_init or the file cstartup.s, you do not have to rebuild the library.