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]

[PATCH] Make relocation sections contiguous for ARM BPAPI


Hi,

This patch helps bfd conform a little better to the ARM BPAPI, by grouping all types of relocation together to enable a postlinker to work correctly (when relevent, e.g. on SymbianOS).

The layout of relocations after the patch is:

  .rel[a].dyn
  .rel[a].plt
  .rel[a].other
  .reli.other

Where .rel[a].other contains all .rel[a].* sections, which the linker script was previously not aware of and placed elsewhere. .reli.other contains .reli.* sections so they are also contiguous, though I am unsure what they are for.

This patch *doesn't* make the linker put .rel[a].plt sections after all other relocation types, as strongly recommended by the BPAPI.

OK to apply?

ChangeLog:

    * ld/scripttempl/armbpapi.sc (.rel.dyn): Add .rel.init_array,
    .rel.fini_array.
    (.rela.dyn): Add .rela.init_array, .rela.fini_array.
    (SECTIONS): Add .rel.other, .rela.other, .reli.other after PLT
    relocs.
Index: ld/scripttempl/armbpabi.sc
===================================================================
RCS file: /cvs/src/src/ld/scripttempl/armbpabi.sc,v
retrieving revision 1.6
diff -c -p -r1.6 armbpabi.sc
*** ld/scripttempl/armbpabi.sc	17 Feb 2005 13:24:59 -0000	1.6
--- ld/scripttempl/armbpabi.sc	14 Mar 2005 19:29:35 -0000
*************** eval $COMBRELOCCAT <<EOF
*** 392,397 ****
--- 392,401 ----
    ${REL_SBSS2}
    .rel.bss      0 : { *(.rel.bss${RELOCATING+ .rel.bss.* .rel.gnu.linkonce.b.*}) }
    .rela.bss     0 : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) }
+   .rel.init_array  0 : { *(.rel.init_array) }
+   .rela.init_array 0 : { *(.rela.init_array) }
+   .rel.fini_array  0 : { *(.rel.fini_array) }
+   .rela.fini_array 0 : { *(.rela.fini_array) }
  EOF
  if [ -n "$COMBRELOC" ]; then
  cat <<EOF
*************** cat <<EOF
*** 413,417 ****
--- 417,424 ----
    .rel.plt      0 : { *(.rel.plt) }
    .rela.plt     0 : { *(.rela.plt) }
    ${OTHER_PLT_RELOC_SECTIONS}
+   .rel.other    0 : { *(.rel.*) }
+   .rela.other   0 : { *(.rela.*) }
+   .reli.other   0 : { *(.reli.*) }
  }
  EOF

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