Hi Mojtaba,
The bootloader and application code must be located at different address areas. Any Flash sector which share bootloader and application code is potential source of issue. Therefore bootloader-application border must be aligned by flash sector size.
So, there should not be also any overlapping in s-recod files.
Every s-record line contains S record type identifier, length, address, data, and CRC. SREC (file format) - Wikipedia
The S-Rec files are text files. You may simply copy all S1/S2 lines (starting by “S1” or “S2”) from the bootloader s19 file into application s19 file (or opposite).
You may ignore all lines except S1/S2 - like lines starting with S0 (file header) or S9 (at end of file).
Note: The S3 format is not relevant for 16bit MCUs.
If there is overlapping at addresses with reset vector(s) use lines from bootloader code.
Please check AN4258 for more details.