I need to add a new section to my application (.elf). I have got the default linker script. Then I have read the GNU Linker manual. By following the instructions in manual, I have edited linker script file. However, the application gives a segmentation fault error when a 0x400 byte area is reserved for the .patchText
section shown below.
Here is the relevant part of the linker script I have edited :
.patchText :
{
*patchObsw.o (.text .data .rodata)
. = 0x400;
} > ram
In this case the application is compiled and linked successfully, but running the application gives a segmentation fault.
If I remove the . = 0x400;
line from the linker script, redo the compilation and linking process it is still successful there is no segmentation fault.
According to the GNU linker manual this line is OK.
I could not understand what the problem is here.