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]

Linker Script question: section alignment


Hi,

I have a customer who is trying to align the entire .srodata output section on an 8 byte boundary within a MEMORY region. He has tried:

   .srodata BLOCK(8): {
   {
      *(.srodata) *(.srodata.*) *(.gnu.linkonce.srd.*)
   } >MYREGION;

which fails with

address 0x0 of a.out section .srodata is not within region MYREGION if .srodata is the first output section assigned to MYREGION, but not if it is the second or subsequent section (is this a bug?)

He has also tried:

   .srodata :
   {
       . = BLOCK(8);
       *(.srodata) *(.srodata.*) *(.gnu.linkonce.srd.*)
   } >MYREGION

which aligns the data within the section but not the section itself.

What is the correct way to do this? The only thing I can think of is to include the following assembler in his program, since the alignment of an output section is normally the strictest alignment of its input sections:

       .section        .srodata,"aw",@progbits
       .balign 8

This works, but seems awkward to me.

Thanks for any ideas,
Dave



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