Binary files a/bfd/.elf64-ppc.c.swp and b/bfd/.elf64-ppc.c.swp differ diff -Nrup a/ld/emulparams/elf64ppc.sh b/ld/emulparams/elf64ppc.sh --- a/ld/emulparams/elf64ppc.sh 2013-02-27 13:28:03.000000000 -0700 +++ b/ld/emulparams/elf64ppc.sh 2015-03-27 14:03:16.832434850 -0600 @@ -15,11 +15,8 @@ ARCH=powerpc:common64 MACHINE= NOP=0x60000000 OTHER_TEXT_SECTIONS="*(.sfpr .glink)" -BSS_PLT= -OTHER_BSS_SYMBOLS=" +OTHER_SDATA_SECTIONS=" .tocbss ${RELOCATING-0} :${RELOCATING+ ALIGN(8)} { *(.tocbss)}" -OTHER_PLT_RELOC_SECTIONS=" - .rela.tocbss ${RELOCATING-0} : { *(.rela.tocbss) }" if test x${RELOCATING+set} = xset; then GOT=" @@ -34,11 +31,22 @@ INITIAL_RELOC_SECTIONS=" .rela.opd ${RELOCATING-0} : { *(.rela.opd) }" OTHER_GOT_RELOC_SECTIONS=" .rela.toc ${RELOCATING-0} : { *(.rela.toc) } + .rela.toc1 ${RELOCATING-0} : { *(.rela.toc1) } + .rela.tocbss ${RELOCATING-0} : { *(.rela.tocbss) } .rela.branch_lt ${RELOCATING-0} : { *(.rela.branch_lt) }" -OTHER_READWRITE_SECTIONS=" - .toc1 ${RELOCATING-0} :${RELOCATING+ ALIGN(8)} { *(.toc1) } +OTHER_RELRO_SECTIONS_2=" .opd ${RELOCATING-0} :${RELOCATING+ ALIGN(8)} { KEEP (*(.opd)) } + .toc1 ${RELOCATING-0} :${RELOCATING+ ALIGN(8)} { *(.toc1) } .branch_lt ${RELOCATING-0} :${RELOCATING+ ALIGN(8)} { *(.branch_lt) }" +# Put .got before .data +DATA_GOT=" " +# Always make .got read-only after relocation +SEPARATE_GOTPLT=0 +# Also put .sdata before .data +DATA_SDATA=" " +# and .plt/.iplt before .data +DATA_PLT= +PLT_BEFORE_GOT=" " # Treat a host that matches the target with the possible exception of "64" # in the name as if it were native. diff -Nrup a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc --- a/ld/scripttempl/elf.sc 2013-02-27 13:28:03.000000000 -0700 +++ b/ld/scripttempl/elf.sc 2015-03-27 13:34:43.700386810 -0600 @@ -14,6 +14,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 @@ -195,12 +196,12 @@ if test -z "${NO_SMALL_DATA}"; then else NO_SMALL_DATA=" " fi -if test -z "${DATA_GOT}"; then +if test -z "${SDATA_GOT}${DATA_GOT}"; then if test -n "${NO_SMALL_DATA}"; then DATA_GOT=" " fi fi -if test -z "${SDATA_GOT}"; then +if test -z "${SDATA_GOT}${DATA_GOT}"; then if test -z "${NO_SMALL_DATA}"; then SDATA_GOT=" " fi @@ -593,10 +594,16 @@ cat <