Loading text & data section into different segments
Posted: Tue May 15, 2007 3:22 am
Hello all,
I am using the following script to load text and data in different
segments but its not working.
can anyone point to the problems in this ???
OUTPUT_FORMAT("coff-go32")
SECTIONS
{
.text 0x00000000 :
{
*(.text)
. = ALIGN(4096);
etext = .;_etext = .;}
.data 0x00000000:
{
*(.data)
. = ALIGN(4096);
edata = .;_edata = .;}
.bss :
{ *(.bss)
*(COMMON)
. = ALIGN(4096);
end = .;_end = .;}}
I am using DJGPP.when I
use this script along with ld it gives the following error...
ld --oformat coff-go32 -Tld.scr file1.o
error:Section .data overlaps .text section
My intention is to load .text and .data into different segments.If I
use 0x00000000 only in .text then, data gets continuous address.so when
I load data in different location it leaves .text size space and then
copies the data section.It works fine except for the wastage of .text
size memory at the beginning of data segment.
Rgds,
sampath S
I am using the following script to load text and data in different
segments but its not working.
can anyone point to the problems in this ???
OUTPUT_FORMAT("coff-go32")
SECTIONS
{
.text 0x00000000 :
{
*(.text)
. = ALIGN(4096);
etext = .;_etext = .;}
.data 0x00000000:
{
*(.data)
. = ALIGN(4096);
edata = .;_edata = .;}
.bss :
{ *(.bss)
*(COMMON)
. = ALIGN(4096);
end = .;_end = .;}}
I am using DJGPP.when I
use this script along with ld it gives the following error...
ld --oformat coff-go32 -Tld.scr file1.o
error:Section .data overlaps .text section
My intention is to load .text and .data into different segments.If I
use 0x00000000 only in .text then, data gets continuous address.so when
I load data in different location it leaves .text size space and then
copies the data section.It works fine except for the wastage of .text
size memory at the beginning of data segment.
Rgds,
sampath S