Reorder powerpc64 sections for -z relro
authorAlan Modra <amodra@gmail.com>
Tue, 20 Jan 2015 06:41:21 +0000 (17:11 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 20 Jan 2015 09:18:54 +0000 (19:48 +1030)
More sections can be read-only after relocation.  .opd is an obvious
candidate.

* emulparams/elf64ppc.sh (OTHER_READWRITE_SECTIONS): Move .opd to..
(OTHER_RELRO_SECTIONS_2): ..here, new define.
* scripttempl/elf.sc: Add OTHER_RELRO_SECTIONS_2.

ld/ChangeLog
ld/emulparams/elf64ppc.sh
ld/scripttempl/elf.sc

index ae0b29aafa7a7b43a3a5eea5fa598484b6248977..49660455099bfdb772ee7bd03e1f6d645e2be814 100644 (file)
@@ -1,3 +1,9 @@
+2015-01-20  Alan Modra  <amodra@gmail.com>
+
+       * emulparams/elf64ppc.sh (OTHER_READWRITE_SECTIONS): Move .opd to..
+       (OTHER_RELRO_SECTIONS_2): ..here, new define.
+       * scripttempl/elf.sc: Add OTHER_RELRO_SECTIONS_2.
+
 2015-01-19  Alan Modra  <amodra@gmail.com>
 
        PR ld/17615
index 355e0461c3c23ae9268b88c1bd7928cd11265820..556fbf566d36637d5c6f4a9677a9cae98fde0edb 100644 (file)
@@ -37,5 +37,6 @@ OTHER_GOT_RELOC_SECTIONS="
   .rela.branch_lt      ${RELOCATING-0} : { *(.rela.branch_lt) }"
 OTHER_READWRITE_SECTIONS="
   .toc1                ${RELOCATING-0} :${RELOCATING+ ALIGN(8)} { *(.toc1) }
-  .opd         ${RELOCATING-0} :${RELOCATING+ ALIGN(8)} { KEEP (*(.opd)) }
   .branch_lt   ${RELOCATING-0} :${RELOCATING+ ALIGN(8)} { *(.branch_lt) }"
+OTHER_RELRO_SECTIONS_2="
+  .opd         ${RELOCATING-0} :${RELOCATING+ ALIGN(8)} { KEEP (*(.opd)) }"
index b3d95d0f67868c6f2326a199a07f18dd0bb50bdf..07b0395d7eb7194cea95e0e7c784d4b3f0af50ad 100644 (file)
@@ -20,6 +20,7 @@
 #              (e.g., .PARISC.global)
 #      OTHER_RELRO_SECTIONS - other than .data.rel.ro ...
 #              (e.g. PPC32 .fixup, .got[12])
+#      OTHER_RELRO_SECTIONS_2 - as above, but after .dynamic in text segment
 #      OTHER_BSS_SECTIONS - other than .bss .sbss ...
 #      ATTRS_SECTIONS - at the end
 #      OTHER_SECTIONS - at the end
@@ -572,6 +573,7 @@ cat <<EOF
   ${RELOCATING+${DATARELRO}}
   ${OTHER_RELRO_SECTIONS}
   ${TEXT_DYNAMIC-${DYNAMIC}}
+  ${OTHER_RELRO_SECTIONS_2}
   ${DATA_GOT+${RELRO_NOW+${GOT}}}
   ${DATA_GOT+${RELRO_NOW+${GOTPLT}}}
   ${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT+${GOT}}}}
This page took 0.029785 seconds and 4 git commands to generate.