This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GNU Linker: Hole in text segment


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]