2015-01-20 Alan Modra <amodra@gmail.com>
+ * emulparams/elf64ppc.sh (BSS_PLT): Don't define.
+ (OTHER_READWRITE_SECTIONS): Move .branch_lt to..
+ (OTHER_RELRO_SECTIONS_2): ..here.
+ (DATA_GOT, SEPARATE_GOTPLT, DATA_SDATA, DATA_PLT,
+ PLT_BEFORE_GOT): Define.
+ * scripttempl/elf.sc: Handle DATA_SDATA and DATA_GOT/DATA_PLT/
+ PLT_BEFORE_GOT combination.
+ (DATA_GOT, SDATA_GOT): Don't define if either is already defined.
+
+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.
unset OTHER_END_SYMBOLS
unset OTHER_RELRO_SECTIONS
OTHER_TEXT_SECTIONS="*(.sfpr .glink)"
-BSS_PLT=
OTHER_BSS_SYMBOLS="
.tocbss ${RELOCATING-0} :${RELOCATING+ ALIGN(8)} { *(.tocbss)}"
OTHER_PLT_RELOC_SECTIONS="
.rela.toc ${RELOCATING-0} : { *(.rela.toc) }
.rela.branch_lt ${RELOCATING-0} : { *(.rela.branch_lt) }"
OTHER_READWRITE_SECTIONS="
- .toc1 ${RELOCATING-0} :${RELOCATING+ ALIGN(8)} { *(.toc1) }
- .branch_lt ${RELOCATING-0} :${RELOCATING+ ALIGN(8)} { *(.branch_lt) }"
+ .toc1 ${RELOCATING-0} :${RELOCATING+ ALIGN(8)} { *(.toc1) }"
OTHER_RELRO_SECTIONS_2="
- .opd ${RELOCATING-0} :${RELOCATING+ ALIGN(8)} { KEEP (*(.opd)) }"
+ .opd ${RELOCATING-0} :${RELOCATING+ ALIGN(8)} { KEEP (*(.opd)) }
+ .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=" "
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
${OTHER_RELRO_SECTIONS}
${TEXT_DYNAMIC-${DYNAMIC}}
${OTHER_RELRO_SECTIONS_2}
+ ${DATA_GOT+${RELRO_NOW+${DATA_PLT+${PLT_BEFORE_GOT+${PLT}}}}}
${DATA_GOT+${RELRO_NOW+${GOT}}}
${DATA_GOT+${RELRO_NOW+${GOTPLT}}}
${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT+${GOT}}}}
${RELOCATING+${DATA_SEGMENT_RELRO_END}}
${INITIAL_READWRITE_SECTIONS}
+ ${DATA_SDATA+${SDATA}}
+ ${DATA_SDATA+${OTHER_SDATA_SECTIONS}}
+ ${DATA_GOT+${RELRO_NOW-${DATA_PLT+${PLT_BEFORE_GOT+${PLT}}}}}
${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT-${GOT}}}}
${DATA_GOT+${RELRO_NOW-${GOTPLT}}}
${OTHER_READWRITE_SECTIONS}
${SMALL_DATA_CTOR+${RELOCATING+${CTOR}}}
${SMALL_DATA_DTOR+${RELOCATING+${DTOR}}}
- ${DATA_PLT+${PLT_BEFORE_GOT+${PLT}}}
+ ${SDATA_GOT+${DATA_PLT+${PLT_BEFORE_GOT+${PLT}}}}
${SDATA_GOT+${RELOCATING+${OTHER_GOT_SYMBOLS+. = .; ${OTHER_GOT_SYMBOLS}}}}
${SDATA_GOT+${GOT}}
${SDATA_GOT+${OTHER_GOT_SECTIONS}}
- ${SDATA}
- ${OTHER_SDATA_SECTIONS}
+ ${DATA_SDATA-${SDATA}}
+ ${DATA_SDATA-${OTHER_SDATA_SECTIONS}}
${RELOCATING+${DATA_END_SYMBOLS-${USER_LABEL_PREFIX}_edata = .; PROVIDE (${USER_LABEL_PREFIX}edata = .);}}
${RELOCATING+. = .;}
${RELOCATING+${USER_LABEL_PREFIX}__bss_start = .;}
2015-01-20 Alan Modra <amodra@gmail.com>
+ * ld-powerpc/ambiguousv1.d,
+ * ld-powerpc/ambiguousv1b.d,
+ * ld-powerpc/ambiguousv2.d,
+ * ld-powerpc/ambiguousv2b.d,
+ * ld-powerpc/elfv2exe.d,
+ * ld-powerpc/elfv2so.d,
+ * ld-powerpc/tlsexe.r,
+ * ld-powerpc/tlsexetoc.r,
+ * ld-powerpc/tlsso.r,
+ * ld-powerpc/tlstocso.r: Update.
+
+2015-01-20 Alan Modra <amodra@gmail.com>
+
PR ld/17615
* ld-elf/pr17615.d: Match .sbss too.
.*
0: .*
1: 0+00000000 0 FUNC GLOBAL DEFAULT UND my_func
- 2: 0+10010390 0 NOTYPE GLOBAL DEFAULT 11 __bss_start
- 3: 0+10010390 0 NOTYPE GLOBAL DEFAULT 11 _edata
- 4: 0+10010390 0 NOTYPE GLOBAL DEFAULT 11 _end
-
+#...
Symbol table '\.symtab' contains 19 entries:
- Num: Value Size Type Bind Vis Ndx Name
- 0: .*
- 1: 0+10000158 0 SECTION LOCAL DEFAULT 1
- 2: 0+10000170 0 SECTION LOCAL DEFAULT 2
- 3: 0+10000198 0 SECTION LOCAL DEFAULT 3
- 4: 0+10000210 0 SECTION LOCAL DEFAULT 4
- 5: 0+10000248 0 SECTION LOCAL DEFAULT 5
- 6: 0+10000260 0 SECTION LOCAL DEFAULT 6
- 7: 0+10000264 0 SECTION LOCAL DEFAULT 7
- 8: 0+10010268 0 SECTION LOCAL DEFAULT 8
- 9: 0+10010368 0 SECTION LOCAL DEFAULT 9
- 10: 0+10010370 0 SECTION LOCAL DEFAULT 10
- 11: 0+10010388 0 SECTION LOCAL DEFAULT 11
- 12: 0+10010268 0 OBJECT LOCAL DEFAULT 8 _DYNAMIC
- 13: 0+10010368 0 NOTYPE GLOBAL DEFAULT 9 func_tab
+#...
14: 0+00000000 0 FUNC GLOBAL DEFAULT UND my_func
- 15: 0+10010370 0 FUNC GLOBAL DEFAULT 10 _start
- 16: 0+10010390 0 NOTYPE GLOBAL DEFAULT 11 __bss_start
- 17: 0+10010390 0 NOTYPE GLOBAL DEFAULT 11 _edata
- 18: 0+10010390 0 NOTYPE GLOBAL DEFAULT 11 _end
+#pass
.*
0: .*
1: 0+10010390 4 FUNC GLOBAL DEFAULT 12 my_func
- 2: 0+10010390 0 NOTYPE GLOBAL DEFAULT 12 __bss_start
- 3: 0+10010390 0 NOTYPE GLOBAL DEFAULT 11 _edata
- 4: 0+10010398 0 NOTYPE GLOBAL DEFAULT 12 _end
-
+#...
Symbol table '\.symtab' contains 20 entries:
-.*
- 0: .*
- 1: 0+10000158 0 SECTION LOCAL DEFAULT 1
- 2: 0+10000170 0 SECTION LOCAL DEFAULT 2
- 3: 0+10000198 0 SECTION LOCAL DEFAULT 3
- 4: 0+10000210 0 SECTION LOCAL DEFAULT 4
- 5: 0+10000248 0 SECTION LOCAL DEFAULT 5
- 6: 0+10000260 0 SECTION LOCAL DEFAULT 6
- 7: 0+10000264 0 SECTION LOCAL DEFAULT 7
- 8: 0+1000026c 0 SECTION LOCAL DEFAULT 8
- 9: 0+10010270 0 SECTION LOCAL DEFAULT 9
- 10: 0+10010370 0 SECTION LOCAL DEFAULT 10
- 11: 0+10010388 0 SECTION LOCAL DEFAULT 11
- 12: 0+10010390 0 SECTION LOCAL DEFAULT 12
- 13: 0+10010270 0 OBJECT LOCAL DEFAULT 9 _DYNAMIC
- 14: 0+10000264 0 NOTYPE GLOBAL DEFAULT 7 func_tab
+#...
15: 0+10010390 4 FUNC GLOBAL DEFAULT 12 my_func
- 16: 0+10010370 0 FUNC GLOBAL DEFAULT 10 _start
- 17: 0+10010390 0 NOTYPE GLOBAL DEFAULT 12 __bss_start
- 18: 0+10010390 0 NOTYPE GLOBAL DEFAULT 11 _edata
- 19: 0+10010398 0 NOTYPE GLOBAL DEFAULT 12 _end
+#pass
.*
0: .*
1: 0+00000000 0 FUNC GLOBAL DEFAULT UND my_func
- 2: 0+10010438 0 NOTYPE GLOBAL DEFAULT 12 __bss_start
- 3: 0+10010438 0 NOTYPE GLOBAL DEFAULT 11 _edata
- 4: 0+10010450 0 NOTYPE GLOBAL DEFAULT 12 _end
+#...
Symbol table '\.symtab' contains 21 entries:
-.*
- 0: .*
- 1: 0+10000158 0 SECTION LOCAL DEFAULT 1
- 2: 0+10000170 0 SECTION LOCAL DEFAULT 2
- 3: 0+10000198 0 SECTION LOCAL DEFAULT 3
- 4: 0+10000210 0 SECTION LOCAL DEFAULT 4
- 5: 0+10000248 0 SECTION LOCAL DEFAULT 5
- 6: 0+10000260 0 SECTION LOCAL DEFAULT 6
- 7: 0+10000278 0 SECTION LOCAL DEFAULT 7
- 8: 0+100002c4 0 SECTION LOCAL DEFAULT 8
- 9: 0+100102c8 0 SECTION LOCAL DEFAULT 9
- 10: 0+10010428 0 SECTION LOCAL DEFAULT 10
- 11: 0+10010430 0 SECTION LOCAL DEFAULT 11
- 12: 0+10010438 0 SECTION LOCAL DEFAULT 12
- 13: 0+100102c8 0 OBJECT LOCAL DEFAULT 9 _DYNAMIC
- 14: 0+10000288 0 NOTYPE LOCAL DEFAULT 7 __glink_PLTresolve
- 15: 0+10010428 0 NOTYPE GLOBAL DEFAULT 10 func_tab
+#...
16: 0+00000000 0 FUNC GLOBAL DEFAULT UND my_func
- 17: 0+10000278 0 NOTYPE GLOBAL DEFAULT 7 _start
- 18: 0+10010438 0 NOTYPE GLOBAL DEFAULT 12 __bss_start
- 19: 0+10010438 0 NOTYPE GLOBAL DEFAULT 11 _edata
- 20: 0+10010450 0 NOTYPE GLOBAL DEFAULT 12 _end
+#pass
.*
0: .*
1: 0+100002b8 0 FUNC GLOBAL DEFAULT UND my_func
- 2: 0+10010408 0 NOTYPE GLOBAL DEFAULT 11 __bss_start
- 3: 0+10010408 0 NOTYPE GLOBAL DEFAULT 10 _edata
- 4: 0+10010420 0 NOTYPE GLOBAL DEFAULT 11 _end
-
+#...
Symbol table '\.symtab' contains 21 entries:
-.*
- 0: .*
- 1: 0+10000158 0 SECTION LOCAL DEFAULT 1
- 2: 0+10000170 0 SECTION LOCAL DEFAULT 2
- 3: 0+10000198 0 SECTION LOCAL DEFAULT 3
- 4: 0+10000210 0 SECTION LOCAL DEFAULT 4
- 5: 0+10000248 0 SECTION LOCAL DEFAULT 5
- 6: 0+10000260 0 SECTION LOCAL DEFAULT 6
- 7: 0+100002c8 0 SECTION LOCAL DEFAULT 7
- 8: 0+100002d0 0 SECTION LOCAL DEFAULT 8
- 9: 0+100102d0 0 SECTION LOCAL DEFAULT 9
- 10: 0+10010400 0 SECTION LOCAL DEFAULT 10
- 11: 0+10010408 0 SECTION LOCAL DEFAULT 11
- 12: 0+100102d0 0 OBJECT LOCAL DEFAULT 9 _DYNAMIC
- 13: 0+100002b8 0 NOTYPE LOCAL DEFAULT 6 00000011\.global_entry\.my_func
- 14: 0+10000270 0 NOTYPE LOCAL DEFAULT 6 __glink_PLTresolve
- 15: 0+100002c8 0 NOTYPE GLOBAL DEFAULT 7 func_tab
+#...
16: 0+100002b8 0 FUNC GLOBAL DEFAULT UND my_func
- 17: 0+10000260 0 NOTYPE GLOBAL DEFAULT 6 _start
- 18: 0+10010408 0 NOTYPE GLOBAL DEFAULT 11 __bss_start
- 19: 0+10010408 0 NOTYPE GLOBAL DEFAULT 10 _edata
- 20: 0+10010420 0 NOTYPE GLOBAL DEFAULT 11 _end
+#pass
0+100000e0 <_start>:
.*: (02 10 40 3c|3c 40 10 02) lis r2,4098
-.*: (40 81 42 38|38 42 81 40) addi r2,r2,-32448
+.*: (38 81 42 38|38 42 81 38) addi r2,r2,-32456
.*: (a6 02 08 7c|7c 08 02 a6) mflr r0
.*: (e1 ff 21 f8|f8 21 ff e1) stdu r1,-32\(r1\)
.*: (30 00 01 f8|f8 01 00 30) std r0,48\(r1\)
Disassembly of section \.text:
-0+300 <.*\.plt_call\.f4>:
+0+320 <.*\.plt_call\.f4>:
.*: (18 00 41 f8|f8 41 00 18) std r2,24\(r1\)
.*: (38 80 82 e9|e9 82 80 38) ld r12,-32712\(r2\)
.*: (a6 03 89 7d|7d 89 03 a6) mtctr r12
.*: (20 04 80 4e|4e 80 04 20) bctr
-0+310 <.*\.plt_call\.f3>:
+0+330 <.*\.plt_call\.f3>:
.*: (18 00 41 f8|f8 41 00 18) std r2,24\(r1\)
.*: (28 80 82 e9|e9 82 80 28) ld r12,-32728\(r2\)
.*: (a6 03 89 7d|7d 89 03 a6) mtctr r12
.*: (20 04 80 4e|4e 80 04 20) bctr
-0+320 <.*\.plt_call\.f2>:
+0+340 <.*\.plt_call\.f2>:
.*: (18 00 41 f8|f8 41 00 18) std r2,24\(r1\)
.*: (30 80 82 e9|e9 82 80 30) ld r12,-32720\(r2\)
.*: (a6 03 89 7d|7d 89 03 a6) mtctr r12
.*: (20 04 80 4e|4e 80 04 20) bctr
-0+330 <.*\.plt_call\.f1>:
+0+350 <.*\.plt_call\.f1>:
.*: (18 00 41 f8|f8 41 00 18) std r2,24\(r1\)
.*: (40 80 82 e9|e9 82 80 40) ld r12,-32704\(r2\)
.*: (a6 03 89 7d|7d 89 03 a6) mtctr r12
.*: (20 04 80 4e|4e 80 04 20) bctr
-0+340 <f1>:
+0+360 <f1>:
.*: (02 00 4c 3c|3c 4c 00 02) addis r2,r12,2
-.*: (e0 81 42 38|38 42 81 e0) addi r2,r2,-32288
+.*: (d8 81 42 38|38 42 81 d8) addi r2,r2,-32296
.*: (a6 02 08 7c|7c 08 02 a6) mflr r0
.*: (e1 ff 21 f8|f8 21 ff e1) stdu r1,-32\(r1\)
.*: (30 00 01 f8|f8 01 00 30) std r0,48\(r1\)
.*: (20 00 21 38|38 21 00 20) addi r1,r1,32
.*: (a6 03 08 7c|7c 08 03 a6) mtlr r0
.*: (20 00 80 4e|4e 80 00 20) blr
-.*: (a0 01 01 00|00 00 00 00) .*
-.*: (00 00 00 00|00 01 01 a0) .*
+.*: (98 01 01 00|00 00 00 00) .*
+.*: (00 00 00 00|00 01 01 98) .*
-0+390 <__glink_PLTresolve>:
+0+3b0 <__glink_PLTresolve>:
.*: (a6 02 08 7c|7c 08 02 a6) mflr r0
.*: (05 00 9f 42|42 9f 00 05) bcl .*
.*: (a6 02 68 7d|7d 68 02 a6) mflr r11
.* TLS +GLOBAL +DEFAULT +9 ld2
.* NOTYPE +GLOBAL +DEFAULT +13 __bss_start
.* FUNC +GLOBAL +DEFAULT +UND __tls_get_addr_opt
-.* NOTYPE +GLOBAL +DEFAULT +12 _edata
+.* NOTYPE +GLOBAL +DEFAULT +13 _edata
.* NOTYPE +GLOBAL +DEFAULT +13 _end
Symbol table '\.symtab' contains [0-9]+ entries:
.* TLS +GLOBAL +DEFAULT +9 ld1
.* NOTYPE +GLOBAL +DEFAULT +13 __bss_start
.* FUNC +GLOBAL +DEFAULT +UND __tls_get_addr_opt
-.* NOTYPE +GLOBAL +DEFAULT +12 _edata
+.* NOTYPE +GLOBAL +DEFAULT +13 _edata
.* NOTYPE +GLOBAL +DEFAULT +13 _end
.* TLS +GLOBAL +DEFAULT +9 gd0
.* TLS +GLOBAL +DEFAULT +9 ie0
.* TLS +GLOBAL +DEFAULT +UND ld
.* NOTYPE +GLOBAL +DEFAULT +13 __bss_start
.* FUNC +GLOBAL +DEFAULT +UND __tls_get_addr_opt
-.* NOTYPE +GLOBAL +DEFAULT +12 _edata
+.* NOTYPE +GLOBAL +DEFAULT +13 _edata
.* NOTYPE +GLOBAL +DEFAULT +13 _end
Symbol table '\.symtab' contains [0-9]+ entries:
.* TLS +GLOBAL +DEFAULT +9 ld1
.* NOTYPE +GLOBAL +DEFAULT +13 __bss_start
.* FUNC +GLOBAL +DEFAULT +UND __tls_get_addr_opt
-.* NOTYPE +GLOBAL +DEFAULT +12 _edata
+.* NOTYPE +GLOBAL +DEFAULT +13 _edata
.* NOTYPE +GLOBAL +DEFAULT +13 _end
.* TLS +GLOBAL +DEFAULT +9 gd0
.* TLS +GLOBAL +DEFAULT +9 ie0
.* TLS +GLOBAL +DEFAULT +8 ld2
.* TLS +GLOBAL +DEFAULT +8 ld1
.* NOTYPE +GLOBAL +DEFAULT +12 __bss_start
-.* NOTYPE +GLOBAL +DEFAULT +11 _edata
+.* NOTYPE +GLOBAL +DEFAULT +12 _edata
.* NOTYPE +GLOBAL +DEFAULT +12 _end
.* TLS +GLOBAL +DEFAULT +8 gd0
.* TLS +GLOBAL +DEFAULT +8 ie0
.* TLS +GLOBAL +DEFAULT +8 ld2
.* TLS +GLOBAL +DEFAULT +8 ld1
.* NOTYPE +GLOBAL +DEFAULT +12 __bss_start
-.* NOTYPE +GLOBAL +DEFAULT +11 _edata
+.* NOTYPE +GLOBAL +DEFAULT +12 _edata
.* NOTYPE +GLOBAL +DEFAULT +12 _end
.* TLS +GLOBAL +DEFAULT +8 gd0
.* TLS +GLOBAL +DEFAULT +8 ie0
.* TLS +GLOBAL +DEFAULT +8 ld2
.* TLS +GLOBAL +DEFAULT +8 ld1
.* NOTYPE +GLOBAL +DEFAULT +12 __bss_start
-.* NOTYPE +GLOBAL +DEFAULT +11 _edata
+.* NOTYPE +GLOBAL +DEFAULT +12 _edata
.* NOTYPE +GLOBAL +DEFAULT +12 _end
.* TLS +GLOBAL +DEFAULT +8 gd0
.* TLS +GLOBAL +DEFAULT +8 ie0
.* TLS +GLOBAL +DEFAULT +8 ld2
.* TLS +GLOBAL +DEFAULT +8 ld1
.* NOTYPE +GLOBAL +DEFAULT +12 __bss_start
-.* NOTYPE +GLOBAL +DEFAULT +11 _edata
+.* NOTYPE +GLOBAL +DEFAULT +12 _edata
.* NOTYPE +GLOBAL +DEFAULT +12 _end
.* TLS +GLOBAL +DEFAULT +8 gd0
.* TLS +GLOBAL +DEFAULT +8 ie0