* ld-powerpc/tocopt4.d: New test.
* ld-powerpc/powerpc.exp: Run it.
+2011-08-22 Alan Modra <amodra@gmail.com>
+
+ * ld-powerpc/tocopt4a.s, * ld-powerpc/tocopt4b.s,
+ * ld-powerpc/tocopt4.d: New test.
+ * ld-powerpc/powerpc.exp: Run it.
+
2011-08-12 H.J. Lu <hongjiu.lu@intel.com>
PR ld/13082
{{ld tocopt2.out} {objdump -s tocopt2.d}} "tocopt2"}
{"TOC opt3" "-melf64ppc -no-keep-memory --defsym x=2" "-a64" {tocopt3.s}
{{objdump -s tocopt3.d}} "tocopt3"}
+ {"TOC opt4" "-melf64ppc -no-keep-memory --defsym x=2" "-a64"
+ {tocopt4a.s tocopt4b.s} {{objdump -s tocopt4.d}} "tocopt4"}
}
--- /dev/null
+
+.*: file format .*
+
+Contents of section \.text:
+ 100000b0 e9298000 .*
+Contents of section \.got:
+ 100100b8 00000000 00000002 .*
--- /dev/null
+ .globl _start
+ .text
+_start:
+ ld 9,xt@toc(9)
--- /dev/null
+ .section .toc,"aw"
+ .globl xt
+xt:
+ .quad x
+#
+# This testcase will fail with a warning "xt defined on removed toc entry"
+# if a large-toc access like the following is added to this file, because
+# toc analysis only considers toc accesses from the current object file.
+# The small-toc access from tocopt4a.s doesn't cause xt entry to be marked
+# !can_optimize. The testcase only passes because toc analysis considers
+# *no* access from the current file as being sufficiently unusual to
+# warrant keeping the toc entry. So, if you use global symbols on toc
+# entries, don't mix code models.
+#
+# .text
+# addis 9,2,xt@toc@ha
+# ld 9,xt@toc@l(9)