This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: GNU Linker: Hole in text segment
- From: Nick Clifton <nickc at redhat dot com>
- To: amolk at ishoni dot com
- Cc: binutils at sources dot redhat dot com
- Date: 04 Nov 2002 17:07:03 +0000
- Subject: Re: GNU Linker: Hole in text segment
- References: <7CFD7CA8510CD6118F950002A519EA3001FE5735@leonoid.in.ishoni.com>
Hi Amol,
> Suppose my .text segment starts at 0x80040000 and ends at 0x80080000
> Actaully I want to reserve memory area 0x80060000 - 0x80070000. Is is
> possible to create such hole in .text segment so that linker
> does not generate any addresses in this area.
Sorry - there is no simple way to do this using the GNU linker.
You could define two different sections, eg .text1 and .text2 and
assign them to different memory regions like this:
MEMORY {
region1 : org = 0x80040000, len = (0x800600000 - 0x800400000)
region2 : org = 0x80070000, len = (0x800800000 - 0x800700000)
}
SECTIONS {
.text1 : { *(.text1) } > region1
.text2 : { *(.text2) } > region1
}
However the problem with this is that you have to manually sort and
rename the .text sections in your input files to either .text1 or
.text2. The linker will not split them for you.
Cheers
Nick