diff options
author | Ben Cheng <bccheng@google.com> | 2014-03-26 11:03:35 -0700 |
---|---|---|
committer | Ben Cheng <bccheng@google.com> | 2014-03-26 11:03:35 -0700 |
commit | 09797ba54abf3683ea66eedddf6afbe7653f9cb9 (patch) | |
tree | 8030b2ed79c7463c89d6da294782e9d503c84f50 /binutils-2.24/ld/testsuite/ld-powerpc | |
parent | 5a2caf34e4995860baf405552163df288000b7bf (diff) | |
download | toolchain_binutils-09797ba54abf3683ea66eedddf6afbe7653f9cb9.zip toolchain_binutils-09797ba54abf3683ea66eedddf6afbe7653f9cb9.tar.gz toolchain_binutils-09797ba54abf3683ea66eedddf6afbe7653f9cb9.tar.bz2 |
Initial checkin of binutils 2.24.
Change-Id: I0dfcbae6608dded6c3586bf5f4ac27e9612e70a2
Diffstat (limited to 'binutils-2.24/ld/testsuite/ld-powerpc')
286 files changed, 6540 insertions, 0 deletions
diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-branch-1.dd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-branch-1.dd new file mode 100644 index 0000000..6bfd136 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-branch-1.dd @@ -0,0 +1,14 @@ + +.* + + +Disassembly of section \.text: + +0*10000000 <foo>: + *10000000:.* bla * 144d000 <.*> + *10000004:.* l(wz|) * r1,80\(r1\) + *10000008:.* bla * 1451000 <.*> + *1000000c:.* (oril * r0,r0,0|nop) + *10000010:.* bla * 1452800 <.*> + *10000014:.* (oril * r0,r0,0|nop) + *10000018:.* bla * 1450000 <.*> diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-branch-1.ex b/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-branch-1.ex new file mode 100644 index 0000000..257cc56 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-branch-1.ex @@ -0,0 +1 @@ +foo diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-branch-1.im b/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-branch-1.im new file mode 100644 index 0000000..0efbfc9 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-branch-1.im @@ -0,0 +1 @@ +bar 0x1450000 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-branch-1.nd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-branch-1.nd new file mode 100644 index 0000000..6c5022a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-branch-1.nd @@ -0,0 +1,3 @@ +0*01450000 C bar +0*10000000 t foo +0*10000000 T foo diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-branch-1.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-branch-1.s new file mode 100644 index 0000000..82c322f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-branch-1.s @@ -0,0 +1,14 @@ + .globl foo + .csect foo[PR] +foo: + bl bar - 0x3000 + lwz 1,80(1) + bl bar + 0x1000 + .ifeq size - 32 + lwz 2,20(1) + .else + ld 2,40(1) + .endif + bl bar + 0x2800 + nop + bl bar diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-reloc-1.ex b/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-reloc-1.ex new file mode 100644 index 0000000..257cc56 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-reloc-1.ex @@ -0,0 +1 @@ +foo diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-reloc-1.im b/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-reloc-1.im new file mode 100644 index 0000000..66f78a4 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-reloc-1.im @@ -0,0 +1 @@ +bar 0xdeadbeef diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-reloc-1.nd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-reloc-1.nd new file mode 100644 index 0000000..003c796 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-reloc-1.nd @@ -0,0 +1,3 @@ +0*deadbeef C bar +0*10000000 d foo +0*10000000 D foo diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-reloc-1.od b/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-reloc-1.od new file mode 100644 index 0000000..db65b4b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-reloc-1.od @@ -0,0 +1,7 @@ + +.* + +DYNAMIC RELOCATION RECORDS \(none\) + +Contents of section \.data: + 10000000 deadbeef .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-reloc-1.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-reloc-1.s new file mode 100644 index 0000000..5eb3980 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-abs-reloc-1.s @@ -0,0 +1,4 @@ + .globl foo + .csect foo[RW] +foo: + .long bar diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-1.ex b/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-1.ex new file mode 100644 index 0000000..257cc56 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-1.ex @@ -0,0 +1 @@ +foo diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-1.hd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-1.hd new file mode 100644 index 0000000..8d81e50 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-1.hd @@ -0,0 +1,11 @@ +#... +Sections: +.* + * 0 * \.text * 0+8 .* + * CONTENTS, ALLOC, LOAD, CODE + * 1 * \.data * 0+0 .* + * ALLOC, LOAD, DATA + * 2 * \.bss * 0+0 .* + * ALLOC + * 3 * \.loader .* + * CONTENTS, LOAD diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-1.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-1.s new file mode 100644 index 0000000..edb4669 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-1.s @@ -0,0 +1,5 @@ + .globl foo + .csect foo[RO] +foo: + .long 0x12345678 + .long 0xdeadbeef diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-2.ex b/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-2.ex new file mode 100644 index 0000000..257cc56 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-2.ex @@ -0,0 +1 @@ +foo diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-2.hd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-2.hd new file mode 100644 index 0000000..1152013 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-2.hd @@ -0,0 +1,11 @@ +#... +Sections: +.* + * 0 * \.text * 0+0 .* + * ALLOC, LOAD, CODE + * 1 * \.data * 0+8 .* + * CONTENTS, ALLOC, LOAD, DATA + * 2 * \.bss * 0+0 .* + * ALLOC + * 3 * \.loader .* + * CONTENTS, LOAD diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-2.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-2.s new file mode 100644 index 0000000..357796e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-2.s @@ -0,0 +1,5 @@ + .globl foo + .csect foo[RW] +foo: + .long 0x12345678 + .long 0xdeadbeef diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-3.ex b/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-3.ex new file mode 100644 index 0000000..257cc56 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-3.ex @@ -0,0 +1 @@ +foo diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-3.hd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-3.hd new file mode 100644 index 0000000..61a93ae --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-3.hd @@ -0,0 +1,11 @@ +#... +Sections: +.* + * 0 * \.text * 0+0 .* + * ALLOC, LOAD, CODE + * 1 * \.data * 0+0 .* + * ALLOC, LOAD, DATA + * 2 * \.bss * 0+8 .* + * ALLOC + * 3 * \.loader .* + * CONTENTS, LOAD diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-3.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-3.s new file mode 100644 index 0000000..df5293f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-core-sec-3.s @@ -0,0 +1 @@ + .comm foo,8 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-export-1-all.dd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-export-1-all.dd new file mode 100644 index 0000000..90eec95 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-export-1-all.dd @@ -0,0 +1,11 @@ + +.* + + +Disassembly of section \.data: + +0*10000000 <main1>: + *10000000: 10 00 00 04 .* + +0*10000004 <lib1>: + *10000004: 11 11 00 01 .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-export-1-full.dd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-export-1-full.dd new file mode 100644 index 0000000..d300fa2 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-export-1-full.dd @@ -0,0 +1,21 @@ + +.* + + +Disassembly of section .data: + +0*10000000 <main1>: + *10000000: 10 00 00 08 .* + +0*10000004 <_main2>: + *10000004: 10 00 00 0c .* + +0*10000008 <lib1>: + *10000008: 11 11 00 01 .* + +0*1000000c <_lib2>: + *1000000c: 11 11 00 02 .* + +0*10000010 <lib3>: + *10000010: 11 11 00 03 .* + *10000014: 00 00 00 00 .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-export-1a.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-export-1a.s new file mode 100644 index 0000000..69701e5 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-export-1a.s @@ -0,0 +1,14 @@ + .globl lib1 + .csect lib1[RW] +lib1: + .long 0x11110001 + + .globl _lib2 + .csect _lib2[RW] +_lib2: + .long 0x11110002 + + .globl lib3 + .csect lib3[RW] +lib3: + .long 0x11110003 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-export-1b.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-export-1b.s new file mode 100644 index 0000000..32c355d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-export-1b.s @@ -0,0 +1,9 @@ + .globl main1 + .csect main1[RW] +main1: + .long lib1 + + .globl _main2 + .csect _main2[RW] +_main2: + .long _lib2 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-export-2.nd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-export-2.nd new file mode 100644 index 0000000..6f97433 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-export-2.nd @@ -0,0 +1 @@ +0*10000000 B x diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-export-2.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-export-2.s new file mode 100644 index 0000000..f720635 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-export-2.s @@ -0,0 +1 @@ + .comm x,4 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-gc-1-32.dd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-gc-1-32.dd new file mode 100644 index 0000000..324b298 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-gc-1-32.dd @@ -0,0 +1,67 @@ + +.* + + +Disassembly of section \.text: + +10000000 <\.init_function>: +10000000: 80 22 00 00 l r1,0\(r2\) + +10000004 <\.fini_function>: +10000004: 80 22 00 04 l r1,4\(r2\) + +10000008 <\.exported_global>: +10000008: 48 00 00 09 bl 10000010 <\.indirect2> + +1000000c <\.indirect1>: +1000000c: 81 08 00 04 l r8,4\(r8\) + +10000010 <\.indirect2>: +10000010: 81 08 00 08 l r8,8\(r8\) + +10000014 <\.indirect3>: +10000014: 81 08 00 0c l r8,12\(r8\) + +Disassembly of section \.data: + +20000000 <block>: +# Pointer to indirect3. +20000000: 20 00 00 98 .* +20000004: 11 22 33 44 .* + +20000008 <__rtinit>: +#... + +20000068 <exported_global>: +20000068: 10 00 00 08 .* +2000006c: 20 00 00 a4 .* +20000070: 00 00 00 00 .* + +20000074 <init_function>: +20000074: 10 00 00 00 .* +20000078: 20 00 00 a4 .* +2000007c: 00 00 00 00 .* + +20000080 <indirect1>: +20000080: 10 00 00 0c .* +20000084: 20 00 00 a4 .* +20000088: 00 00 00 00 .* + +2000008c <fini_function>: +2000008c: 10 00 00 04 .* +20000090: 20 00 00 a4 .* +20000094: 00 00 00 00 .* + +20000098 <indirect3>: +20000098: 10 00 00 14 .* +2000009c: 20 00 00 a4 .* +200000a0: 00 00 00 00 .* + +200000a4 <TOC>: +# TOC entry for indirect1. +200000a4: 20 00 00 80 .* + +200000a8 <block>: +# TOC entry for block. +200000a8: 20 00 00 00 .* +200000ac: 00 00 00 00 .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-gc-1-64.dd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-gc-1-64.dd new file mode 100644 index 0000000..00e9a88 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-gc-1-64.dd @@ -0,0 +1,81 @@ + +.* + + +Disassembly of section \.text: + +0000000010000000 <\.init_function>: + 10000000: e8 22 00 00 ld r1,0\(r2\) + +0000000010000004 <\.fini_function>: + 10000004: e8 22 00 08 ld r1,8\(r2\) + +0000000010000008 <\.exported_global>: + 10000008: 48 00 00 09 bl 10000010 <\.indirect2> + +000000001000000c <\.indirect1>: + 1000000c: 81 08 00 04 lwz r8,4\(r8\) + +0000000010000010 <\.indirect2>: + 10000010: 81 08 00 08 lwz r8,8\(r8\) + +0000000010000014 <\.indirect3>: + 10000014: 81 08 00 0c lwz r8,12\(r8\) + +Disassembly of section \.data: + +0000000020000000 <block>: +# Pointer to indirect3. + 20000000: 20 00 00 e0 .* + 20000004: 11 22 33 44 .* + +0000000020000008 <__rtinit>: +#... + +0000000020000080 <exported_global>: + 20000080: 00 00 00 00 .* + 20000084: 10 00 00 08 .* + 20000088: 00 00 00 00 .* + 2000008c: 20 00 00 f8 .* + 20000090: 00 00 00 00 .* + 20000094: 00 00 00 00 .* + +0000000020000098 <init_function>: + 20000098: 00 00 00 00 .* + 2000009c: 10 00 00 00 .* + 200000a0: 00 00 00 00 .* + 200000a4: 20 00 00 f8 .* + 200000a8: 00 00 00 00 .* + 200000ac: 00 00 00 00 .* + +00000000200000b0 <indirect1>: + 200000b0: 00 00 00 00 .* + 200000b4: 10 00 00 0c .* + 200000b8: 00 00 00 00 .* + 200000bc: 20 00 00 f8 .* + 200000c0: 00 00 00 00 .* + 200000c4: 00 00 00 00 .* + +00000000200000c8 <fini_function>: + 200000c8: 00 00 00 00 .* + 200000cc: 10 00 00 04 .* + 200000d0: 00 00 00 00 .* + 200000d4: 20 00 00 f8 .* + 200000d8: 00 00 00 00 .* + 200000dc: 00 00 00 00 .* + +00000000200000e0 <indirect3>: + 200000e0: 00 00 00 00 .* + 200000e4: 10 00 00 14 .* + 200000e8: 00 00 00 00 .* + 200000ec: 20 00 00 f8 .* + 200000f0: 00 00 00 00 .* + 200000f4: 00 00 00 00 .* + +00000000200000f8 <TOC>: + 200000f8: 00 00 00 00 .* + 200000fc: 20 00 00 b0 .* + +0000000020000100 <block>: + 20000100: 00 00 00 00 .* + 20000104: 20 00 00 00 .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-gc-1.ex b/binutils-2.24/ld/testsuite/ld-powerpc/aix-gc-1.ex new file mode 100644 index 0000000..c7a82ec --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-gc-1.ex @@ -0,0 +1 @@ +exported_global diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-gc-1.nd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-gc-1.nd new file mode 100644 index 0000000..f399646 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-gc-1.nd @@ -0,0 +1,3 @@ +#... +0*20000008 d __rtinit +#pass diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-gc-1.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-gc-1.s new file mode 100644 index 0000000..821fd5c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-gc-1.s @@ -0,0 +1,55 @@ + .macro loadtoc,sym + .if size == 32 + lwz 1,\sym(2) + .else + ld 1,\sym(2) + .endif + .endm + + .toc +LC01: .tc indirect1[TC],indirect1[RW] +LC02: .tc block[TC],block[RW] + + .csect .unused_local[PR] +.unused_local: + bl .unused_global + + .globl .init_function + .csect .init_function[PR] +.init_function: + loadtoc LC01 + + .globl .fini_function + .csect .fini_function[PR] +.fini_function: + loadtoc LC02 + + .globl .unused_global + .csect .unused_global[PR] +.unused_global: + bl .unused_local + + .globl .exported_global + .csect .exported_global[PR] +.exported_global: + bl .indirect2 + + .globl .indirect1 + .csect .indirect1[PR] +.indirect1: + lwz 8,4(8) + + .csect .indirect2[PR] +.indirect2: + lwz 8,8(8) + + .globl .indirect3 + .csect .indirect3[PR] +.indirect3: + lwz 8,12(8) + + .globl block + .csect block[RW] +block: + .long indirect3 + .long 0x11223344 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-1-32.d b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-1-32.d new file mode 100644 index 0000000..129845f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-1-32.d @@ -0,0 +1,5 @@ +#name: Glink test 1 (error) (32-bit) +#source: aix-glink-1.s +#as: -a32 +#ld: -b32 -bM:SRE -bnogc +#error: undefined reference to `\.ext' diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-1-32.dd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-1-32.dd new file mode 100644 index 0000000..33cf812 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-1-32.dd @@ -0,0 +1,44 @@ + +.* + + +Disassembly of section \.text: + +10000000 <\.f1>: +10000000: 4e 80 00 20 br + +10000004 <\.f2>: +10000004: 48 00 00 05 bl 10000008 <\.f3> + +10000008 <\.f3>: +10000008: 4e 80 00 20 br + +1000000c <\.ext>: +1000000c: 81 82 00 00 l r12,0\(r2\) +10000010: 90 41 00 14 st r2,20\(r1\) +10000014: 80 0c 00 00 l r0,0\(r12\) +10000018: 80 4c 00 04 l r2,4\(r12\) +1000001c: 7c 09 03 a6 mtctr r0 +10000020: 4e 80 04 20 bctr +10000024: 00 00 00 00 \.long 0x0 +10000028: 00 0c 80 00 \.long 0xc8000 +1000002c: 00 00 00 00 \.long 0x0 + +Disassembly of section \.data: + +20000000 <foo>: +20000000: 20 00 00 08 .* +20000004: 10 00 00 0c .* + +20000008 <f1>: +20000008: 10 00 00 00 .* +2000000c: 20 00 00 20 .* +20000010: 00 00 00 00 .* + +20000014 <f2>: +20000014: 10 00 00 04 .* +20000018: 20 00 00 20 .* +2000001c: 00 00 00 00 .* + +20000020 <TOC>: + \.\.\. diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-1-64.d b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-1-64.d new file mode 100644 index 0000000..b8ee35f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-1-64.d @@ -0,0 +1,5 @@ +#name: Glink test 1 (error) (64-bit) +#source: aix-glink-1.s +#as: -a64 +#ld: -b64 -bM:SRE -bnogc +#error: undefined reference to `\.ext' diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-1-64.dd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-1-64.dd new file mode 100644 index 0000000..b5a557c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-1-64.dd @@ -0,0 +1,49 @@ + +.* + + +Disassembly of section \.text: + +0000000010000000 <\.f1>: + 10000000: 4e 80 00 20 blr + +0000000010000004 <\.f2>: + 10000004: 48 00 00 05 bl 10000008 <\.f3> + +0000000010000008 <\.f3>: + 10000008: 4e 80 00 20 blr + +000000001000000c <\.ext>: + 1000000c: e9 82 00 00 ld r12,0\(r2\) + 10000010: f8 41 00 28 std r2,40\(r1\) + 10000014: e8 0c 00 00 ld r0,0\(r12\) + 10000018: e8 4c 00 08 ld r2,8\(r12\) + 1000001c: 7c 09 03 a6 mtctr r0 + 10000020: 4e 80 04 20 bctr + 10000024: 00 00 00 00 \.long 0x0 + 10000028: 00 0c a0 00 \.long 0xca000 + 1000002c: 00 00 00 00 \.long 0x0 + 10000030: 00 00 00 18 \.long 0x18 + +Disassembly of section \.data: + +0000000020000000 <foo>: + 20000000: 20 00 00 08 .* + 20000004: 10 00 00 0c .* + +0000000020000008 <f1>: + 20000008: 00 00 00 00 .* + 2000000c: 10 00 00 00 .* + 20000010: 00 00 00 00 .* + 20000014: 20 00 00 38 .* + \.\.\. + +0000000020000020 <f2>: + 20000020: 00 00 00 00 .* + 20000024: 10 00 00 04 .* + 20000028: 00 00 00 00 .* + 2000002c: 20 00 00 38 .* + \.\.\. + +0000000020000038 <TOC>: + \.\.\. diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-1.ex b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-1.ex new file mode 100644 index 0000000..643cdf3 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-1.ex @@ -0,0 +1,2 @@ +f2 +foo diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-1.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-1.s new file mode 100644 index 0000000..f7901b2 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-1.s @@ -0,0 +1,21 @@ + .toc + .globl .f1 + .csect .f1[PR] +.f1: + blr + + .globl .f2 + .csect .f2[PR] +.f2: + bl .f3 + + .globl .f3 + .csect .f3[PR] +.f3: + blr + + .globl foo + .csect foo[RW] +foo: + .long f1 + .long .ext diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-2-32.dd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-2-32.dd new file mode 100644 index 0000000..2c91d23 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-2-32.dd @@ -0,0 +1,69 @@ + +tmpdir/aix-glink-2: file format aixcoff-rs6000 + + +Disassembly of section \.text: + +10000000 <\.b1>: +10000000: 60 00 00 00 oril r0,r0,0 + +10000004 <\.b2>: +10000004: 60 00 00 00 oril r0,r0,0 + +10000008 <\.b3>: +10000008: 60 00 00 00 oril r0,r0,0 + +1000000c <\.main>: +1000000c: 48 00 f1 03 bla f100 <.*> +10000010: 48 00 00 21 bl 10000030 <\.a2> +10000014: 48 00 00 41 bl 10000054 <\.a3> +10000018: 4b ff ff e9 bl 10000000 <\.b1> +1000001c: 4b ff ff e9 bl 10000004 <\.b2> +10000020: 4b ff ff e9 bl 10000008 <\.b3> +10000024: 48 00 f5 03 bla f500 <.*> +10000028: 48 00 00 51 bl 10000078 <\.c2> +1000002c: 48 00 00 71 bl 1000009c <\.c3> + +10000030 <\.a2>: +10000030: 81 82 00 00 l r12,0\(r2\) +10000034: 90 41 00 14 st r2,20\(r1\) +10000038: 80 0c 00 00 l r0,0\(r12\) +1000003c: 80 4c 00 04 l r2,4\(r12\) +10000040: 7c 09 03 a6 mtctr r0 +10000044: 4e 80 04 20 bctr +10000048: 00 00 00 00 \.long 0x0 +1000004c: 00 0c 80 00 \.long 0xc8000 +10000050: 00 00 00 00 \.long 0x0 + +10000054 <\.a3>: +10000054: 81 82 00 04 l r12,4\(r2\) +10000058: 90 41 00 14 st r2,20\(r1\) +1000005c: 80 0c 00 00 l r0,0\(r12\) +10000060: 80 4c 00 04 l r2,4\(r12\) +10000064: 7c 09 03 a6 mtctr r0 +10000068: 4e 80 04 20 bctr +1000006c: 00 00 00 00 \.long 0x0 +10000070: 00 0c 80 00 \.long 0xc8000 +10000074: 00 00 00 00 \.long 0x0 + +10000078 <\.c2>: +10000078: 81 82 00 08 l r12,8\(r2\) +1000007c: 90 41 00 14 st r2,20\(r1\) +10000080: 80 0c 00 00 l r0,0\(r12\) +10000084: 80 4c 00 04 l r2,4\(r12\) +10000088: 7c 09 03 a6 mtctr r0 +1000008c: 4e 80 04 20 bctr +10000090: 00 00 00 00 \.long 0x0 +10000094: 00 0c 80 00 \.long 0xc8000 +10000098: 00 00 00 00 \.long 0x0 + +1000009c <\.c3>: +1000009c: 81 82 00 0c l r12,12\(r2\) +100000a0: 90 41 00 14 st r2,20\(r1\) +100000a4: 80 0c 00 00 l r0,0\(r12\) +100000a8: 80 4c 00 04 l r2,4\(r12\) +100000ac: 7c 09 03 a6 mtctr r0 +100000b0: 4e 80 04 20 bctr +100000b4: 00 00 00 00 \.long 0x0 +100000b8: 00 0c 80 00 \.long 0xc8000 +100000bc: 00 00 00 00 \.long 0x0 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-2-64.dd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-2-64.dd new file mode 100644 index 0000000..5a34f0a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-2-64.dd @@ -0,0 +1,73 @@ + +tmpdir/aix64-glink-2: file format aix5coff64-rs6000 + + +Disassembly of section \.text: + +0000000010000000 <\.b1>: + 10000000: 60 00 00 00 nop + +0000000010000004 <\.b2>: + 10000004: 60 00 00 00 nop + +0000000010000008 <\.b3>: + 10000008: 60 00 00 00 nop + +000000001000000c <\.main>: + 1000000c: 48 00 f1 03 bla f100 <.*> + 10000010: 48 00 00 21 bl 10000030 <\.a2> + 10000014: 48 00 00 45 bl 10000058 <\.a3> + 10000018: 4b ff ff e9 bl 10000000 <\.b1> + 1000001c: 4b ff ff e9 bl 10000004 <\.b2> + 10000020: 4b ff ff e9 bl 10000008 <\.b3> + 10000024: 48 00 f5 03 bla f500 <.*> + 10000028: 48 00 00 59 bl 10000080 <\.c2> + 1000002c: 48 00 00 7d bl 100000a8 <\.c3> + +0000000010000030 <\.a2>: + 10000030: e9 82 00 00 ld r12,0\(r2\) + 10000034: f8 41 00 28 std r2,40\(r1\) + 10000038: e8 0c 00 00 ld r0,0\(r12\) + 1000003c: e8 4c 00 08 ld r2,8\(r12\) + 10000040: 7c 09 03 a6 mtctr r0 + 10000044: 4e 80 04 20 bctr + 10000048: 00 00 00 00 \.long 0x0 + 1000004c: 00 0c a0 00 \.long 0xca000 + 10000050: 00 00 00 00 \.long 0x0 + 10000054: 00 00 00 18 \.long 0x18 + +0000000010000058 <\.a3>: + 10000058: e9 82 00 08 ld r12,8\(r2\) + 1000005c: f8 41 00 28 std r2,40\(r1\) + 10000060: e8 0c 00 00 ld r0,0\(r12\) + 10000064: e8 4c 00 08 ld r2,8\(r12\) + 10000068: 7c 09 03 a6 mtctr r0 + 1000006c: 4e 80 04 20 bctr + 10000070: 00 00 00 00 \.long 0x0 + 10000074: 00 0c a0 00 \.long 0xca000 + 10000078: 00 00 00 00 \.long 0x0 + 1000007c: 00 00 00 18 \.long 0x18 + +0000000010000080 <\.c2>: + 10000080: e9 82 00 10 ld r12,16\(r2\) + 10000084: f8 41 00 28 std r2,40\(r1\) + 10000088: e8 0c 00 00 ld r0,0\(r12\) + 1000008c: e8 4c 00 08 ld r2,8\(r12\) + 10000090: 7c 09 03 a6 mtctr r0 + 10000094: 4e 80 04 20 bctr + 10000098: 00 00 00 00 \.long 0x0 + 1000009c: 00 0c a0 00 \.long 0xca000 + 100000a0: 00 00 00 00 \.long 0x0 + 100000a4: 00 00 00 18 \.long 0x18 + +00000000100000a8 <\.c3>: + 100000a8: e9 82 00 18 ld r12,24\(r2\) + 100000ac: f8 41 00 28 std r2,40\(r1\) + 100000b0: e8 0c 00 00 ld r0,0\(r12\) + 100000b4: e8 4c 00 08 ld r2,8\(r12\) + 100000b8: 7c 09 03 a6 mtctr r0 + 100000bc: 4e 80 04 20 bctr + 100000c0: 00 00 00 00 \.long 0x0 + 100000c4: 00 0c a0 00 \.long 0xca000 + 100000c8: 00 00 00 00 \.long 0x0 + 100000cc: 00 00 00 18 \.long 0x18 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-2a.ex b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-2a.ex new file mode 100644 index 0000000..406cabb --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-2a.ex @@ -0,0 +1,9 @@ +a1 +a2 +a3 +b1 +b2 +b3 +c1 +c2 +c3 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-2a.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-2a.s new file mode 100644 index 0000000..fafbe43 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-2a.s @@ -0,0 +1,41 @@ + .toc + + .macro defabs,type,name,value + \type \name + \name = \value + .endm + + .macro deffun,type,name,fn + \type \name + .csect \name\()[DS] +\name\(): + .if size == 32 + .long .\name\()[PR],TOC[TC0],0 + .else + .llong .\name\()[PR],TOC[TC0],0 + .endif + + .globl .\name + .csect .\name\()[PR] +.\name\(): + nop + .endm + + .macro defdata,type,name,contents + \type \name + .csect \name\()[RW] +\name\(): + .long \contents + .endm + + defabs .globl,a1,0xf100 + deffun .globl,a2 + defdata .globl,a3,0x1100 + + defabs .globl,b1,0xf200 + deffun .globl,b2 + defdata .globl,b3,0x2200 + + defabs .weak,c1,0xf300 + deffun .weak,c2 + defdata .weak,c3,0x3300 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-2b.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-2b.s new file mode 100644 index 0000000..9c06d48 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-2b.s @@ -0,0 +1,12 @@ + .toc + + .macro deffun,type,name + .globl .\name + .csect .\name\()[PR] +.\name\(): + nop + .endm + + deffun .globl,b1 + deffun .globl,b2 + deffun .globl,b3 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-2c.ex b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-2c.ex new file mode 100644 index 0000000..4e16c9b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-2c.ex @@ -0,0 +1,6 @@ +a1 +a2 +a3 +c1 +c2 +c3 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-2c.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-2c.s new file mode 100644 index 0000000..7dd6dad --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-2c.s @@ -0,0 +1,33 @@ + .toc + + .macro defabs,type,name,value + \type \name + \name = \value + .endm + + .macro deffun,type,name + \type \name + .csect \name\()[DS] +\name\(): + .long \name\()[PR],TOC[TC0],0 + + .globl .\name + .csect .\name\()[PR] +.\name\(): + nop + .endm + + .macro defdata,type,name,contents + \type \name + .csect \name\()[RW] +\name\(): + .long \contents + .endm + + defabs .globl,a1,0xf400 + deffun .globl,a2 + defdata .globl,a3,0x4400 + + defabs .globl,c1,0xf500 + deffun .globl,c2 + defdata .globl,c3,0x5500 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-2d.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-2d.s new file mode 100644 index 0000000..ba78609 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-2d.s @@ -0,0 +1,12 @@ + .globl .main + .csect .main[PR] +.main: + bl .a1 + bl .a2 + bl .a3 + bl .b1 + bl .b2 + bl .b3 + bl .c1 + bl .c2 + bl .c3 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-3-32.d b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-3-32.d new file mode 100644 index 0000000..754789f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-3-32.d @@ -0,0 +1,5 @@ +#name: Glink test 3 (error) (32-bit) +#source: aix-glink-3.s +#as: -a32 +#ld: -b32 -bnoautoimp tmpdir/aix-glink-3b.so +#error: undefined reference to `\.g' diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-3-64.d b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-3-64.d new file mode 100644 index 0000000..3ea6817 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-3-64.d @@ -0,0 +1,5 @@ +#name: Glink test 3 (error) (64-bit) +#source: aix-glink-3.s +#as: -a64 +#ld: -b64 -bnoautoimp tmpdir/aix64-glink-3b.so +#error: undefined reference to `\.g' diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-3.dd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-3.dd new file mode 100644 index 0000000..b154936 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-3.dd @@ -0,0 +1,14 @@ + +.* + + +Disassembly of section \.text: + +0*10000000 <\.f>: + *10000000: 48 00 00 05 bl 10000004 <\.g> + +0*10000004 <\.g>: + *10000004: 4e 80 00 20 bl?r + +0*10000008 <__start>: + *10000008: 4b ff ff f9 bl 10000000 <\.f> diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-3.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-3.s new file mode 100644 index 0000000..355dcc6 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-3.s @@ -0,0 +1,5 @@ + .extern .f + .globl __start + .csect __start[PR] +__start: + bl .f diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-3a.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-3a.s new file mode 100644 index 0000000..76aad8c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-3a.s @@ -0,0 +1,10 @@ + .toc + + .globl .g + .csect .g[PR] +.g: + blr + + .globl g + .csect g[DS] +g: .long .g,TOC[tc0],0 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-3b.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-3b.s new file mode 100644 index 0000000..0bedb3b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-glink-3b.s @@ -0,0 +1,11 @@ + .toc + + .extern .g + .globl .f + .csect .f[PR] +.f: + bl .g + + .globl f + .csect f[DS] +f: .long .f,TOC[tc0],0 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-lineno-1.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-lineno-1.s new file mode 100644 index 0000000..196e012 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-lineno-1.s @@ -0,0 +1,25 @@ + .file "tmpdir/aix-lineno-1.txt" + .csect .foo[PR] + .function .foo,.foo +.foo: + .bf 1 + nop + .line 2 + nop + .line 3 + nop + .line 4 + nop + .line 5 + nop + .ef 1 + + .globl .main + .csect .main[PR] + .function .main,.main +.main: + .bf 7 + bl .foo + .line 2 + nop + .ef 7 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-lineno-1.txt b/binutils-2.24/ld/testsuite/ld-powerpc/aix-lineno-1.txt new file mode 100644 index 0000000..0e8dc16 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-lineno-1.txt @@ -0,0 +1,8 @@ +Four +and +twenty +blackbirds +baked +in +a +pie diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-lineno-1a.dd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-lineno-1a.dd new file mode 100644 index 0000000..72410c9 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-lineno-1a.dd @@ -0,0 +1,24 @@ + +.* + + +Disassembly of section \.text: + +0*10000000 <\.foo>: +Four + *10000000: 60 00 00 00 (oril r0,r0,0|nop) +and + *10000004: 60 00 00 00 (oril r0,r0,0|nop) +twenty + *10000008: 60 00 00 00 (oril r0,r0,0|nop) +blackbirds + *1000000c: 60 00 00 00 (oril r0,r0,0|nop) +baked + *10000010: 60 00 00 00 (oril r0,r0,0|nop) + +0*10000014 <\.main>: +in +a + *10000014: 4b ff ff ed bl 10000000 <\.foo> +pie + *10000018: 60 00 00 00 (oril r0,r0,0|nop) diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-lineno-1a.nd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-lineno-1a.nd new file mode 100644 index 0000000..5e84188 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-lineno-1a.nd @@ -0,0 +1,8 @@ +0*10000000 t \.bf +0*10000014 t \.bf +0*10000014 t \.ef +0*1000001c t \.ef +0*10000000 t \.foo +0*10000000 t \.foo +0*10000014 t \.main +0*10000014 T \.main diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-lineno-1b.dd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-lineno-1b.dd new file mode 100644 index 0000000..64c08df --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-lineno-1b.dd @@ -0,0 +1,16 @@ + +.* + + +Disassembly of section \.text: + +0*10000000 <\.foo>: + *10000000: 60 00 00 00 (oril r0,r0,0|nop) + *10000004: 60 00 00 00 (oril r0,r0,0|nop) + *10000008: 60 00 00 00 (oril r0,r0,0|nop) + *1000000c: 60 00 00 00 (oril r0,r0,0|nop) + *10000010: 60 00 00 00 (oril r0,r0,0|nop) + +0*10000014 <\.main>: + *10000014: 4b ff ff ed bl 10000000 <\.foo> + *10000018: 60 00 00 00 (oril r0,r0,0|nop) diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-lineno-1b.nd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-lineno-1b.nd new file mode 100644 index 0000000..d341470 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-lineno-1b.nd @@ -0,0 +1,3 @@ +0*10000000 t \.foo +0*10000014 t \.main +0*10000014 T \.main diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-dso.dnd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-dso.dnd new file mode 100644 index 0000000..1fccdeb --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-dso.dnd @@ -0,0 +1,4 @@ + * U foo +0*10000000 D x +0*10000004 D x1 +0*10000014 D x2 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-dso.drd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-dso.drd new file mode 100644 index 0000000..f262feb --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-dso.drd @@ -0,0 +1,9 @@ + +.* + +DYNAMIC RELOCATION RECORDS +OFFSET * TYPE * VALUE +0*10000004 R_POS(|_32) * \.data +0*10000008 R_POS(|_32) * foo +0*10000014 R_POS(|_32) * \.data +0*10000018 R_POS(|_32) * foo diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-dso.nd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-dso.nd new file mode 100644 index 0000000..be25ff3 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-dso.nd @@ -0,0 +1,8 @@ + * U foo +0*10000000 d x +0*10000000 D x +0*10000010 d x +0*10000004 d x1 +0*10000004 D x1 +0*10000014 d x2 +0*10000014 D x2 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-dso.rd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-dso.rd new file mode 100644 index 0000000..d17151b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-dso.rd @@ -0,0 +1,9 @@ + +.* + +RELOCATION RECORDS FOR \[\.data\]: +OFFSET * TYPE * VALUE +0+04 R_POS(|_32) * x\+0xf*f0000000 +0+08 R_POS(|_32) * foo +0+14 R_POS(|_32) * x\+0xf*effffff0 +0+18 R_POS(|_32) * foo diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-rel.nd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-rel.nd new file mode 100644 index 0000000..e2bdbc4 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-rel.nd @@ -0,0 +1,8 @@ + + U foo +0+00 d x +0+00 D x +0+10 d x +0+04 d x1 +0+04 D x1 +0+14 d x2 +0+14 D x2 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-rel.rd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-rel.rd new file mode 100644 index 0000000..436ad98 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-rel.rd @@ -0,0 +1,9 @@ + +.* + +RELOCATION RECORDS FOR \[\.data\]: +OFFSET * TYPE * VALUE +0+04 R_POS(|_32) * x +0+08 R_POS(|_32) * foo +0+14 R_POS(|_32) * x\+0xf+0 +0+18 R_POS(|_32) * foo diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1.ex b/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1.ex new file mode 100644 index 0000000..8f1fe4d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1.ex @@ -0,0 +1,3 @@ +x +x1 +x2 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1.im b/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1.im new file mode 100644 index 0000000..257cc56 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1.im @@ -0,0 +1 @@ +foo diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1a.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1a.s new file mode 100644 index 0000000..3138670 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1a.s @@ -0,0 +1,9 @@ + .globl x + .csect x[RW] +x: + .long 4 + .globl x1 + .csect x1[RW] +x1: + .long x + .long foo diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1b.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1b.s new file mode 100644 index 0000000..c5fcf38 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-no-dup-syms-1b.s @@ -0,0 +1,9 @@ + .globl x + .csect x[RW] +x: + .long 8 + .globl x2 + .csect x2[RW] +x2: + .long x + .long foo diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-ref-1-32.od b/binutils-2.24/ld/testsuite/ld-powerpc/aix-ref-1-32.od new file mode 100644 index 0000000..1ba90ec --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-ref-1-32.od @@ -0,0 +1,30 @@ + +.* + + +Disassembly of section \.text: + +.* <foo1>: +.*: 60 00 00 00 oril r0,r0,0 + .*: R_REF foo2\+.* +.*: 80 22 00 00 l r1,0\(r2\) + .*: R_TOC stuff\+.* +.*: 4e 80 00 20 br + +.* <foo2>: +.*: 60 00 00 00 oril r0,r0,0 + .*: R_REF foo6\+.* + .*: R_REF foo4\+.* +.*: 80 22 00 00 l r1,0\(r2\) + .*: R_TOC stuff\+.* + +.* <foo4>: +.*: 60 00 00 00 oril r0,r0,0 +.*: 80 22 00 00 l r1,0\(r2\) + .*: R_TOC stuff\+.* + +.* <foo6>: +.*: 60 00 00 00 oril r0,r0,0 +.*: 80 22 00 00 l r1,0\(r2\) + .*: R_TOC stuff\+.* + \.\.\. diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-ref-1-64.od b/binutils-2.24/ld/testsuite/ld-powerpc/aix-ref-1-64.od new file mode 100644 index 0000000..9cc6e9d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-ref-1-64.od @@ -0,0 +1,30 @@ + +.* + + +Disassembly of section \.text: + +.* <foo1>: + .*: 60 00 00 00 nop + .*: R_REF foo2\+.* + .*: e8 22 00 00 ld r1,0\(r2\) + .*: R_TOC stuff\+.* + .*: 4e 80 00 20 blr + +.* <foo2>: + .*: 60 00 00 00 nop + .*: R_REF foo6\+.* + .*: R_REF foo4\+.* + .*: e8 22 00 00 ld r1,0\(r2\) + .*: R_TOC stuff\+.* + +.* <foo4>: + .*: 60 00 00 00 nop + .*: e8 22 00 00 ld r1,0\(r2\) + .*: R_TOC stuff\+.* + +.* <foo6>: + .*: 60 00 00 00 nop + .*: e8 22 00 00 ld r1,0\(r2\) + .*: R_TOC stuff\+.* + \.\.\. diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-ref-1.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-ref-1.s new file mode 100644 index 0000000..33445a6 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-ref-1.s @@ -0,0 +1,57 @@ + .macro loadtoc,sym + .if size == 32 + lwz 1,\sym(2) + .else + ld 1,\sym(2) + .endif + .endm + + .toc +LC01: .tc stuff[TC],stuff[RW] + + .globl foo1 + .csect foo1[pr] +foo1: + .align 8 + nop + loadtoc LC01 + + .globl foo2 + .csect foo2[pr] +foo2: + nop + loadtoc LC01 + .ref foo4 , foo6 + + .globl foo3 + .csect foo3[pr] +foo3: + nop + loadtoc LC01 + + .globl foo4 + .csect foo4[pr] +foo4: + nop + loadtoc LC01 + + .globl foo5 + .csect foo5[pr] +foo5: + nop + loadtoc LC01 + .ref foo3 + + .globl foo6 + .csect foo6[pr] +foo6: + nop + loadtoc LC01 + + .csect foo1[pr] + blr + .ref foo2 + + .csect stuff[rw] +stuff: + .long 1 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-rel-1.od b/binutils-2.24/ld/testsuite/ld-powerpc/aix-rel-1.od new file mode 100644 index 0000000..0d9f2bb --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-rel-1.od @@ -0,0 +1,22 @@ + +.* + +# It doesn't matter whether .text, .bss and .debug are listed, as long as +# they're empty. The important thing is that .loader shouldn't appear +# at all. +Sections: + *Idx Name * Size .* + *0 \.text * 0+0 .* + *ALLOC, LOAD, CODE + *1 \.data * 0+8 .* + *CONTENTS, ALLOC, LOAD, RELOC, DATA + *2 \.bss * 0+0 .* + *ALLOC + *3 \.debug * 0+0 .* + +RELOCATION RECORDS FOR \[\.data\]: +OFFSET * TYPE * VALUE +0+0 R_POS(|_32) * \.puts +0+4 R_POS(|_32) * foobar + + diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-rel-1.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-rel-1.s new file mode 100644 index 0000000..9891ba8 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-rel-1.s @@ -0,0 +1,5 @@ + .globl foo + .csect foo[RW] +foo: + .long .puts + .long foobar diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-toc-1-32.dd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-toc-1-32.dd new file mode 100644 index 0000000..e129d34 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-toc-1-32.dd @@ -0,0 +1,12 @@ + +.* + + +Disassembly of section \.text: + +10000000 <\.f1>: +10000000: 80 22 80 08 l r1,-32760\(r2\) + 10000002: R_TOC sym0.* +#... +1000fff4: 80 22 7f fc l r1,32764\(r2\) + 1000fff6: R_TOC asym8190.* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-toc-1-64.dd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-toc-1-64.dd new file mode 100644 index 0000000..c169ff6 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-toc-1-64.dd @@ -0,0 +1,12 @@ + +.* + + +Disassembly of section \.text: + +0000000010000000 <.f1>: + 10000000: e8 22 80 10 ld r1,-32752\(r2\) + 10000002: R_TOC sym0.* +#... + 10007ff4: e8 22 7f f8 ld r1,32760\(r2\) + 10007ff6: R_TOC asym4094.* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-toc-1.ex b/binutils-2.24/ld/testsuite/ld-powerpc/aix-toc-1.ex new file mode 100644 index 0000000..13a2943 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-toc-1.ex @@ -0,0 +1,2 @@ +f1 +f2 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-toc-1a.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-toc-1a.s new file mode 100644 index 0000000..e67d5d3 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-toc-1a.s @@ -0,0 +1,23 @@ + .macro loadtoc + .toc + .tc sym\@[TC], \@ + + .csect .f1[PR] + .if size == 32 + lwz 1,sym\@[TC](2) + .else + ld 1,sym\@[TC](2) + .endif + .endm + + .globl .f1 + .csect .f1[PR] +.f1: + .rept 0x7ffc * 8 / size + loadtoc + .endr + + .globl f1 + .csect f1[DS] +f1: + .long .f1[PR],TOC[TC0],0 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-toc-1b.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-toc-1b.s new file mode 100644 index 0000000..d4cee8a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-toc-1b.s @@ -0,0 +1,23 @@ + .macro loadtoc + .toc + .tc asym\@[TC], \@ | 0x10000 + + .csect .f2[PR] + .if size == 32 + lwz 1,asym\@[TC](2) + .else + ld 1,asym\@[TC](2) + .endif + .endm + + .globl .f2 + .csect .f2[PR] +.f2: + .rept 0x7ffc * 8 / size + loadtoc + .endr + + .globl f2 + .csect f2[DS] +f2: + .long .f2[PR],TOC[TC0],0 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1-dso.dnd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1-dso.dnd new file mode 100644 index 0000000..3105fa3 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1-dso.dnd @@ -0,0 +1,17 @@ +# Comments are (aix-weak-1a.s type) wins over/loses to (aix-weak-1b.s type) +# (strong common) loses to (strong data) +0*10000010 D a +# (strong common) wins over (weak data) +0*10000020 B b +# (strong data) wins over (strong common) +0*10000000 D c +# (weak data) loses to (strong common) +0*10000028 B d +# (weak common) loses to (strong data) +0*10000018 D e +# (weak common) wins over (weak data) +0*10000024 W f +# (strong data) wins over (weak common) +0*10000008 D g +# (weak data) wins over (weak common) +0*1000000c W h diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1-dso.hd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1-dso.hd new file mode 100644 index 0000000..7368a5a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1-dso.hd @@ -0,0 +1,12 @@ +.* + +Sections: +Idx Name * Size * VMA * LMA * File off *Algn + *0 \.text * 0+00 * 0*10000000 * 0*10000000 * [^ ]+ * 2\*\*2 + *ALLOC, LOAD, CODE + *1 \.data * 0+20 * 0*10000000 * 0*10000000 * [^ ]+ * 2\*\*3 + *CONTENTS, ALLOC, LOAD, DATA +# Should only have 3 three common symbols. + *2 \.bss * 0+0c * 0*10000020 * 0*10000020 * [^ ]+ * 2\*\*3 + *ALLOC +#pass diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1-dso.nd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1-dso.nd new file mode 100644 index 0000000..3289e25 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1-dso.nd @@ -0,0 +1,25 @@ +# Comments are (aix-weak-1a.s type) wins over/loses to (aix-weak-1b.s type) +# (strong common) loses to (strong data) +0*10000010 d a +0*10000010 D a +# (strong common) wins over (weak data) +0*10000020 B b +0*10000014 d b +# (strong data) wins over (strong common) +0*10000000 d c +0*10000000 D c +# (weak data) loses to (strong common) +0*10000004 d d +0*10000028 B d +# (weak common) loses to (strong data) +0*10000018 d e +0*10000018 D e +# (weak common) wins over (weak data) +0*10000024 W f +0*1000001c d f +# (strong data) wins over (weak common) +0*10000008 d g +0*10000008 D g +# (weak data) wins over (weak common) +0*1000000c d h +0*1000000c W h diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1-gcdso.dnd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1-gcdso.dnd new file mode 100644 index 0000000..ba82e27 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1-gcdso.dnd @@ -0,0 +1,17 @@ +# Comments are (aix-weak-1a.s type) wins over/loses to (aix-weak-1b.s type) +# (strong common) loses to (strong data) +0*1000000c D a +# (strong common) wins over (weak data) +0*10000018 B b +# (strong data) wins over (strong common) +0*10000000 D c +# (weak data) loses to (strong common) +0*10000020 B d +# (weak common) loses to (strong data) +0*10000010 D e +# (weak common) wins over (weak data) +0*1000001c W f +# (strong data) wins over (weak common) +0*10000004 D g +# (weak data) wins over (weak common) +0*10000008 W h diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1-gcdso.hd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1-gcdso.hd new file mode 100644 index 0000000..6afe1be --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1-gcdso.hd @@ -0,0 +1,12 @@ +.* + +Sections: +Idx Name * Size * VMA * LMA * File off *Algn + *0 \.text * 0+00 * 0*10000000 * 0*10000000 * [^ ]+ * 2\*\*2 + *ALLOC, LOAD, CODE + *1 \.data * 0+18 * 0*10000000 * 0*10000000 * [^ ]+ * 2\*\*3 + *CONTENTS, ALLOC, LOAD, DATA +# Should only have 3 three common symbols. + *2 \.bss * 0+0c * 0*10000018 * 0*10000018 * [^ ]+ * 2\*\*3 + *ALLOC +#pass diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1-gcdso.nd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1-gcdso.nd new file mode 100644 index 0000000..d8d9a78 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1-gcdso.nd @@ -0,0 +1,22 @@ +# Comments are (aix-weak-1a.s type) wins over/loses to (aix-weak-1b.s type) +# (strong common) loses to (strong data) +0*1000000c d a +0*1000000c D a +# (strong common) wins over (weak data) +0*10000018 B b +# (strong data) wins over (strong common) +0*10000000 d c +0*10000000 D c +# (weak data) loses to (strong common) +0*10000020 B d +# (weak common) loses to (strong data) +0*10000010 d e +0*10000010 D e +# (weak common) wins over (weak data) +0*1000001c W f +# (strong data) wins over (weak common) +0*10000004 d g +0*10000004 D g +# (weak data) wins over (weak common) +0*10000008 d h +0*10000008 W h diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1-rel.hd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1-rel.hd new file mode 100644 index 0000000..9ae4d47 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1-rel.hd @@ -0,0 +1,12 @@ +.* + +Sections: +Idx Name * Size * VMA * LMA * File off *Algn + *0 \.text * 0+00 * 0+00 * 0+00 * [^ ]+ * 2\*\*2 + *ALLOC, LOAD, CODE + *1 \.data * 0+20 * 0+00 * 0+00 * [^ ]+ * 2\*\*3 + *CONTENTS, ALLOC, LOAD, DATA +# Should only have 3 three common symbols. + *2 \.bss * 0+0c * 0+20 * 0+20 * [^ ]+ * 2\*\*3 + *ALLOC +#pass diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1-rel.nd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1-rel.nd new file mode 100644 index 0000000..73cfe90 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1-rel.nd @@ -0,0 +1,25 @@ +# Comments are (aix-weak-1a.s type) wins over/loses to (aix-weak-1b.s type) +# (strong common) loses to (strong data) +0+10 d a +0+10 D a +# (strong common) wins over (weak data) +0+20 B b +0+14 d b +# (strong data) wins over (strong common) +0+00 d c +0+00 D c +# (weak data) loses to (strong common) +0+04 d d +0+28 B d +# (weak common) loses to (strong data) +0+18 d e +0+18 D e +# (weak common) wins over (weak data) +0+24 W f +0+1c d f +# (strong data) wins over (weak common) +0+08 d g +0+08 D g +# (weak data) wins over (weak common) +0+0c d h +0+0c W h diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1.ex b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1.ex new file mode 100644 index 0000000..71ac1b5 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1.ex @@ -0,0 +1,8 @@ +a +b +c +d +e +f +g +h diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1a.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1a.s new file mode 100644 index 0000000..da529ca --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1a.s @@ -0,0 +1,24 @@ + .comm a,4 + .comm b,4 + .globl c + .csect c[RW],2 +c: + .long 0x11111111 + .weak d + .csect d[RW],2 +d: + .long 0x22222222 + + # Same again, with weak common symbols + .weak e + .comm e,4 + .weak f + .comm f,4 + .globl g + .csect g[RW],2 +g: + .long 0x33333333 + .weak h + .csect h[RW],2 +h: + .long 0x44444444 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1b.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1b.s new file mode 100644 index 0000000..e6c2429 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-1b.s @@ -0,0 +1,24 @@ + .globl a + .csect a[RW],2 +a: + .long 0x55555555 + .weak b + .csect b[RW],2 +b: + .long 0x66666666 + .comm c,4 + .comm d,4 + + # Same again, with weak common symbols + .globl e + .csect e[RW],2 +e: + .long 0x77777777 + .weak f + .csect f[RW],2 +f: + .long 0x88888888 + .weak g + .comm g,4 + .weak h + .comm h,4 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2a.ex b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2a.ex new file mode 100644 index 0000000..0e65a8f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2a.ex @@ -0,0 +1,8 @@ +c1 +c2 +c3 +c4 +d1 +d2 +d3 +d4 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2a.nd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2a.nd new file mode 100644 index 0000000..2c2ea1c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2a.nd @@ -0,0 +1,8 @@ +0*cccc1111 W c1 +0*cccc2222 W c2 +0*cccc3333 A c3 +0*cccc4444 A c4 +0*ffff1111 W d1 +0*ffff2222 W d2 +0*10000000 D d3 +0*10000004 D d4 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2a.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2a.s new file mode 100644 index 0000000..e4d8a04 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2a.s @@ -0,0 +1,21 @@ + .weak c1 + c1 = 0xcccc1111 + .weak c2 + c2 = 0xcccc2222 + .globl c3 + c3 = 0xcccc3333 + .globl c4 + c4 = 0xcccc4444 + + .weak d1 + d1 = 0xffff1111 + .weak d2 + d2 = 0xffff2222 + .globl d3 + .csect d3[DS] +d3: + .long 0xffff3333 + .globl d4 + .csect d4[DS] +d4: + .long 0xffff4444 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2b.nd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2b.nd new file mode 100644 index 0000000..d54b35b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2b.nd @@ -0,0 +1,8 @@ +0*dddd1111 A c1 +0*dddd2222 W c2 +0*dddd3333 A c3 +0*dddd4444 W c4 +0*10000000 D d1 +0*eeee2222 W d2 +0*10000004 D d3 +0*eeee4444 W d4 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2b.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2b.s new file mode 100644 index 0000000..84885ab --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2b.s @@ -0,0 +1,21 @@ + .globl c1 + c1 = 0xdddd1111 + .weak c2 + c2 = 0xdddd2222 + .globl c3 + c3 = 0xdddd3333 + .weak c4 + c4 = 0xdddd4444 + + .globl d1 + .csect d1[DS] +d1: + .long 0xeeee1111 + .weak d2 + d2 = 0xeeee2222 + .globl d3 + .csect d3[DS] +d3: + .long 0xeeee3333 + .weak d4 + d4 = 0xeeee4444 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2c.ex b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2c.ex new file mode 100644 index 0000000..257cc56 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2c.ex @@ -0,0 +1 @@ +foo diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2c.nd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2c.nd new file mode 100644 index 0000000..d42034b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2c.nd @@ -0,0 +1,10 @@ +0*dddd1111 C c1 +0*cccc2222 C c2 +0*cccc3333 C c3 +0*cccc4444 C c4 + * U d1 +0*ffff2222 C d2 + * U d3 + * U d4 +0*10000000 d foo +0*10000000 D foo diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2c.od b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2c.od new file mode 100644 index 0000000..272c80e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2c.od @@ -0,0 +1,13 @@ + +.* + +DYNAMIC RELOCATION RECORDS +OFFSET * TYPE * VALUE +0*10000010 R_POS * d1 +0*10000018 R_POS * d3 +0*1000001c R_POS * d4 + + +Contents of section \.data: + 0*10000000 dddd1111 cccc2222 cccc3333 cccc4444 .* + 0*10000010 00000000 ffff2222 00000000 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2c.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2c.s new file mode 100644 index 0000000..5ca93d3 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-2c.s @@ -0,0 +1,11 @@ + .globl foo + .csect foo[DS] +foo: + .long c1 + .long c2 + .long c3 + .long c4 + .long d1 + .long d2 + .long d3 + .long d4 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-3-32.d b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-3-32.d new file mode 100644 index 0000000..45976c9 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-3-32.d @@ -0,0 +1,5 @@ +#name: Weak test 3 (main, static) (32-bit) +#source: aix-weak-3b.s +#as: -a32 --defsym size=32 +#ld: -b32 -e.main -bnoautoimp tmpdir/aix-weak-3a.so +#error: .*multiple definition of `x1'\n[^\n]*first defined here diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-3-32.dd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-3-32.dd new file mode 100644 index 0000000..c52b735 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-3-32.dd @@ -0,0 +1,24 @@ + +.* + + +Disassembly of section \.data: + +20000000 <x1>: +20000000: 00 00 01 02 .* + +20000004 <x2>: +20000004: 00 00 03 04 .* + +20000008 <TOC>: +20000008: 20 00 00 00 .* + 20000008: R_POS x1\+.* + +2000000c <x2>: +2000000c: 20 00 00 04 .* + 2000000c: R_POS x2\+.* + +20000010 <x3>: +20000010: 00 00 00 00 .* + 20000010: R_POS x3 +20000014: 00 00 00 00 .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-3-64.d b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-3-64.d new file mode 100644 index 0000000..4673175 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-3-64.d @@ -0,0 +1,5 @@ +#name: Weak test 3 (main, static) (64-bit) +#source: aix-weak-3b.s +#as: -a64 --defsym size=64 +#ld: -b64 -e.main -bnoautoimp tmpdir/aix64-weak-3a.so +#error: .*multiple definition of `x1'\n[^\n]*first defined here diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-3-64.dd b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-3-64.dd new file mode 100644 index 0000000..7c10f6c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-3-64.dd @@ -0,0 +1,26 @@ + +.* + + +Disassembly of section \.data: + +0000000020000000 <x1>: + 20000000: 00 00 01 02 .* + +0000000020000004 <x2>: + 20000004: 00 00 03 04 .* + +0000000020000008 <TOC>: + 20000008: 00 00 00 00 .* + 20000008: R_POS_64 x1\+.* + 2000000c: 20 00 00 00 .* + +0000000020000010 <x2>: + 20000010: 00 00 00 00 .* + 20000010: R_POS_64 x2\+.* + 20000014: 20 00 00 04 .* + +0000000020000018 <x3>: + 20000018: 00 00 00 00 .* + 20000018: R_POS_64 x3 + 2000001c: 00 00 00 00 .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-3a.ex b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-3a.ex new file mode 100644 index 0000000..589f40b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-3a.ex @@ -0,0 +1,3 @@ +x1 +x2 +x3 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-3a.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-3a.s new file mode 100644 index 0000000..e8b9d96 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-3a.s @@ -0,0 +1,8 @@ + .globl x1 + x1 = 0x11223344 + .globl x2 + x2 = 0x55667788 + .globl x3 + .csect x3[RW] +x3: + .long 42 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-3b.ex b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-3b.ex new file mode 100644 index 0000000..975fbec --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-3b.ex @@ -0,0 +1 @@ +y diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-3b.s b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-3b.s new file mode 100644 index 0000000..4e69082 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix-weak-3b.s @@ -0,0 +1,30 @@ + .globl x1 + .csect x1[RW] +x1: + .long 0x0102 + + .weak x2 + .csect x2[RW] +x2: + .long 0x0304 + + .toc +Tx1: + .tc x1[TC],x1 +Tx2: + .tc x2[TC],x2 +Tx3: + .tc x3[TC],x3 + + .globl .main + .csect .main[PR] +.main: + .if size == 32 + lwz 1,Tx1(2) + lwz 1,Tx2(2) + lwz 1,Tx3(2) + .else + ld 1,Tx1(2) + ld 1,Tx2(2) + ld 1,Tx3(2) + .endif diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/aix52.exp b/binutils-2.24/ld/testsuite/ld-powerpc/aix52.exp new file mode 100644 index 0000000..9241159 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/aix52.exp @@ -0,0 +1,265 @@ +# Expect script for AIX 5.2+ tests +# Copyright 2009 Free Software Foundation +# +# This file is part of the GNU Binutils. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +# MA 02110-1301, USA. +# + +if { ![istarget "powerpc*-*-aix\[5-9\]*"] + || [istarget "powerpc*-*-aix5.\[01\]*"] } { + return +} + +# Run a run_link_tests-style test for AIX. SIZE selects the target size +# (32 or 64). The other arguments are elements of a run_link_tests test. +# +# Make the following changes before running the test: +# +# - Mention SIZE in the test name. +# - Add "-aSIZE --defsym size=SIZE" to the assembler options. +# - Add the source directory to any "-bI:" and "-bE:" linker options. +# - Add "-bSIZE" to the linker options. +# - Add "-XSIZE" to the archiver options. +# - Replace "SIZE" with SIZE in TOOLS. +# - When testing 64-bit targets: +# - Turn tmpdir/aix-* into tmpdir/aix64-*. +# - Turn tmpdir/libaix-* into tmpdir/libaix64-*. +# - Turn -laix* into -laix64*, to compensate for the above. +proc run_aix_test { size name ldopts asopts sources tools output } { + global srcdir subdir + + if { $size == 64 } { + regsub -all {tmpdir/aix-} $ldopts {tmpdir/aix64-} ldopts + regsub {^aix} $output {aix64} output + + regsub -all -- {-laix-} $ldopts {-laix64-} ldopts + regsub {^libaix} $output {libaix64} output + } + if { [regexp {.a$} $output] } { + append ldopts " -X$size" + } else { + regsub -all {(-b[IE]):} $ldopts "\\1:$srcdir/$subdir/" ldopts + append ldopts " -b$size" + } + regsub -all {SIZE} $tools $size tools + run_ld_link_tests [list [list "$name ($size-bit)" \ + $ldopts "" \ + "$asopts -a$size --defsym size=$size" \ + $sources \ + $tools \ + $output]] +} + +foreach file { "aix-lineno-1.txt" } { + remote_upload host "$srcdir/$subdir/$file" "tmpdir/$file" +} + +set aix52tests { + {"Absolute branch test 1" + "-shared -bI:aix-abs-branch-1.im -bE:aix-abs-branch-1.ex" + "" {aix-abs-branch-1.s} + {{objdump {-dR} aix-abs-branch-1.dd} {nm {} aix-abs-branch-1.nd}} + "aix-abs-branch-1.so"} + + {"Relocations against absolute symbols 1" + "-shared -bI:aix-abs-reloc-1.im -bE:aix-abs-reloc-1.ex" + {} {aix-abs-reloc-1.s} + {{objdump -sRj.data aix-abs-reloc-1.od} {nm {} aix-abs-reloc-1.nd}} + "aix-abs-reloc-1.so"} + + {"Core sections test 1" "-shared -bE:aix-core-sec-1.ex" + "" {aix-core-sec-1.s} + {{objdump -h aix-core-sec-1.hd}} + "aix-core-sec-1.so"} + + {"Core sections test 2" "-shared -bE:aix-core-sec-2.ex" + "" {aix-core-sec-2.s} + {{objdump -h aix-core-sec-2.hd}} + "aix-core-sec-2.so"} + + {"Core sections test 3" "-shared -bE:aix-core-sec-3.ex" + "" {aix-core-sec-3.s} + {{objdump -h aix-core-sec-3.hd}} + "aix-core-sec-3.so"} + + {"Duplicate symbol check 1 (rel)" "-r" + "" {aix-no-dup-syms-1a.s aix-no-dup-syms-1b.s} + {{nm {} aix-no-dup-syms-1-rel.nd} {objdump -r aix-no-dup-syms-1-rel.rd}} + "aix-no-dup-syms-1.o"} + + {"Duplicate symbol check 1 (shared)" + "-shared --allow-multiple-definition -bI:aix-no-dup-syms-1.im -bE:aix-no-dup-syms-1.ex" + "" {aix-no-dup-syms-1a.s aix-no-dup-syms-1b.s} + {{nm {} aix-no-dup-syms-1-dso.nd} {objdump -r aix-no-dup-syms-1-dso.rd} + {nm -D aix-no-dup-syms-1-dso.dnd} {objdump -R aix-no-dup-syms-1-dso.drd}} + "aix-no-dup-syms-1.so"} + + {"Export test 1 (archive)" "" + "" {aix-export-1a.s} + {} "libaix-export-1.a"} + + {"Export test 1 (object)" "-r" + "" {aix-export-1b.s} + {} "aix-export-1.o"} + + {"Export test 1 (-bexpall)" + "-shared -bexpall tmpdir/aix-export-1.o -Ltmpdir -laix-export-1" + "" {} + {{objdump -dj.data aix-export-1-all.dd}} + "aix-export-1-all.so"} + + {"Export test 1 (-bexpfull)" + "-shared -bexpfull tmpdir/aix-export-1.o -Ltmpdir -laix-export-1" + "" {} + {{objdump -dj.data aix-export-1-full.dd}} + "aix-export-1-full.so"} + + {"Export test 2" "-shared -bexpall" + {} {aix-export-2.s} + {{nm -D aix-export-2.nd}} "aix-export-2.so"} + + {"Garbage collection test 1" + "-shared -binitfini:init_function:fini_function -bE:aix-gc-1.ex" + "" {aix-gc-1.s} + {{objdump {-dz -j.text -j.data} aix-gc-1-SIZE.dd} + {nm {} aix-gc-1.nd}} + "aix-gc-1.so"} + + {"Glink test 1" + "-shared -bE:aix-glink-1.ex --unresolved-symbols=ignore-all" + "" {aix-glink-1.s} + {{objdump {-D -j.text -j.data} aix-glink-1-SIZE.dd}} + "aix-glink-1.so"} + + {"Glink test 2 (part a)" "-shared -bE:aix-glink-2a.ex" + "" {aix-glink-2a.s} + {} + "aix-glink-2a.so"} + + {"Glink test 2 (part b)" "-r" + "" {aix-glink-2b.s} + {} + "aix-glink-2b.ro"} + + {"Glink test 2 (part c)" "-shared -bE:aix-glink-2c.ex" + "" {aix-glink-2c.s} + {} + "aix-glink-2c.so"} + + {"Glink test 2" + "-e.main tmpdir/aix-glink-2a.so tmpdir/aix-glink-2b.ro tmpdir/aix-glink-2c.so" + "" {aix-glink-2d.s} + {{objdump -d aix-glink-2-SIZE.dd}} + "aix-glink-2"} + + {"Glink test 3 (shared library a)" + "-shared -bexpall" + "" {aix-glink-3a.s} + {} "aix-glink-3a.so"} + + {"Glink test 3 (shared library b)" + "-shared -bexpall" + "" {aix-glink-3b.s} + {} "aix-glink-3b.so"} + + {"Glink test 3 (main test)" + "-bnoautoimp tmpdir/aix-glink-3b.so tmpdir/aix-glink-3a.so" + "" {aix-glink-3.s} + {{objdump -d aix-glink-3.dd}} + "aix-glink-3"} + + {"Line number test 1 (no discards)" "-e.main" + "" {aix-lineno-1.s} + {{objdump -dS aix-lineno-1a.dd} {nm {} aix-lineno-1a.nd}} + "aix-lineno-1a.exe"} + + {"Line number test 1 (discard locals)" "-e.main -x" + "" {aix-lineno-1.s} + {{objdump -dS aix-lineno-1b.dd} {nm {} aix-lineno-1b.nd}} + "aix-lineno-1b.exe"} + + {"Relocatable test 1" "-r" + "" {aix-rel-1.s} + {{objdump -hr aix-rel-1.od}} "aix-rel-1.ro"} + + {".ref test 1" "-efoo1" + "" {aix-ref-1.s} + {{objdump -dr aix-ref-1-SIZE.od}} + "aix-ref-1"} + + {"Weak test 1 (rel)" "-r" + "" {aix-weak-1a.s aix-weak-1b.s} + {{nm {} aix-weak-1-rel.nd} {objdump -h aix-weak-1-rel.hd}} + "aix-weak-1.o"} + + {"Weak test 1 (shared, nogc)" "-shared -bE:aix-weak-1.ex -bnogc" + "" {aix-weak-1a.s aix-weak-1b.s} + {{nm {} aix-weak-1-dso.nd} {objdump -h aix-weak-1-dso.hd} + {nm -D aix-weak-1-dso.dnd}} + "aix-weak-1-nogc.so"} + + {"Weak test 1 (shared, gc)" "-shared -bE:aix-weak-1.ex" + "" {aix-weak-1a.s aix-weak-1b.s} + {{nm {} aix-weak-1-gcdso.nd} {objdump -h aix-weak-1-gcdso.hd} + {nm -D aix-weak-1-gcdso.dnd}} + "aix-weak-1-gc.so"} + + {"Weak test 2 (library 1)" "-shared -bE:aix-weak-2a.ex" + "" {aix-weak-2a.s} + {{nm -D aix-weak-2a.nd}} + "aix-weak-2a.so"} + + {"Weak test 2 (library 2)" "-shared -bE:aix-weak-2a.ex" + "" {aix-weak-2b.s} + {{nm -D aix-weak-2b.nd}} + "aix-weak-2b.so"} + + {"Weak test 2 (main library)" + "-shared -bE:aix-weak-2c.ex tmpdir/aix-weak-2a.so tmpdir/aix-weak-2b.so" + "" {aix-weak-2c.s} + {{nm {} aix-weak-2c.nd} {objdump {-sj.data -R} aix-weak-2c.od}} + "aix-weak-2c.so"} + + {"Weak test 3 (library)" "-shared -bE:aix-weak-3a.ex" + "" {aix-weak-3a.s} + {} + "aix-weak-3a.so"} + + {"Weak test 3 (main, dynamic)" "-e.main tmpdir/aix-weak-3a.so" + "" {aix-weak-3b.s} + {{objdump -Dzrj.data aix-weak-3-SIZE.dd}} + "aix-weak-3"} + + {"TOC test 1" "-shared -bE:aix-toc-1.ex" + "" {aix-toc-1a.s aix-toc-1b.s} + {{objdump -dr aix-toc-1-SIZE.dd}} + "aix-toc-1.so"} +} + +foreach test $aix52tests { + foreach { name ldopts asopts sources tools output } $test { + run_aix_test 32 $name $ldopts $asopts $sources $tools $output + run_aix_test 64 $name $ldopts $asopts $sources $tools $output + } +} + +run_dump_test "aix-glink-1-32" +run_dump_test "aix-glink-1-64" +run_dump_test "aix-glink-3-32" +run_dump_test "aix-glink-3-64" +run_dump_test "aix-weak-3-32" +run_dump_test "aix-weak-3-64" diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/apuinfo-nul.rd b/binutils-2.24/ld/testsuite/ld-powerpc/apuinfo-nul.rd new file mode 100644 index 0000000..d617b68 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/apuinfo-nul.rd @@ -0,0 +1,9 @@ +#source: apuinfo-nul.s +#source: apuinfo-nul1.s +#as: -me500 +#readelf: -x2 +#target: powerpc-eabi* + +Hex dump of section '.PPC.EMB.apuinfo': + 0x00000000 (00000008|08000000) 00000000 (00000002|02000000) 41505569 .*APUi + 0x00000010 6e666f00 nfo. diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/apuinfo-nul.s b/binutils-2.24/ld/testsuite/ld-powerpc/apuinfo-nul.s new file mode 100644 index 0000000..6b17142 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/apuinfo-nul.s @@ -0,0 +1,10 @@ + .text + nop + + # dummy empty apuinfo + # some other tools emit these + .section ".PPC.EMB.apuinfo" + .long 8 + .long 0 + .long 2 + .asciz "APUinfo" diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/apuinfo-nul1.s b/binutils-2.24/ld/testsuite/ld-powerpc/apuinfo-nul1.s new file mode 100644 index 0000000..f415e71 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/apuinfo-nul1.s @@ -0,0 +1,10 @@ + .text +_start: nop + + # dummy empty apuinfo + # some other tools emit these + .section ".PPC.EMB.apuinfo" + .long 8 + .long 0 + .long 2 + .asciz "APUinfo" diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/apuinfo.rd b/binutils-2.24/ld/testsuite/ld-powerpc/apuinfo.rd new file mode 100644 index 0000000..3c07516 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/apuinfo.rd @@ -0,0 +1,12 @@ +#source: apuinfo1.s +#source: apuinfo2.s +#source: apuinfo-nul.s +#as: -me500 +#readelf: -x2 +#target: powerpc-eabi* + +Hex dump of section '.PPC.EMB.apuinfo': + 0x00000000 (00000008|08000000) (00000020|20000000) (00000002|02000000) 41505569 .*APUi + 0x00000010 6e666f00 (00420001|01004200) (00430001|01004300) (00410001|01004100) nfo.* + 0x00000020 (01020001|01000201) (01010001|01000101) (00400001|01004000) (01040001|01000401) .* + 0x00000030 01000001 .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/apuinfo1.s b/binutils-2.24/ld/testsuite/ld-powerpc/apuinfo1.s new file mode 100644 index 0000000..fd42eac --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/apuinfo1.s @@ -0,0 +1,9 @@ + .text + .global apuinfo1 +apuinfo1: + evstdd 29,8(1) + isellt 29, 28, 27 + efsabs 29, 28 + .global _start +_start: + nop diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/apuinfo2.s b/binutils-2.24/ld/testsuite/ld-powerpc/apuinfo2.s new file mode 100644 index 0000000..7f4e7bb --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/apuinfo2.s @@ -0,0 +1,8 @@ + .text + .global apuinfo2 +apuinfo2: + evstdd 29,8(1) + mfbbear 29 + mfpmr 29, 27 + dcbtstls 1, 29, 28 + rfmci diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-12-1.s b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-12-1.s new file mode 100644 index 0000000..10cbe3b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-12-1.s @@ -0,0 +1 @@ +.gnu_attribute 12,1 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-12-11.d b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-12-11.d new file mode 100644 index 0000000..e88c4ba --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-12-11.d @@ -0,0 +1,10 @@ +#source: attr-gnu-12-1.s +#source: attr-gnu-12-1.s +#as: -a32 +#ld: -r -melf32ppc +#readelf: -A +#target: powerpc*-*-* + +Attribute Section: gnu +File Attributes + Tag_GNU_Power_ABI_Struct_Return: r3/r4 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-12-2.s b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-12-2.s new file mode 100644 index 0000000..c39de66 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-12-2.s @@ -0,0 +1 @@ +.gnu_attribute 12,2 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-12-21.d b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-12-21.d new file mode 100644 index 0000000..ef14e35 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-12-21.d @@ -0,0 +1,6 @@ +#source: attr-gnu-12-2.s +#source: attr-gnu-12-1.s +#as: -a32 +#ld: -r -melf32ppc +#warning: Warning: .* uses r3/r4 for small structure returns, .* uses memory +#target: powerpc*-*-* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-0.s b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-0.s new file mode 100644 index 0000000..a143746 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-0.s @@ -0,0 +1 @@ +.gnu_attribute 4,0 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-00.d b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-00.d new file mode 100644 index 0000000..a4751a1 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-00.d @@ -0,0 +1,7 @@ +#source: attr-gnu-4-0.s +#source: attr-gnu-4-0.s +#as: -a32 +#ld: -r -melf32ppc +#readelf: -A +#target: powerpc*-*-* + diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-01.d b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-01.d new file mode 100644 index 0000000..212e0c4 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-01.d @@ -0,0 +1,10 @@ +#source: attr-gnu-4-0.s +#source: attr-gnu-4-1.s +#as: -a32 +#ld: -r -melf32ppc +#readelf: -A +#target: powerpc*-*-* + +Attribute Section: gnu +File Attributes + Tag_GNU_Power_ABI_FP: Hard float diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-02.d b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-02.d new file mode 100644 index 0000000..9bd42b5 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-02.d @@ -0,0 +1,10 @@ +#source: attr-gnu-4-0.s +#source: attr-gnu-4-2.s +#as: -a32 +#ld: -r -melf32ppc +#readelf: -A +#target: powerpc*-*-* + +Attribute Section: gnu +File Attributes + Tag_GNU_Power_ABI_FP: Soft float diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-03.d b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-03.d new file mode 100644 index 0000000..03b0c3c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-03.d @@ -0,0 +1,10 @@ +#source: attr-gnu-4-0.s +#source: attr-gnu-4-3.s +#as: -a32 +#ld: -r -melf32ppc +#readelf: -A +#target: powerpc*-*-* + +Attribute Section: gnu +File Attributes + Tag_GNU_Power_ABI_FP: Single-precision hard float diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-1.s b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-1.s new file mode 100644 index 0000000..e985a56 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-1.s @@ -0,0 +1 @@ +.gnu_attribute 4,1 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-10.d b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-10.d new file mode 100644 index 0000000..93297c2 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-10.d @@ -0,0 +1,10 @@ +#source: attr-gnu-4-1.s +#source: attr-gnu-4-0.s +#as: -a32 +#ld: -r -melf32ppc +#readelf: -A +#target: powerpc*-*-* + +Attribute Section: gnu +File Attributes + Tag_GNU_Power_ABI_FP: Hard float diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-11.d b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-11.d new file mode 100644 index 0000000..fb2b76e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-11.d @@ -0,0 +1,10 @@ +#source: attr-gnu-4-1.s +#source: attr-gnu-4-1.s +#as: -a32 +#ld: -r -melf32ppc +#readelf: -A +#target: powerpc*-*-* + +Attribute Section: gnu +File Attributes + Tag_GNU_Power_ABI_FP: Hard float diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-12.d b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-12.d new file mode 100644 index 0000000..b7ffba0 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-12.d @@ -0,0 +1,6 @@ +#source: attr-gnu-4-1.s +#source: attr-gnu-4-2.s +#as: -a32 +#ld: -r -melf32ppc +#warning: Warning: .* uses hard float, .* uses soft float +#target: powerpc*-*-* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-13.d b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-13.d new file mode 100644 index 0000000..6bc3de4 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-13.d @@ -0,0 +1,6 @@ +#source: attr-gnu-4-1.s +#source: attr-gnu-4-3.s +#as: -a32 +#ld: -r -melf32ppc +#warning: Warning: .* uses double-precision hard float, .* uses single-precision hard float +#target: powerpc*-*-* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-14.d b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-14.d new file mode 100644 index 0000000..3bb6661 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-14.d @@ -0,0 +1,6 @@ +#source: attr-gnu-4-1.s +#source: attr-gnu-4-4.s +#as: -a32 +#ld: -r -melf32ppc +#warning: Warning: .* uses unknown floating point ABI 4 +#target: powerpc*-*-* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-2.s b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-2.s new file mode 100644 index 0000000..54ebf4e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-2.s @@ -0,0 +1 @@ +.gnu_attribute 4,2 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-20.d b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-20.d new file mode 100644 index 0000000..3d83893 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-20.d @@ -0,0 +1,10 @@ +#source: attr-gnu-4-2.s +#source: attr-gnu-4-0.s +#as: -a32 +#ld: -r -melf32ppc +#readelf: -A +#target: powerpc*-*-* + +Attribute Section: gnu +File Attributes + Tag_GNU_Power_ABI_FP: Soft float diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-21.d b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-21.d new file mode 100644 index 0000000..b38f248 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-21.d @@ -0,0 +1,6 @@ +#source: attr-gnu-4-2.s +#source: attr-gnu-4-1.s +#as: -a32 +#ld: -r -melf32ppc +#warning: Warning: .* uses hard float, .* uses soft float +#target: powerpc*-*-* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-22.d b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-22.d new file mode 100644 index 0000000..f6bd198 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-22.d @@ -0,0 +1,10 @@ +#source: attr-gnu-4-2.s +#source: attr-gnu-4-2.s +#as: -a32 +#ld: -r -melf32ppc +#readelf: -A +#target: powerpc*-*-* + +Attribute Section: gnu +File Attributes + Tag_GNU_Power_ABI_FP: Soft float diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-23.d b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-23.d new file mode 100644 index 0000000..f72c258 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-23.d @@ -0,0 +1,6 @@ +#source: attr-gnu-4-2.s +#source: attr-gnu-4-3.s +#as: -a32 +#ld: -r -melf32ppc +#warning: Warning: .* uses hard float, .* uses soft float +#target: powerpc*-*-* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-24.d b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-24.d new file mode 100644 index 0000000..fc17f91 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-24.d @@ -0,0 +1,6 @@ +#source: attr-gnu-4-2.s +#source: attr-gnu-4-4.s +#as: -a32 +#ld: -r -melf32ppc +#warning: Warning: .* uses unknown floating point ABI 4 +#target: powerpc*-*-* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-3.s b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-3.s new file mode 100644 index 0000000..32e5f5d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-3.s @@ -0,0 +1 @@ +.gnu_attribute 4,3 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-31.d b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-31.d new file mode 100644 index 0000000..8ee1874 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-31.d @@ -0,0 +1,6 @@ +#source: attr-gnu-4-3.s +#source: attr-gnu-4-1.s +#as: -a32 +#ld: -r -melf32ppc +#warning: Warning: .* uses double-precision hard float, .* uses single-precision hard float +#target: powerpc*-*-* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-32.d b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-32.d new file mode 100644 index 0000000..3b7cb29 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-32.d @@ -0,0 +1,6 @@ +#source: attr-gnu-4-3.s +#source: attr-gnu-4-2.s +#as: -a32 +#ld: -r -melf32ppc +#warning: Warning: .* uses soft float, .* uses single-precision hard float +#target: powerpc*-*-* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-33.d b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-33.d new file mode 100644 index 0000000..88367ae --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-33.d @@ -0,0 +1,10 @@ +#source: attr-gnu-4-3.s +#source: attr-gnu-4-3.s +#as: -a32 +#ld: -r -melf32ppc +#readelf: -A +#target: powerpc*-*-* + +Attribute Section: gnu +File Attributes + Tag_GNU_Power_ABI_FP: Single-precision hard float diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-34.d b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-34.d new file mode 100644 index 0000000..6f6e1fe --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-34.d @@ -0,0 +1,6 @@ +#source: attr-gnu-4-3.s +#source: attr-gnu-4-4.s +#as: -a32 +#ld: -r -melf32ppc +#warning: Warning: .* uses unknown floating point ABI 4 +#target: powerpc*-*-* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-4.s b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-4.s new file mode 100644 index 0000000..3ff129a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-4.s @@ -0,0 +1 @@ +.gnu_attribute 4,4 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-41.d b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-41.d new file mode 100644 index 0000000..b909476 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-4-41.d @@ -0,0 +1,6 @@ +#source: attr-gnu-4-4.s +#source: attr-gnu-4-1.s +#as: -a32 +#ld: -r -melf32ppc +#warning: Warning: .* uses unknown floating point ABI 4 +#target: powerpc*-*-* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-8-1.s b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-8-1.s new file mode 100644 index 0000000..81c7b7f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-8-1.s @@ -0,0 +1 @@ +.gnu_attribute 8,1 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-8-11.d b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-8-11.d new file mode 100644 index 0000000..7e49d4a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-8-11.d @@ -0,0 +1,10 @@ +#source: attr-gnu-8-1.s +#source: attr-gnu-8-1.s +#as: -a32 +#ld: -r -melf32ppc +#readelf: -A +#target: powerpc*-*-* + +Attribute Section: gnu +File Attributes + Tag_GNU_Power_ABI_Vector: Generic diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-8-2.s b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-8-2.s new file mode 100644 index 0000000..0f18f5f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-8-2.s @@ -0,0 +1 @@ +.gnu_attribute 8,2 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-8-23.d b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-8-23.d new file mode 100644 index 0000000..b22e4bd --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-8-23.d @@ -0,0 +1,6 @@ +#source: attr-gnu-8-2.s +#source: attr-gnu-8-3.s +#as: -a32 +#ld: -r -melf32ppc +#warning: Warning: .* uses vector ABI "SPE", .* uses "AltiVec" +#target: powerpc*-*-* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-8-3.s b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-8-3.s new file mode 100644 index 0000000..6a1cf4e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-8-3.s @@ -0,0 +1 @@ +.gnu_attribute 8,3 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-8-31.d b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-8-31.d new file mode 100644 index 0000000..53e8f99 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/attr-gnu-8-31.d @@ -0,0 +1,10 @@ +#source: attr-gnu-8-3.s +#source: attr-gnu-8-1.s +#as: -a32 +#ld: -r -melf32ppc +#readelf: -A +#target: powerpc*-*-* + +Attribute Section: gnu +File Attributes + Tag_GNU_Power_ABI_Vector: SPE diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/elfv2.s b/binutils-2.24/ld/testsuite/ld-powerpc/elfv2.s new file mode 100644 index 0000000..c2a4c3b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/elfv2.s @@ -0,0 +1,32 @@ + .section .toc,"aw",@progbits +.L0: + .quad x + + .data +x: + .quad f1 + + .globl f1 + .type f1,@function + .text +f1: + addis 2,12,.TOC.-f1@ha + addi 2,2,.TOC.-f1@l + .localentry f1,.-f1 + mflr 0 + stdu 1,-32(1) + std 0,48(1) + bl f1 + ld 3,.L0@toc(2) + bl f2 + nop + ld 3,x@got(2) + bl f3 + nop + bl f4 + nop + ld 0,48(1) + addi 1,1,32 + mtlr 0 + blr + .size f1,.-f1 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/elfv2exe.d b/binutils-2.24/ld/testsuite/ld-powerpc/elfv2exe.d new file mode 100644 index 0000000..7ff9d38 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/elfv2exe.d @@ -0,0 +1,40 @@ +#source: elfv2.s +#as: -a64 +#ld: -melf64ppc --defsym f2=0x1234 --defsym f3=0x10008888 --defsym f4=0x1200000 --defsym _start=f1 +#objdump: -dr + +.* + +Disassembly of section \.text: + +0+100000c0 <.*\.plt_branch\.f2>: +.*: (ff ff 62 3d|3d 62 ff ff) addis r11,r2,-1 +.*: (f0 7f 8b e9|e9 8b 7f f0) ld r12,32752\(r11\) +.*: (a6 03 89 7d|7d 89 03 a6) mtctr r12 +.*: (20 04 80 4e|4e 80 04 20) bctr + +0+100000d0 <.*\.plt_branch\.f4>: +.*: (ff ff 62 3d|3d 62 ff ff) addis r11,r2,-1 +.*: (f8 7f 8b e9|e9 8b 7f f8) ld r12,32760\(r11\) +.*: (a6 03 89 7d|7d 89 03 a6) mtctr r12 +.*: (20 04 80 4e|4e 80 04 20) bctr + +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 +.*: (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\) +.*: (f5 ff ff 4b|4b ff ff f5) bl .* <_start\+0x8> +.*: (08 80 62 e8|e8 62 80 08) ld r3,-32760\(r2\) +.*: (c5 ff ff 4b|4b ff ff c5) bl .*\.plt_branch\.f2> +.*: (00 00 00 60|60 00 00 00) nop +.*: (10 80 62 e8|e8 62 80 10) ld r3,-32752\(r2\) +.*: (81 87 00 48|48 00 87 81) bl 10008888 <f3> +.*: (00 00 00 60|60 00 00 00) nop +.*: (c1 ff ff 4b|4b ff ff c1) bl .*\.plt_branch\.f4> +.*: (00 00 00 60|60 00 00 00) nop +.*: (30 00 01 e8|e8 01 00 30) ld 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 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/elfv2so.d b/binutils-2.24/ld/testsuite/ld-powerpc/elfv2so.d new file mode 100644 index 0000000..963dbb6 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/elfv2so.d @@ -0,0 +1,82 @@ +#source: elfv2.s +#as: -a64 +#ld: -melf64ppc -shared +#objdump: -dr + +.* + +Disassembly of section \.text: + +0+300 <.*\.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>: +.*: (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>: +.*: (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>: +.*: (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>: +.*: (02 00 4c 3c|3c 4c 00 02) addis r2,r12,2 +.*: (e0 81 42 38|38 42 81 e0) addi r2,r2,-32288 +.*: (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\) +.*: (dd ff ff 4b|4b ff ff dd) bl .*\.plt_call\.f1> +.*: (08 80 62 e8|e8 62 80 08) ld r3,-32760\(r2\) +.*: (c5 ff ff 4b|4b ff ff c5) bl .*\.plt_call\.f2> +.*: (18 00 41 e8|e8 41 00 18) ld r2,24\(r1\) +.*: (10 80 62 e8|e8 62 80 10) ld r3,-32752\(r2\) +.*: (a9 ff ff 4b|4b ff ff a9) bl .*\.plt_call\.f3> +.*: (18 00 41 e8|e8 41 00 18) ld r2,24\(r1\) +.*: (91 ff ff 4b|4b ff ff 91) bl .*\.plt_call\.f4> +.*: (18 00 41 e8|e8 41 00 18) ld r2,24\(r1\) +.*: (30 00 01 e8|e8 01 00 30) ld 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) .* + +0+390 <__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 +.*: (f0 ff 4b e8|e8 4b ff f0) ld r2,-16\(r11\) +.*: (a6 03 08 7c|7c 08 03 a6) mtlr r0 +.*: (50 60 8b 7d|7d 8b 60 50) subf r12,r11,r12 +.*: (14 5a 62 7d|7d 62 5a 14) add r11,r2,r11 +.*: (d0 ff 0c 38|38 0c ff d0) addi r0,r12,-48 +.*: (00 00 8b e9|e9 8b 00 00) ld r12,0\(r11\) +.*: (82 f0 00 78|78 00 f0 82) rldicl r0,r0,62,2 +.*: (a6 03 89 7d|7d 89 03 a6) mtctr r12 +.*: (08 00 6b e9|e9 6b 00 08) ld r11,8\(r11\) +.*: (20 04 80 4e|4e 80 04 20) bctr +.*: (00 00 00 60|60 00 00 00) nop + +.* <f3@plt>: +.*: (c8 ff ff 4b|4b ff ff c8) b .* <__glink_PLTresolve> + +.* <f2@plt>: +.*: (c4 ff ff 4b|4b ff ff c4) b .* <__glink_PLTresolve> + +.* <f4@plt>: +.*: (c0 ff ff 4b|4b ff ff c0) b .* <__glink_PLTresolve> + +.* <f1@plt>: +.*: (bc ff ff 4b|4b ff ff bc) b .* <__glink_PLTresolve> diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/export-class.exp b/binutils-2.24/ld/testsuite/ld-powerpc/export-class.exp new file mode 100644 index 0000000..6171d13 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/export-class.exp @@ -0,0 +1,97 @@ +# Expect script for symbol export classes, PowerPC variation. +# +# Copyright 2012 Free Software Foundation, Inc. +# +# This file is part of the GNU Binutils. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +# MA 02110-1301, USA. +# + +# +# Written by Maciej W. Rozycki <macro@codesourcery.com> +# + +# Exclude non-Linux targets; feel free to include your favorite one +# if you like. +if { ![istarget powerpc*-*-linux*] } { + return +} + +proc powerpc_export_class_test { abi endian emul } { + + set testname "PowerPC $abi $endian symbol export class test" + + set AFLAGS "-a$abi -$endian" + set LDFLAGS "-m$emul" + + # Build an auxiliary shared object with conflicting versioned symbol + # definitions. + run_ld_link_tests [list \ + [list \ + "$testname (auxiliary shared object)" \ + "$LDFLAGS -shared -version-script ../ld-elf/export-class-lib.ver" "" \ + "$AFLAGS" \ + { ../ld-elf/export-class-lib.s } \ + {} \ + "powerpc-$abi-export-class-lib.so" \ + ] \ + ] + + # Build a static object that pulls symbol definitions. It has to come + # first before the auxiliary shared object and other static objects on + # the linker's command line and hence we need to build it separately. + run_ld_link_tests [list \ + [list \ + "$testname (initial static object)" \ + "$LDFLAGS -r" "" \ + "$AFLAGS" \ + { ../ld-elf/export-class-ref.s } \ + {} \ + "powerpc-$abi-export-class-ref-r.o" \ + ] \ + ] + + # Build static objects that satisfy symbol dependencies and preempt + # shared-object symbol definitions, and link all the objects built into + # the final shared object. The command-line order of objects linked is + # important to make sure the linker correctly preempts versioned symbols + # from the auxiliary shared object and is as follows: ref, lib, dep, def. + # Get a dump to make sure symbol dependencies are resolved internally. + run_ld_link_tests [list \ + [list \ + "$testname (final shared object)" \ + "$LDFLAGS -shared -Tdata=0x12340000 tmpdir/powerpc-$abi-export-class-ref-r.o tmpdir/powerpc-$abi-export-class-lib.so" "" \ + "$AFLAGS" \ + { ../ld-elf/export-class-dep.s ../ld-elf/export-class-def.s } \ + [list \ + [list readelf -r powerpc-$abi-export-class.rd] \ + [list readelf "-x .data" powerpc-$abi-export-class.xd] \ + ] \ + "powerpc-$abi-export-class.so" \ + ] \ + ] +} + +set abis { 32 be elf32ppclinux 32 le elf32lppclinux 64 be elf64ppc 64 le elf64lppc } + +global ld +catch "exec $ld --help | grep emulations" ldemul + +foreach { abi endian emul } $abis { + if { [string first $emul $ldemul] != -1 } then { + powerpc_export_class_test $abi $endian $emul + } +} diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/oldtlslib.s b/binutils-2.24/ld/testsuite/ld-powerpc/oldtlslib.s new file mode 100644 index 0000000..5786df1 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/oldtlslib.s @@ -0,0 +1,29 @@ + .global __tls_get_addr,__tls_get_addr_opt,gd,ld + .global .__tls_get_addr,.__tls_get_addr_opt + .type .__tls_get_addr,@function + .type .__tls_get_addr_opt,@function + + .section ".opd","aw",@progbits +__tls_get_addr: +__tls_get_addr_opt: + .align 3 + .quad .__tls_get_addr + .quad .TOC.@tocbase + .quad 0 + .size __tls_get_addr,24 + .size __tls_get_addr_opt,24 + + .section ".tbss","awT",@nobits + .align 3 +gd: .space 8 + + .section ".tdata","awT",@progbits + .align 2 +ld: .long 0xc0ffee + + .text +.__tls_get_addr: +.__tls_get_addr_opt: + blr + .size .__tls_get_addr,. - .__tls_get_addr + .size .__tls_get_addr_opt,. - .__tls_get_addr_opt diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/plt1.d b/binutils-2.24/ld/testsuite/ld-powerpc/plt1.d new file mode 100644 index 0000000..7361702 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/plt1.d @@ -0,0 +1,20 @@ +#source: plt1.s +#as: -a32 +#objdump: -dr +#target: powerpc*-*-* + +.* + +Disassembly of section .text: + +0+ <_start>: + 0: (42 9f 00 05|05 00 9f 42) bcl 20,4\*cr7\+so,4 .* + 4: (7f c8 02 a6|a6 02 c8 7f) mflr r30 + 8: (3f de 00 00|00 00 de 3f) addis r30,r30,0 + (a|8): R_PPC_REL16_HA _GLOBAL_OFFSET_TABLE_\+0x(6|4) + c: (3b de 00 0.|0. 00 de 3b) addi r30,r30,.* + (e|c): R_PPC_REL16_LO _GLOBAL_OFFSET_TABLE_\+0x(a|8) + 10: (48 00 00 01|01 00 00 48) bl 10 .* + 10: R_PPC_PLTREL24 _exit + 14: (48 00 00 00|00 00 00 48) b 14 .* + 14: R_PPC_REL24 _start diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/plt1.s b/binutils-2.24/ld/testsuite/ld-powerpc/plt1.s new file mode 100644 index 0000000..c00c264 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/plt1.s @@ -0,0 +1,9 @@ + .text + .global _start +_start: + bcl 20,31,1f +1: mflr 30 + addis 30,30,(_GLOBAL_OFFSET_TABLE_-1b)@ha + addi 30,30,(_GLOBAL_OFFSET_TABLE_-1b)@l + bl _exit@plt + b _start diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/powerpc-32-export-class.rd b/binutils-2.24/ld/testsuite/ld-powerpc/powerpc-32-export-class.rd new file mode 100644 index 0000000..1c64b40 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/powerpc-32-export-class.rd @@ -0,0 +1,11 @@ +Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains [0-9]+ entries: + * Offset * Info * Type * Sym\. *Value * Sym\. * Name * \+ * Addend +12340000 00000016 R_PPC_RELATIVE * 123400a0 +12340010 00000016 R_PPC_RELATIVE * 123400a0 +12340020 00000016 R_PPC_RELATIVE * 123400a0 +12340040 00000016 R_PPC_RELATIVE * 123400a0 +12340050 00000016 R_PPC_RELATIVE * 123400a0 +12340060 00000016 R_PPC_RELATIVE * 123400a0 +12340070 00000016 R_PPC_RELATIVE * 123400a0 +12340080 00000016 R_PPC_RELATIVE * 123400a0 +12340090 00000016 R_PPC_RELATIVE * 123400a0 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/powerpc-32-export-class.xd b/binutils-2.24/ld/testsuite/ld-powerpc/powerpc-32-export-class.xd new file mode 100644 index 0000000..36a589f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/powerpc-32-export-class.xd @@ -0,0 +1,11 @@ +Hex dump of section '\.data': + 0x12340000 00000000 00000000 00000000 00000000 .* + 0x12340010 00000000 00000000 00000000 00000000 .* + 0x12340020 00000000 00000000 00000000 00000000 .* + 0x12340030 00000000 00000000 00000000 00000000 .* + 0x12340040 00000000 00000000 00000000 00000000 .* + 0x12340050 00000000 00000000 00000000 00000000 .* + 0x12340060 00000000 00000000 00000000 00000000 .* + 0x12340070 00000000 00000000 00000000 00000000 .* + 0x12340080 00000000 00000000 00000000 00000000 .* + 0x12340090 00000000 00000000 00000000 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/powerpc-64-export-class.rd b/binutils-2.24/ld/testsuite/ld-powerpc/powerpc-64-export-class.rd new file mode 100644 index 0000000..c7ff641 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/powerpc-64-export-class.rd @@ -0,0 +1,11 @@ +Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains [0-9]+ entries: + * Offset * Info * Type * Sym\. *Value * Sym\. * Name * \+ * Addend +000012340000 000000000016 R_PPC64_RELATIVE * 123400a0 +000012340010 000000000016 R_PPC64_RELATIVE * 123400a0 +000012340020 000000000016 R_PPC64_RELATIVE * 123400a0 +000012340040 000000000016 R_PPC64_RELATIVE * 123400a0 +000012340050 000000000016 R_PPC64_RELATIVE * 123400a0 +000012340060 000000000016 R_PPC64_RELATIVE * 123400a0 +000012340070 000000000016 R_PPC64_RELATIVE * 123400a0 +000012340080 000000000016 R_PPC64_RELATIVE * 123400a0 +000012340090 000000000016 R_PPC64_RELATIVE * 123400a0 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/powerpc-64-export-class.xd b/binutils-2.24/ld/testsuite/ld-powerpc/powerpc-64-export-class.xd new file mode 100644 index 0000000..264803c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/powerpc-64-export-class.xd @@ -0,0 +1,11 @@ +Hex dump of section '\.data': + 0x12340000 (00000000|a0003412) (123400a0|00000000) 00000000 00000000 .* + 0x12340010 (00000000|a0003412) (123400a0|00000000) 00000000 00000000 .* + 0x12340020 (00000000|a0003412) (123400a0|00000000) 00000000 00000000 .* + 0x12340030 (00000000|00000000) (00000000|00000000) 00000000 00000000 .* + 0x12340040 (00000000|a0003412) (123400a0|00000000) 00000000 00000000 .* + 0x12340050 (00000000|a0003412) (123400a0|00000000) 00000000 00000000 .* + 0x12340060 (00000000|a0003412) (123400a0|00000000) 00000000 00000000 .* + 0x12340070 (00000000|a0003412) (123400a0|00000000) 00000000 00000000 .* + 0x12340080 (00000000|a0003412) (123400a0|00000000) 00000000 00000000 .* + 0x12340090 (00000000|a0003412) (123400a0|00000000) 00000000 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/powerpc.exp b/binutils-2.24/ld/testsuite/ld-powerpc/powerpc.exp new file mode 100644 index 0000000..87e4ea8 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/powerpc.exp @@ -0,0 +1,309 @@ +# Expect script for ld-powerpc tests +# Copyright 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +# Free Software Foundation +# +# This file is part of the GNU Binutils. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +# MA 02110-1301, USA. +# + +if { ![istarget "powerpc*-*-*"] } { + return +} + +if {[istarget "*-*-vxworks"]} { + set ppcvxtests { + {"VxWorks shared library test 1 (default script)" "-shared" "" + "-mregnames" {vxworks1-lib.s} + {{readelf --segments vxworks1-lib.sd}} + "libvxworks1.so"} + {"VxWorks shared library test 1" "-shared -Tvxworks1.ld" "" + "-mregnames" {vxworks1-lib.s} + {{readelf --relocs vxworks1-lib.rd} {objdump -dr vxworks1-lib.dd} + {readelf --symbols vxworks1-lib.nd} {readelf -d vxworks1-lib.td}} + "libvxworks1.so"} + {"VxWorks executable test 1 (dynamic)" \ + "tmpdir/libvxworks1.so -Tvxworks1.ld -q --force-dynamic" "" + "-mregnames" {vxworks1.s} + {{readelf --relocs vxworks1.rd} {objdump -dr vxworks1.dd}} + "vxworks1"} + {"VxWorks executable test 2 (dynamic)" \ + "-Tvxworks1.ld -q --force-dynamic" "" + "-mregnames" {vxworks2.s} + {{readelf --segments vxworks2.sd}} + "vxworks2"} + {"VxWorks executable test 2 (static)" + "-Tvxworks1.ld" "" + "-mregnames" {vxworks2.s} + {{readelf --segments vxworks2-static.sd}} + "vxworks2"} + {"VxWorks relax test" + "-Tvxworks1.ld --relax -q" "" + "-mregnames" {vxworks-relax.s} + {{readelf --relocs vxworks-relax.rd}} + "vxworks-relax"} + {"VxWorks relocatable relax test" + "-Tvxworks1.ld -r --relax -q" "" + "-mregnames" {vxworks-relax-2.s} + {{readelf --relocs vxworks-relax-2.rd}} + "vxworks-relax-2"} + } + run_ld_link_tests $ppcvxtests + run_dump_test "vxworks1-static" + return +} + +# powerpc ELF only at the moment. Disable for nto too, even though it +# is ELF, because we pass -melf32ppc to ld and powerpc-nto-ld wants +# -melf32ppcnto. + +if { [istarget "*-*-macos*"] || [istarget "*-*-netware*"] + || [istarget "*-*-pe"] || [istarget "*-*-winnt*"] + || [istarget "*-*-cygwin*"] || [istarget "*-*-aix*"] + || [istarget "*-*-beos*"] || [istarget "*-*-lynxos*"] + || [istarget "*-*-nto*"] } { + return +} + +proc supports_ppc64 { } { + global ld + + catch "exec $ld --help | grep emulations" tmp + if [ regexp "elf64l?ppc" $tmp ] then { + return 1 + } else { + return 0 + } +} + +# List contains test-items with 3 items followed by 2 lists: +# 0:name 1:ld early options 2:ld late options 3:assembler options +# 4:filenames of assembler files 5: action and options. 6: name of output file + +# Actions: +# objdump: Apply objdump options on result. Compare with regex (last arg). +# nm: Apply nm options on result. Compare with regex (last arg). +# readelf: Apply readelf options on result. Compare with regex (last arg). + +set ppcelftests { + {"Reloc section order" "-melf32ppc -shared -z nocombreloc" "" "-a32" {reloc.s} + {{objdump -hw reloc.d}} "reloc.so"} + {"APUinfo section processing" "-melf32ppc" "" + "-a32 -me500" {apuinfo1.s apuinfo-nul.s apuinfo2.s} + {{readelf -x2 apuinfo.rd}} "apuinfo"} + {"APUinfo NULL section processing" "-melf32ppc" "" + "-a32 -me500" {apuinfo-nul1.s apuinfo-nul.s} + {{readelf -x2 apuinfo-nul.rd}} "apuinfo"} + {"TLS32 static exec" "-melf32ppc" "" "-a32" {tls32.s tlslib32.s} + {{objdump -dr tls32.d} {objdump -sj.got tls32.g} + {objdump -sj.tdata tls32.t}} + "tls32"} + {"TLS32 helper shared library" "-shared -melf32ppc tmpdir/tlslib32.o" "" "" {} + {} "libtlslib32.so"} + {"TLS32 dynamic exec" "-melf32ppc --no-ld-generated-unwind-info tmpdir/tls32.o tmpdir/libtlslib32.so" "" "" {} + {{readelf -WSsrl tlsexe32.r} {objdump -dr tlsexe32.d} + {objdump -sj.got tlsexe32.g} {objdump -sj.tdata tlsexe32.t}} + "tlsexe32"} + {"TLS32 shared" "-shared -melf32ppc --no-ld-generated-unwind-info tmpdir/tls32.o" "" "" {} + {{readelf -WSsrl tlsso32.r} {objdump -dr tlsso32.d} + {objdump -sj.got tlsso32.g} {objdump -sj.tdata tlsso32.t}} + "tls32.so"} + {"TLS32 markers" "-melf32ppc" "" "-a32" {tlsmark32.s tlslib32.s} + {{objdump -dr tlsmark32.d}} + "tlsmark32"} + {"TLS32 opt 1" "-melf32ppc" "" "-a32" {tlsopt1_32.s tlslib32.s} + {{objdump -dr tlsopt1_32.d}} + "tlsopt1_32"} + {"TLS32 opt 2" "-melf32ppc" "" "-a32" {tlsopt2_32.s tlslib32.s} + {{objdump -dr tlsopt2_32.d}} + "tlsopt2_32"} + {"TLS32 opt 3" "-melf32ppc" "" "-a32" {tlsopt3_32.s tlslib32.s} + {{objdump -dr tlsopt3_32.d}} + "tlsopt3_32"} + {"TLS32 opt 4" "-melf32ppc" "" "-a32" {tlsopt4_32.s tlslib32.s} + {{objdump -dr tlsopt4_32.d}} + "tlsopt4_32"} + {"Shared library with global symbol" "-shared -melf32ppc" "" "-a32" {sdalib.s} + {} "sdalib.so"} + {"Dynamic application with SDA" "-melf32ppc tmpdir/sdalib.so" "" "-a32" {sdadyn.s} + {{objdump -R sdadyn.d}} "sdadyn"} + {"relaxing" "-melf32ppc --relax -Ttext=0 --defsym far=0x80001234 --defsym near=0x00004320" "" "-a32" "relax.s" + {{objdump -dr relax.d}} + "relax"} + {"relocatable relaxing" "-melf32ppc -r --relax" "" "-a32" "relax.s" + {{objdump -dr relaxr.d}} + "relax"} +} + +set ppc64elftests { + {"TLS static exec" "-melf64ppc" "" "-a64" {tls.s tlslib.s} + {{objdump -dr tls.d} {objdump -sj.got tls.g} {objdump -sj.tdata tls.t}} + "tls"} + {"TLS helper shared library" "-shared -melf64ppc tmpdir/tlslib.o" "" "" {} + {} "libtlslib.so"} + {"TLS helper old shared lib" "-shared -melf64ppc" "" "-a64" {oldtlslib.s} + {} "liboldlib.so"} + {"TLS dynamic exec" "-melf64ppc --no-ld-generated-unwind-info tmpdir/tls.o tmpdir/libtlslib.so" "" "" {} + {{readelf -WSsrl tlsexe.r} {objdump -dr tlsexe.d} + {objdump -sj.got tlsexe.g} {objdump -sj.tdata tlsexe.t}} + "tlsexe"} + {"TLS dynamic old" "-melf64ppc --no-ld-generated-unwind-info tmpdir/tls.o tmpdir/liboldlib.so" "" "" {} + {{readelf -WSsrl tlsexe.r} {objdump -dr tlsexe.d} + {objdump -sj.got tlsexe.g} {objdump -sj.tdata tlsexe.t}} + "tlsexeold"} + {"TLS shared" "-shared -melf64ppc --no-ld-generated-unwind-info tmpdir/tls.o" "" "" {} + {{readelf -WSsrl tlsso.r} {objdump -dr tlsso.d} + {objdump -sj.got tlsso.g} {objdump -sj.tdata tlsso.t}} + "tls.so"} + {"TLSTOC static exec" "-melf64ppc tmpdir/tlslib.o " "" "-a64" {tlstoc.s} + {{objdump -dr tlstoc.d} {objdump -sj.got tlstoc.g} + {objdump -sj.tdata tlstoc.t}} + "tlstoc"} + {"TLSTOC dynamic exec" "-melf64ppc --no-ld-generated-unwind-info tmpdir/tlstoc.o tmpdir/libtlslib.so" "" + "" {} + {{readelf -WSsrl tlsexetoc.r} {objdump -dr tlsexetoc.d} + {objdump -sj.got tlsexetoc.g} {objdump -sj.tdata tlsexetoc.t}} + "tlsexetoc"} + {"TLSTOC dynamic old" "-melf64ppc --no-ld-generated-unwind-info tmpdir/tlstoc.o tmpdir/liboldlib.so" "" + "" {} + {{readelf -WSsrl tlsexetoc.r} {objdump -dr tlsexetoc.d} + {objdump -sj.got tlsexetoc.g} {objdump -sj.tdata tlsexetoc.t}} + "tlsexetocold"} + {"TLSTOC shared" "-shared -melf64ppc --no-ld-generated-unwind-info tmpdir/tlstoc.o" "" "" {} + {{readelf -WSsrl tlstocso.r} {objdump -dr tlstocso.d} + {objdump -sj.got tlstocso.g} {objdump -sj.tdata tlstocso.t}} + "tlstoc.so"} + {"TLS markers" "-melf64ppc" "" "-a64" {tlsmark.s tlslib.s} + {{objdump -dr tlsmark.d}} + "tlsmark"} + {"TLS opt 1" "-melf64ppc" "" "-a64" {tlsopt1.s tlslib.s} + {{objdump -dr tlsopt1.d}} + "tlsopt1"} + {"TLS opt 2" "-melf64ppc" "" "-a64" {tlsopt2.s tlslib.s} + {{objdump -dr tlsopt2.d}} + "tlsopt2"} + {"TLS opt 3" "-melf64ppc" "" "-a64" {tlsopt3.s tlslib.s} + {{objdump -dr tlsopt3.d}} + "tlsopt3"} + {"TLS opt 4" "-melf64ppc" "" "-a64" {tlsopt4.s tlslib.s} + {{objdump -dr tlsopt4.d}} + "tlsopt4"} + {"sym@tocbase" "-shared -melf64ppc" "" "-a64" {symtocbase-1.s symtocbase-2.s} + {{objdump -dj.data symtocbase.d}} "symtocbase.so"} + {"TOC opt" "-melf64ppc" "" "-a64" {tocopt.s} + {{ld tocopt.out} {objdump -s tocopt.d}} "tocopt"} + {"TOC opt2" "-melf64ppc --defsym x=2" "" "-a64" {tocopt2.s} + {{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"} + {"TOC opt5" "-melf64ppc" "" "-a64" {tocopt5.s} + {{objdump -s tocopt5.d}} "tocopt5"} +} + +set ppceabitests { + {"VLE multiple segments 1" "-T vle-multiseg-1.ld" "" + "-mregnames -mvle" {vle-multiseg.s} + {{readelf "-l" vle-multiseg-1.d}} "vle-multiseg-1"} + {"VLE multiple segments 2" "-T vle-multiseg-2.ld" "" + "-mregnames -mvle" {vle-multiseg.s} + {{readelf "-l" vle-multiseg-2.d}} "vle-multiseg-2"} + {"VLE multiple segments 3" "-T vle-multiseg-3.ld" "" + "-mregnames -mvle" {vle-multiseg.s} + {{readelf "-l" vle-multiseg-3.d}} "vle-multiseg-3"} + {"VLE multiple segments 4" "-T vle-multiseg-4.ld" "" + "-mregnames -mvle" {vle-multiseg.s} + {{readelf "-l" vle-multiseg-4.d}} "vle-multiseg-4"} + {"VLE multiple segments 5" "-T vle-multiseg-5.ld" "" + "-mregnames -mvle" {vle-multiseg.s} + {{readelf "-l" vle-multiseg-5.d}} "vle-multiseg-5"} + {"VLE relocations 1" "-T vle.ld" "" + "-mvle" {vle-reloc-1.s vle-reloc-def-1.s} + {{objdump "-Mvle -d" vle-reloc-1.d}} "vle-reloc-1"} + {"VLE relocations 2" "-T vle.ld" "" + "-mvle" {vle-reloc-2.s vle-reloc-def-2.s} + {{objdump "-Mvle -d" vle-reloc-2.d}} "vle-reloc-2"} + {"VLE relocations 3" "-T vle.ld" "" + "-mvle" {vle-reloc-3.s vle-reloc-def-3.s} + {{objdump "-Mvle -d" vle-reloc-3.d}} "vle-reloc-3"} +} + +if [istarget "powerpc*le*-*-*"] then { + set options_regsub(ld) {{-melf([3264]*)ppc} {-melf\1lppc}} + + for {set i 0} {$i < [llength $ppcelftests]} {incr i} { + set line [lindex $ppcelftests $i] + set ld_options [lindex $line 1] + regsub -all elf32ppc $ld_options elf32lppc ld_options + set line [lreplace $line 1 1 $ld_options] + set ppcelftests [lreplace $ppcelftests $i $i $line] + } + + if [ supports_ppc64 ] then { + for {set i 0} {$i < [llength $ppc64elftests]} {incr i} { + set line [lindex $ppc64elftests $i] + set ld_options [lindex $line 1] + regsub -all elf64ppc $ld_options elf64lppc ld_options + set line [lreplace $line 1 1 $ld_options] + set ppc64elftests [lreplace $ppc64elftests $i $i $line] + } + } +} + +run_ld_link_tests $ppcelftests + +if [ supports_ppc64 ] then { + run_ld_link_tests $ppc64elftests + run_dump_test "relbrlt" + run_dump_test "elfv2so" + run_dump_test "elfv2exe" +} + +if { [istarget "powerpc*-eabi*"] } { + run_ld_link_tests $ppceabitests +} + +run_dump_test "plt1" + +run_dump_test "attr-gnu-4-00" +run_dump_test "attr-gnu-4-01" +run_dump_test "attr-gnu-4-02" +run_dump_test "attr-gnu-4-03" +run_dump_test "attr-gnu-4-10" +run_dump_test "attr-gnu-4-11" +run_dump_test "attr-gnu-4-12" +run_dump_test "attr-gnu-4-13" +run_dump_test "attr-gnu-4-14" +run_dump_test "attr-gnu-4-20" +run_dump_test "attr-gnu-4-21" +run_dump_test "attr-gnu-4-22" +run_dump_test "attr-gnu-4-23" +run_dump_test "attr-gnu-4-24" +run_dump_test "attr-gnu-4-31" +run_dump_test "attr-gnu-4-32" +run_dump_test "attr-gnu-4-33" +run_dump_test "attr-gnu-4-34" +run_dump_test "attr-gnu-4-41" + +run_dump_test "attr-gnu-8-11" +run_dump_test "attr-gnu-8-23" +run_dump_test "attr-gnu-8-31" + +run_dump_test "attr-gnu-12-11" +run_dump_test "attr-gnu-12-21" + +run_dump_test "vle-multiseg-6" diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/relax.d b/binutils-2.24/ld/testsuite/ld-powerpc/relax.d new file mode 100644 index 0000000..e58cc78 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/relax.d @@ -0,0 +1,15 @@ + +.*: file format .* + +Disassembly of section .text: + +00000000 <_start>: + 0: (48 00 43 21|21 43 00 48) bl 4320 <near> + 4: (48 00 00 11|11 00 00 48) bl 14 <_start\+0x14> + 8: (48 00 43 19|19 43 00 48) bl 4320 <near> + c: (48 00 00 09|09 00 00 48) bl 14 <_start\+0x14> + 10: (4b ff ff f0|f0 ff ff 4b) b 0 <.*> + 14: (3d 80 80 00|00 80 80 3d) lis r12,-32768 + 18: (39 8c 12 34|34 12 8c 39) addi r12,r12,4660 + 1c: (7d 89 03 a6|a6 03 89 7d) mtctr r12 + 20: (4e 80 04 20|20 04 80 4e) bctr diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/relax.s b/binutils-2.24/ld/testsuite/ld-powerpc/relax.s new file mode 100644 index 0000000..11afc53 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/relax.s @@ -0,0 +1,7 @@ + .globl _start +_start: + bl near + bl far + bl near + bl far + b _start diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/relaxr.d b/binutils-2.24/ld/testsuite/ld-powerpc/relaxr.d new file mode 100644 index 0000000..3ce2751 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/relaxr.d @@ -0,0 +1,26 @@ + +.*: file format .* + +Disassembly of section .text: + +00000000 <_start>: + 0: (48 00 00 15|15 00 00 48) bl 14 <_start\+0x14> + 4: (48 00 00 21|21 00 00 48) bl 24 <_start\+0x24> + 8: (48 00 00 0d|0d 00 00 48) bl 14 <_start\+0x14> + 8: R_PPC_NONE \*ABS\* + c: (48 00 00 19|19 00 00 48) bl 24 <_start\+0x24> + c: R_PPC_NONE \*ABS\* + 10: (48 00 00 00|00 00 00 48) b 10 <_start\+0x10> + 10: R_PPC_REL24 _start + 14: (3d 80 00 00|00 00 80 3d) lis r12,0 + 1(6|4): R_PPC_ADDR16_HA near + 18: (39 8c 00 00|00 00 8c 39) addi r12,r12,0 + 1(a|8): R_PPC_ADDR16_LO near + 1c: (7d 89 03 a6|a6 03 89 7d) mtctr r12 + 20: (4e 80 04 20|20 04 80 4e) bctr + 24: (3d 80 00 00|00 00 80 3d) lis r12,0 + 2(6|4): R_PPC_ADDR16_HA far + 28: (39 8c 00 00|00 00 8c 39) addi r12,r12,0 + 2(a|8): R_PPC_ADDR16_LO far + 2c: (7d 89 03 a6|a6 03 89 7d) mtctr r12 + 30: (4e 80 04 20|20 04 80 4e) bctr diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/relbrlt.d b/binutils-2.24/ld/testsuite/ld-powerpc/relbrlt.d new file mode 100644 index 0000000..b04ae7d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/relbrlt.d @@ -0,0 +1,60 @@ +#source: relbrlt.s +#as: -a64 +#ld: -melf64ppc --no-ld-generated-unwind-info --emit-relocs +#objdump: -Dr + +.* + +Disassembly of section \.text: + +0*100000c0 <_start>: +[0-9a-f ]*: (49 bf 00 2d|2d 00 bf 49) bl .* +[0-9a-f ]*: R_PPC64_REL24 \.text\+0x37e003c +[0-9a-f ]*: (60 00 00 00|00 00 00 60) nop +[0-9a-f ]*: (49 bf 00 19|19 00 bf 49) bl .* +[0-9a-f ]*: R_PPC64_REL24 \.text\+0x3bf0020 +[0-9a-f ]*: (60 00 00 00|00 00 00 60) nop +[0-9a-f ]*: (49 bf 00 21|21 00 bf 49) bl .* +[0-9a-f ]*: R_PPC64_REL24 \.text\+0x57e0024 +[0-9a-f ]*: (60 00 00 00|00 00 00 60) nop +[0-9a-f ]*: 00 00 00 00 \.long 0x0 +[0-9a-f ]*: (4b ff ff e4|e4 ff ff 4b) b .* <_start> + \.\.\. + +[0-9a-f ]*<.*plt_branch.*>: +[0-9a-f ]*: (e9 82 80 00|00 80 82 e9) ld r12,-32768\(r2\) +[0-9a-f ]*: R_PPC64_TOC16_DS \*ABS\*\+0x157f00e8 +[0-9a-f ]*: (7d 89 03 a6|a6 03 89 7d) mtctr r12 +[0-9a-f ]*: (4e 80 04 20|20 04 80 4e) bctr + +[0-9a-f ]*<.*long_branch.*>: +[0-9a-f ]*: (49 bf 00 10|10 00 bf 49) b .* <far> +[0-9a-f ]*: R_PPC64_REL24 \*ABS\*\+0x137e00fc + +[0-9a-f ]*<.*plt_branch.*>: +[0-9a-f ]*: (e9 82 80 08|08 80 82 e9) ld r12,-32760\(r2\) +[0-9a-f ]*: R_PPC64_TOC16_DS \*ABS\*\+0x157f00f0 +[0-9a-f ]*: (7d 89 03 a6|a6 03 89 7d) mtctr r12 +[0-9a-f ]*: (4e 80 04 20|20 04 80 4e) bctr + \.\.\. + +0*137e00fc <far>: +[0-9a-f ]*: (4e 80 00 20|20 00 80 4e) blr + \.\.\. + +0*13bf00e0 <far2far>: +[0-9a-f ]*: (4e 80 00 20|20 00 80 4e) blr + \.\.\. + +0*157e00e4 <huge>: +[0-9a-f ]*: (4e 80 00 20|20 00 80 4e) blr + +Disassembly of section \.branch_lt: + +0*157f00e8 .*: +[0-9a-f ]*: (00 00 00 00|e0 00 bf 13) .* +[0-9a-f ]*: R_PPC64_RELATIVE \*ABS\*\+0x13bf00e0 +[0-9a-f ]*: (13 bf 00 e0|00 00 00 00) .* +[0-9a-f ]*: (00 00 00 00|e4 00 7e 15) .* +[0-9a-f ]*: R_PPC64_RELATIVE \*ABS\*\+0x157e00e4 +[0-9a-f ]*: (15 7e 00 e4|00 00 00 00) .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/relbrlt.s b/binutils-2.24/ld/testsuite/ld-powerpc/relbrlt.s new file mode 100644 index 0000000..cee0cdd --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/relbrlt.s @@ -0,0 +1,34 @@ + .text + .global _start +_start: +1: + bl far + nop + bl far2far + nop + bl huge + nop + .long 0 + b 1b + .space 0x1bf0000 + + .section .text.pad1,"ax" + .space 0x1bf0000 + + .section .text.far,"ax" +far: + blr + + .section .text.pad2,"ax" + .space 0x40ffe0 + + .section .text.far2far,"ax" +far2far: + blr + + .section .text.pad3,"ax" + .space 0x1bf0000 + + .section .text.huge,"ax" +huge: + blr diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/reloc.d b/binutils-2.24/ld/testsuite/ld-powerpc/reloc.d new file mode 100644 index 0000000..1c7eb8a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/reloc.d @@ -0,0 +1,13 @@ +# Test that orphan reloc sections are placed before .rela.plt even when +# .rela.plt is the only reloc section. + +#source: reloc.s +#ld: -shared -z nocombreloc +#objdump: -hw + +.*: +file format elf.* +#... +.*\.relaplatypus.* +#... +.*\.rela\.plt.* +#pass diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/reloc.s b/binutils-2.24/ld/testsuite/ld-powerpc/reloc.s new file mode 100644 index 0000000..4e66151 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/reloc.s @@ -0,0 +1,9 @@ + .section echidna + .long .text + + .section platypus,"ax" + .long .text + + .text + b _start@plt + nop diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/sdadyn.d b/binutils-2.24/ld/testsuite/ld-powerpc/sdadyn.d new file mode 100644 index 0000000..cbdfc1e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/sdadyn.d @@ -0,0 +1,8 @@ + +.* + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +#... +.* R_PPC_COPY lib_var +#pass diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/sdadyn.s b/binutils-2.24/ld/testsuite/ld-powerpc/sdadyn.s new file mode 100644 index 0000000..1b2d13f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/sdadyn.s @@ -0,0 +1,3 @@ + .globl _start +_start: + lwz 3,lib_var@sda21(0) diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/sdalib.s b/binutils-2.24/ld/testsuite/ld-powerpc/sdalib.s new file mode 100644 index 0000000..69b0391 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/sdalib.s @@ -0,0 +1,5 @@ + .globl lib_var + .type lib_var, @object + .size lib_var, 2 +lib_var: + .word 1 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/symtocbase-1.s b/binutils-2.24/ld/testsuite/ld-powerpc/symtocbase-1.s new file mode 100644 index 0000000..ba6f073 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/symtocbase-1.s @@ -0,0 +1,18 @@ +.section .toc,"aw",@progbits + .align 15 + .globl x +x: .quad .x,.x@tocbase,0 +.LCi: .quad i + .space 48 * 1024 +.data + .globl i +i: .long 0 +.L1bases: + .quad .TOC.@tocbase + .quad .x@tocbase + .quad .y@tocbase +.text + .globl .x +.x: + ld 9,.LCi@toc(2) + blr diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/symtocbase-2.s b/binutils-2.24/ld/testsuite/ld-powerpc/symtocbase-2.s new file mode 100644 index 0000000..1176cb8 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/symtocbase-2.s @@ -0,0 +1,16 @@ +.section .toc,"aw",@progbits + .align 15 + .globl y +y: .quad .y,.y@tocbase,0 +.LCi: .quad i + .space 48 * 1024 +.data +.L2bases: + .quad .TOC.@tocbase + .quad .x@tocbase + .quad .y@tocbase +.text + .globl .y +.y: + ld 9,.LCi@toc(2) + blr diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/symtocbase.d b/binutils-2.24/ld/testsuite/ld-powerpc/symtocbase.d new file mode 100644 index 0000000..118885f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/symtocbase.d @@ -0,0 +1,25 @@ +#source: symtocbase-1.s +#source: symtocbase-2.s +#as: -a64 +#ld: -shared -melf64ppc +#objdump: -dj.data -z +#target: powerpc64*-*-* + +.* + +Disassembly of section \.data: + +.* <i>: +#... +.* \.long 0x28000 +.* \.long 0x0 +.* \.long 0x28000 +.* \.long 0x0 +.* \.long 0x38000 +.* \.long 0x0 +.* \.long 0x38000 +.* \.long 0x0 +.* \.long 0x28000 +.* \.long 0x0 +.* \.long 0x38000 +#pass diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tls.d b/binutils-2.24/ld/testsuite/ld-powerpc/tls.d new file mode 100644 index 0000000..7082028 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tls.d @@ -0,0 +1,53 @@ +#source: tls.s +#source: tlslib.s +#as: -a64 +#ld: +#objdump: -dr +#target: powerpc64*-*-* + +.* + +Disassembly of section \.text: + +0+100000e8 <\._start>: +.*: (3c 6d 00 00|00 00 6d 3c) addis r3,r13,0 +.*: (60 00 00 00|00 00 00 60) nop +.*: (38 63 90 78|78 90 63 38) addi r3,r3,-28552 +.*: (3c 6d 00 00|00 00 6d 3c) addis r3,r13,0 +.*: (60 00 00 00|00 00 00 60) nop +.*: (38 63 10 00|00 10 63 38) addi r3,r3,4096 +.*: (3c 6d 00 00|00 00 6d 3c) addis r3,r13,0 +.*: (60 00 00 00|00 00 00 60) nop +.*: (38 63 90 40|40 90 63 38) addi r3,r3,-28608 +.*: (3c 6d 00 00|00 00 6d 3c) addis r3,r13,0 +.*: (60 00 00 00|00 00 00 60) nop +.*: (38 63 10 00|00 10 63 38) addi r3,r3,4096 +.*: (39 23 80 48|48 80 23 39) addi r9,r3,-32696 +.*: (3d 23 00 00|00 00 23 3d) addis r9,r3,0 +.*: (81 49 80 50|50 80 49 81) lwz r10,-32688\(r9\) +.*: (e9 22 80 10|10 80 22 e9) ld r9,-32752\(r2\) +.*: (7d 49 18 2a|2a 18 49 7d) ldx r10,r9,r3 +.*: (3d 2d 00 00|00 00 2d 3d) addis r9,r13,0 +.*: (a1 49 90 60|60 90 49 a1) lhz r10,-28576\(r9\) +.*: (89 4d 90 68|68 90 4d 89) lbz r10,-28568\(r13\) +.*: (3d 2d 00 00|00 00 2d 3d) addis r9,r13,0 +.*: (99 49 90 70|70 90 49 99) stb r10,-28560\(r9\) +.*: (3c 6d 00 00|00 00 6d 3c) addis r3,r13,0 +.*: (60 00 00 00|00 00 00 60) nop +.*: (38 63 90 00|00 90 63 38) addi r3,r3,-28672 +.*: (3c 6d 00 00|00 00 6d 3c) addis r3,r13,0 +.*: (60 00 00 00|00 00 00 60) nop +.*: (38 63 10 00|00 10 63 38) addi r3,r3,4096 +.*: (f9 43 80 08|08 80 43 f9) std r10,-32760\(r3\) +.*: (3d 23 00 00|00 00 23 3d) addis r9,r3,0 +.*: (91 49 80 10|10 80 49 91) stw r10,-32752\(r9\) +.*: (e9 22 80 08|08 80 22 e9) ld r9,-32760\(r2\) +.*: (7d 49 19 2a|2a 19 49 7d) stdx r10,r9,r3 +.*: (3d 2d 00 00|00 00 2d 3d) addis r9,r13,0 +.*: (b1 49 90 60|60 90 49 b1) sth r10,-28576\(r9\) +.*: (e9 4d 90 2a|2a 90 4d e9) lwa r10,-28632\(r13\) +.*: (3d 2d 00 00|00 00 2d 3d) addis r9,r13,0 +.*: (a9 49 90 30|30 90 49 a9) lha r10,-28624\(r9\) + +0+10000180 <\.__tls_get_addr>: +.*: (4e 80 00 20|20 00 80 4e) blr diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tls.g b/binutils-2.24/ld/testsuite/ld-powerpc/tls.g new file mode 100644 index 0000000..d4910ca --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tls.g @@ -0,0 +1,12 @@ +#source: tls.s +#source: tlslib.s +#as: -a64 +#ld: +#objdump: -sj.got +#target: powerpc64*-*-* + +.* + +Contents of section \.got: + 100101f8 (00000000|f8810110) (100181f8|00000000) (ffffffff|1880ffff) (ffff8018|ffffffff) .* + 10010208 (ffffffff|5880ffff) (ffff8058|ffffffff) .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tls.s b/binutils-2.24/ld/testsuite/ld-powerpc/tls.s new file mode 100644 index 0000000..49828d0 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tls.s @@ -0,0 +1,97 @@ + .section ".tbss","awT",@nobits + .global _start,gd0,ld0,ld1,ld2,ie0,le0,le1 + .align 3 +gd0: .space 8 +ld0: .space 8 +ld1: .space 8 +ld2: .space 8 +ie0: .space 8 +le0: .space 8 +le1: .space 8 + + .section ".tdata","awT",@progbits + .align 3 +gd4: .quad 0x123456789abcdef0 +ld4: .quad 0x23456789abcdef01 +ld5: .quad 0x3456789abcdef012 +ld6: .quad 0x456789abcdef0123 +ie4: .quad 0x56789abcdef01234 +le4: .quad 0x6789abcdef012345 +le5: .quad 0x789abcdef0123456 + + .section ".opd","aw",@progbits + .p2align 3 +_start: + .quad .L_start,.TOC.@tocbase,0 + + .text +.L_start: +#extern syms +#GD + addi 3,2,gd@got@tlsgd #R_PPC64_GOT_TLSGD16 gd + bl .__tls_get_addr #R_PPC64_REL24 .__tls_get_addr + nop + +#LD + addi 3,2,ld@got@tlsld #R_PPC64_GOT_TLSLD16 ld + bl .__tls_get_addr #R_PPC64_REL24 .__tls_get_addr + nop + +#global syms +#GD + addi 3,2,gd0@got@tlsgd #R_PPC64_GOT_TLSGD16 gd0 + bl .__tls_get_addr #R_PPC64_REL24 .__tls_get_addr + nop + +#LD + addi 3,2,ld0@got@tlsld #R_PPC64_GOT_TLSLD16 ld0 + bl .__tls_get_addr #R_PPC64_REL24 .__tls_get_addr + nop + + addi 9,3,ld0@dtprel #R_PPC64_DTPREL16 ld0 + + addis 9,3,ld1@dtprel@ha #R_PPC64_DTPREL16_HA ld1 + lwz 10,ld1@dtprel@l(9) #R_PPC64_DTPREL16_LO ld1 + + ld 9,ld2@got@dtprel(2) #R_PPC64_GOT_DTPREL16_DS ld2 + ldx 10,9,3 + +#IE + ld 9,ie0@got@tprel(2) #R_PPC64_GOT_TPREL16_DS ie0 + lhzx 10,9,ie0@tls #R_PPC64_TLS ie0 + +#LE + lbz 10,le0@tprel(13) #R_PPC64_TPREL16 le0 + + addis 9,13,le1@tprel@ha #R_PPC64_TPREL16_HA le1 + stb 10,le1@tprel@l(9) #R_PPC64_TPREL16_LO le1 + +#local syms +#GD + addi 3,2,gd4@got@tlsgd #R_PPC64_GOT_TLSGD16 gd4 + bl .__tls_get_addr #R_PPC64_REL24 .__tls_get_addr + nop + +#LD + addi 3,2,ld4@got@tlsld #R_PPC64_GOT_TLSLD16 ld4 + bl .__tls_get_addr #R_PPC64_REL24 .__tls_get_addr + nop + + std 10,ld4@dtprel(3) #R_PPC64_DTPREL16_DS ld4 + + addis 9,3,ld5@dtprel@ha #R_PPC64_DTPREL16_HA ld5 + stw 10,ld5@dtprel@l(9) #R_PPC64_DTPREL16_LO ld5 + + ld 9,ld6@got@dtprel(2) #R_PPC64_GOT_DTPREL16_DS ld6 + stdx 10,9,3 + +#IE + ld 9,ie0@got@tprel(2) #R_PPC64_GOT_TPREL16_DS ie4 + sthx 10,9,ie0@tls #R_PPC64_TLS ie4 + +#LE + lwa 10,le4@tprel(13) #R_PPC64_TPREL16 le4 + + addis 9,13,le5@tprel@ha #R_PPC64_TPREL16_HA le5 + lha 10,le5@tprel@l(9) #R_PPC64_TPREL16_LO le5 + diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tls.t b/binutils-2.24/ld/testsuite/ld-powerpc/tls.t new file mode 100644 index 0000000..d54f25e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tls.t @@ -0,0 +1,14 @@ +#source: tls.s +#source: tlslib.s +#as: -a64 +#ld: +#objdump: -sj.tdata +#target: powerpc64*-*-* + +.* + +Contents of section \.tdata: +.* (12345678|f0debc9a) (9abcdef0|78563412) (23456789|01efcdab) (abcdef01|89674523) .* +.* (3456789a|12f0debc) (bcdef012|9a785634) (456789ab|2301efcd) (cdef0123|ab896745) .* +.* (56789abc|3412f0de) (def01234|bc9a7856) (6789abcd|452301ef) (ef012345|cdab8967) .* +.* (789abcde|563412f0) (f0123456|debc9a78) (00c0ffee|eeffc000) .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tls32.d b/binutils-2.24/ld/testsuite/ld-powerpc/tls32.d new file mode 100644 index 0000000..2b7d0a0 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tls32.d @@ -0,0 +1,50 @@ +#source: tls32.s +#source: tlslib32.s +#as: -a32 +#ld: +#objdump: -dr +#target: powerpc*-*-* + +.* + +Disassembly of section \.text: + +0+1800094 <_start>: +.*: (3c 62 00 00|00 00 62 3c) addis r3,r2,0 +.*: (38 63 90 3c|3c 90 63 38) addi r3,r3,-28612 +.*: (3c 62 00 00|00 00 62 3c) addis r3,r2,0 +.*: (38 63 10 00|00 10 63 38) addi r3,r3,4096 +.*: (3c 62 00 00|00 00 62 3c) addis r3,r2,0 +.*: (38 63 90 20|20 90 63 38) addi r3,r3,-28640 +.*: (3c 62 00 00|00 00 62 3c) addis r3,r2,0 +.*: (38 63 10 00|00 10 63 38) addi r3,r3,4096 +.*: (39 23 80 24|24 80 23 39) addi r9,r3,-32732 +.*: (3d 23 00 00|00 00 23 3d) addis r9,r3,0 +.*: (81 49 80 28|28 80 49 81) lwz r10,-32728\(r9\) +.*: (3d 22 00 00|00 00 22 3d) addis r9,r2,0 +.*: (a1 49 90 30|30 90 49 a1) lhz r10,-28624\(r9\) +.*: (89 42 90 34|34 90 42 89) lbz r10,-28620\(r2\) +.*: (3d 22 00 00|00 00 22 3d) addis r9,r2,0 +.*: (99 49 90 38|38 90 49 99) stb r10,-28616\(r9\) +.*: (3c 62 00 00|00 00 62 3c) addis r3,r2,0 +.*: (38 63 90 00|00 90 63 38) addi r3,r3,-28672 +.*: (3c 62 00 00|00 00 62 3c) addis r3,r2,0 +.*: (38 63 10 00|00 10 63 38) addi r3,r3,4096 +.*: (91 43 80 04|04 80 43 91) stw r10,-32764\(r3\) +.*: (3d 23 00 00|00 00 23 3d) addis r9,r3,0 +.*: (91 49 80 08|08 80 49 91) stw r10,-32760\(r9\) +.*: (3d 22 00 00|00 00 22 3d) addis r9,r2,0 +.*: (b1 49 90 30|30 90 49 b1) sth r10,-28624\(r9\) +.*: (a1 42 90 14|14 90 42 a1) lhz r10,-28652\(r2\) +.*: (3d 22 00 00|00 00 22 3d) addis r9,r2,0 +.*: (a9 49 90 18|18 90 49 a9) lha r10,-28648\(r9\) + +0+1800104 <__tls_get_addr>: +.*: (4e 80 00 20|20 00 80 4e) blr +Disassembly of section \.got: + +0+1810128 <_GLOBAL_OFFSET_TABLE_-0x4>: +.*: (4e 80 00 21|21 00 80 4e) blrl + +0+181012c <_GLOBAL_OFFSET_TABLE_>: + \.\.\. diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tls32.g b/binutils-2.24/ld/testsuite/ld-powerpc/tls32.g new file mode 100644 index 0000000..cbf93cc --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tls32.g @@ -0,0 +1,11 @@ +#source: tls32.s +#source: tlslib32.s +#as: -a32 +#ld: +#objdump: -sj.got +#target: powerpc*-*-* + +.* + +Contents of section \.got: + 1810128 (4e800021|2100804e) 00000000 00000000 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tls32.s b/binutils-2.24/ld/testsuite/ld-powerpc/tls32.s new file mode 100644 index 0000000..1c3092d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tls32.s @@ -0,0 +1,80 @@ + .section ".tbss","awT",@nobits + .global _start,gd0,ld0,ld1,ld2,ie0,le0,le1 + .align 2 +gd0: .space 4 +ld0: .space 4 +ld1: .space 4 +ld2: .space 4 +ie0: .space 4 +le0: .space 4 +le1: .space 4 + + .section ".tdata","awT",@progbits + .align 2 +gd4: .long 0x12345678 +ld4: .long 0x23456789 +ld5: .long 0x3456789a +ld6: .long 0x456789ab +ie4: .long 0x56789abc +le4: .long 0x6789abcd +le5: .long 0x789abcde + + .text +_start: +#extern syms +#GD + addi 3,31,gd@got@tlsgd #R_PPC_GOT_TLSGD16 gd + bl __tls_get_addr #R_PPC_REL24 __tls_get_addr + +#LD + addi 3,31,ld@got@tlsld #R_PPC_GOT_TLSLD16 ld + bl __tls_get_addr #R_PPC_REL24 __tls_get_addr + +#global syms +#GD + addi 3,31,gd0@got@tlsgd #R_PPC_GOT_TLSGD16 gd0 + bl __tls_get_addr+0x8000@plt #R_PPC_PLTREL24 __tls_get_addr + +#LD + addi 3,31,ld0@got@tlsld #R_PPC_GOT_TLSLD16 ld0 + bl __tls_get_addr+0x8000@plt #R_PPC_PLTREL24 __tls_get_addr + + addi 9,3,ld0@dtprel #R_PPC_DTPREL16 ld0 + + addis 9,3,ld1@dtprel@ha #R_PPC_DTPREL16_HA ld1 + lwz 10,ld1@dtprel@l(9) #R_PPC_DTPREL16_LO ld1 + +#IE + lwz 9,ie0@got@tprel(31) #R_PPC_GOT_TPREL16 ie0 + lhzx 10,9,ie0@tls #R_PPC_TLS ie0 + +#LE + lbz 10,le0@tprel(2) #R_PPC_TPREL16 le0 + + addis 9,2,le1@tprel@ha #R_PPC_TPREL16_HA le1 + stb 10,le1@tprel@l(9) #R_PPC_TPREL16_LO le1 + +#local syms, use a different got reg too. +#GD + addi 3,30,gd4@got@tlsgd #R_PPC_GOT_TLSGD16 gd4 + bl __tls_get_addr #R_PPC_REL24 __tls_get_addr + +#LD + addi 3,30,ld4@got@tlsld #R_PPC_GOT_TLSLD16 ld4 + bl __tls_get_addr #R_PPC_REL24 __tls_get_addr + + stw 10,ld4@dtprel(3) #R_PPC_DTPREL16 ld4 + + addis 9,3,ld5@dtprel@ha #R_PPC_DTPREL16_HA ld5 + stw 10,ld5@dtprel@l(9) #R_PPC_DTPREL16_LO ld5 + +#IE + lwz 9,ie0@got@tprel(30) #R_PPC_GOT_TPREL16 ie4 + sthx 10,9,ie0@tls #R_PPC_TLS ie4 + +#LE + lhz 10,le4@tprel(2) #R_PPC_TPREL16 le4 + + addis 9,2,le5@tprel@ha #R_PPC_TPREL16_HA le5 + lha 10,le5@tprel@l(9) #R_PPC_TPREL16_LO le5 + diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tls32.t b/binutils-2.24/ld/testsuite/ld-powerpc/tls32.t new file mode 100644 index 0000000..c8b6cb4 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tls32.t @@ -0,0 +1,12 @@ +#source: tls32.s +#source: tlslib32.s +#as: -a32 +#ld: +#objdump: -sj.tdata +#target: powerpc*-*-* + +.* + +Contents of section \.tdata: + 1810108 (12345678|78563412) (23456789|89674523) (3456789a|9a785634) (456789ab|ab896745) .* + 1810118 (56789abc|bc9a7856) (6789abcd|cdab8967) (789abcde|debc9a78) (00c0ffee|eeffc000) .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsexe.d b/binutils-2.24/ld/testsuite/ld-powerpc/tlsexe.d new file mode 100644 index 0000000..747b5e1 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsexe.d @@ -0,0 +1,89 @@ +#source: tls.s +#as: -a64 +#ld: tmpdir/libtlslib.so +#objdump: -dr +#target: powerpc64*-*-* + +.* + +Disassembly of section \.text: + +.* <.*plt_call\.__tls_get_addr(|_opt)>: +.* (e9 63 00 00|00 00 63 e9) ld r11,0\(r3\) +.* (e9 83 00 08|08 00 83 e9) ld r12,8\(r3\) +.* (7c 60 1b 78|78 1b 60 7c) mr r0,r3 +.* (2c 2b 00 00|00 00 2b 2c) cmpdi r11,0 +.* (7c 6c 6a 14|14 6a 6c 7c) add r3,r12,r13 +.* (4d 82 00 20|20 00 82 4d) beqlr * +.* (7c 03 03 78|78 03 03 7c) mr r3,r0 +.* (7d 68 02 a6|a6 02 68 7d) mflr r11 +.* (f9 61 00 20|20 00 61 f9) std r11,32\(r1\) +.* (f8 41 00 28|28 00 41 f8) std r2,40\(r1\) +.* (e9 82 80 48|48 80 82 e9) ld r12,-32696\(r2\) +.* (7d 89 03 a6|a6 03 89 7d) mtctr r12 +.* (e8 42 80 50|50 80 42 e8) ld r2,-32688\(r2\) +.* (4e 80 04 21|21 04 80 4e) bctrl +.* (e9 61 00 20|20 00 61 e9) ld r11,32\(r1\) +.* (e8 41 00 28|28 00 41 e8) ld r2,40\(r1\) +.* (7d 68 03 a6|a6 03 68 7d) mtlr r11 +.* (4e 80 00 20|20 00 80 4e) blr + +.* <._start>: +.* (e8 62 80 10|10 80 62 e8) ld r3,-32752\(r2\) +.* (60 00 00 00|00 00 00 60) nop +.* (7c 63 6a 14|14 6a 63 7c) add r3,r3,r13 +.* (38 62 80 18|18 80 62 38) addi r3,r2,-32744 +.* (4b ff ff a9|a9 ff ff 4b) bl .* +.* (60 00 00 00|00 00 00 60) nop +.* (3c 6d 00 00|00 00 6d 3c) addis r3,r13,0 +.* (60 00 00 00|00 00 00 60) nop +.* (38 63 90 38|38 90 63 38) addi r3,r3,-28616 +.* (3c 6d 00 00|00 00 6d 3c) addis r3,r13,0 +.* (60 00 00 00|00 00 00 60) nop +.* (38 63 10 00|00 10 63 38) addi r3,r3,4096 +.* (39 23 80 40|40 80 23 39) addi r9,r3,-32704 +.* (3d 23 00 00|00 00 23 3d) addis r9,r3,0 +.* (81 49 80 48|48 80 49 81) lwz r10,-32696\(r9\) +.* (e9 22 80 28|28 80 22 e9) ld r9,-32728\(r2\) +.* (7d 49 18 2a|2a 18 49 7d) ldx r10,r9,r3 +.* (3d 2d 00 00|00 00 2d 3d) addis r9,r13,0 +.* (a1 49 90 58|58 90 49 a1) lhz r10,-28584\(r9\) +.* (89 4d 90 60|60 90 4d 89) lbz r10,-28576\(r13\) +.* (3d 2d 00 00|00 00 2d 3d) addis r9,r13,0 +.* (99 49 90 68|68 90 49 99) stb r10,-28568\(r9\) +.* (3c 6d 00 00|00 00 6d 3c) addis r3,r13,0 +.* (60 00 00 00|00 00 00 60) nop +.* (38 63 90 00|00 90 63 38) addi r3,r3,-28672 +.* (3c 6d 00 00|00 00 6d 3c) addis r3,r13,0 +.* (60 00 00 00|00 00 00 60) nop +.* (38 63 10 00|00 10 63 38) addi r3,r3,4096 +.* (f9 43 80 08|08 80 43 f9) std r10,-32760\(r3\) +.* (3d 23 00 00|00 00 23 3d) addis r9,r3,0 +.* (91 49 80 10|10 80 49 91) stw r10,-32752\(r9\) +.* (e9 22 80 08|08 80 22 e9) ld r9,-32760\(r2\) +.* (7d 49 19 2a|2a 19 49 7d) stdx r10,r9,r3 +.* (3d 2d 00 00|00 00 2d 3d) addis r9,r13,0 +.* (b1 49 90 58|58 90 49 b1) sth r10,-28584\(r9\) +.* (e9 4d 90 2a|2a 90 4d e9) lwa r10,-28632\(r13\) +.* (3d 2d 00 00|00 00 2d 3d) addis r9,r13,0 +.* (a9 49 90 30|30 90 49 a9) lha r10,-28624\(r9\) +.* (00 00 00 00|18 02 01 00) .* +.* (00 01 02 18|00 00 00 00) .* +.* <__glink_PLTresolve>: +.* (7d 88 02 a6|a6 02 88 7d) mflr r12 +.* (42 9f 00 05|05 00 9f 42) bcl 20,4\*cr7\+so,.* +.* (7d 68 02 a6|a6 02 68 7d) mflr r11 +.* (e8 4b ff f0|f0 ff 4b e8) ld r2,-16\(r11\) +.* (7d 88 03 a6|a6 03 88 7d) mtlr r12 +.* (7d 62 5a 14|14 5a 62 7d) add r11,r2,r11 +.* (e9 8b 00 00|00 00 8b e9) ld r12,0\(r11\) +.* (e8 4b 00 08|08 00 4b e8) ld r2,8\(r11\) +.* (7d 89 03 a6|a6 03 89 7d) mtctr r12 +.* (e9 6b 00 10|10 00 6b e9) ld r11,16\(r11\) +.* (4e 80 04 20|20 04 80 4e) bctr +.* (60 00 00 00|00 00 00 60) nop +.* (60 00 00 00|00 00 00 60) nop +.* (60 00 00 00|00 00 00 60) nop +.* <__tls_get_addr_opt@plt>: +.* (38 00 00 00|00 00 00 38) li r0,0 +.* (4b ff ff c4|c4 ff ff 4b) b .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsexe.g b/binutils-2.24/ld/testsuite/ld-powerpc/tlsexe.g new file mode 100644 index 0000000..fb8dbb3 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsexe.g @@ -0,0 +1,12 @@ +#source: tls.s +#as: -a64 +#ld: tmpdir/libtlslib.so +#objdump: -sj.got +#target: powerpc64*-*-* + +.* + +Contents of section \.got: +.* (00000000|38860110) (10018638|00000000) (ffffffff|1880ffff) (ffff8018|ffffffff) .* +.* 00000000 00000000 00000000 00000000 .* +.* 00000000 00000000 00000000 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsexe.r b/binutils-2.24/ld/testsuite/ld-powerpc/tlsexe.r new file mode 100644 index 0000000..f78f300 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsexe.r @@ -0,0 +1,117 @@ +#source: tls.s +#source: tlslib.s +#as: -a64 +#ld: +#readelf: -WSsrl +#target: powerpc64*-*-* + +There are [0-9]+ section headers, starting at offset 0x[0-9a-f]+: + +Section Headers: + +\[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al + +\[[ 0-9]+\] +NULL +0+ 0+ 0+ 0+ +0 +0 +0 + +\[[ 0-9]+\] \.interp +.* + +\[[ 0-9]+\] \.hash +.* + +\[[ 0-9]+\] \.dynsym +.* + +\[[ 0-9]+\] \.dynstr +.* + +\[[ 0-9]+\] \.rela\.dyn +.* + +\[[ 0-9]+\] \.rela\.plt +.* + +\[[ 0-9]+\] \.text +PROGBITS .* 0+128 0+ +AX +0 +0 +32 + +\[[ 0-9]+\] \.tdata +PROGBITS .* 0+38 0+ WAT +0 +0 +8 + +\[[ 0-9]+\] \.tbss +NOBITS .* 0+38 0+ WAT +0 +0 +8 + +\[[ 0-9]+\] \.dynamic +DYNAMIC .* 0+160 10 +WA +4 +0 +8 + +\[[ 0-9]+\] \.opd .* + +\[[ 0-9]+\] \.got +PROGBITS .* 0+30 08 +WA +0 +0 +8 + +\[[ 0-9]+\] \.plt +.* + +\[[ 0-9]+\] \.shstrtab +.* + +\[[ 0-9]+\] \.symtab +.* + +\[[ 0-9]+\] \.strtab +.* +#... + +Elf file type is EXEC \(Executable file\) +Entry point .* +There are [0-9]+ program headers, starting at offset [0-9]+ + +Program Headers: + +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align + +PHDR +0x0+40 0x0+10000040 0x0+10000040 0x0+150 0x0+150 R E 0x8 + +INTERP +0x0+190 0x0+10000190 0x0+10000190 0x0+11 0x0+11 R +0x1 + +\[Requesting program interpreter: .*\] + +LOAD .* R E 0x10000 + +LOAD .* RW +0x10000 + +DYNAMIC .* RW +0x8 + +TLS .* 0x0+38 0x0+70 R +0x8 + + Section to Segment mapping: + +Segment Sections\.\.\. + +0+ + + +01 +\.interp * + +02 +\.interp \.hash \.dynsym \.dynstr \.rela\.dyn \.rela\.plt \.text * + +03 +\.tdata \.dynamic \.opd \.got \.plt * + +04 +\.dynamic * + +05 +\.tdata \.tbss * + +Relocation section '\.rela\.dyn' at offset .* contains 3 entries: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend +[0-9a-f ]+R_PPC64_TPREL64 +0+ gd \+ 0 +[0-9a-f ]+R_PPC64_DTPMOD64 +0+ ld \+ 0 +[0-9a-f ]+R_PPC64_DTPREL64 +0+50 ld2 \+ 0 + +Relocation section '\.rela\.plt' at offset .* contains 1 entries: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend +[0-9a-f ]+R_PPC64_JMP_SLOT +0+ __tls_get_addr_opt \+ 0 + +Symbol table '\.dynsym' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +.* NOTYPE +LOCAL +DEFAULT +UND * +.* TLS +GLOBAL +DEFAULT +UND gd +.* TLS +GLOBAL +DEFAULT +UND ld +.* 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 _end + +Symbol table '\.symtab' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +.* 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND * +.* SECTION +LOCAL +DEFAULT +1 * +.* SECTION +LOCAL +DEFAULT +2 * +.* SECTION +LOCAL +DEFAULT +3 * +.* SECTION +LOCAL +DEFAULT +4 * +.* SECTION +LOCAL +DEFAULT +5 * +.* SECTION +LOCAL +DEFAULT +6 * +.* SECTION +LOCAL +DEFAULT +7 * +.* SECTION +LOCAL +DEFAULT +8 * +.* SECTION +LOCAL +DEFAULT +9 * +.* SECTION +LOCAL +DEFAULT +10 * +.* SECTION +LOCAL +DEFAULT +11 * +.* SECTION +LOCAL +DEFAULT +12 * +.* SECTION +LOCAL +DEFAULT +13 * +.* FILE +LOCAL +DEFAULT +ABS .* +.* TLS +LOCAL +DEFAULT +8 gd4 +.* TLS +LOCAL +DEFAULT +8 ld4 +.* TLS +LOCAL +DEFAULT +8 ld5 +.* TLS +LOCAL +DEFAULT +8 ld6 +.* TLS +LOCAL +DEFAULT +8 ie4 +.* TLS +LOCAL +DEFAULT +8 le4 +.* TLS +LOCAL +DEFAULT +8 le5 +.* (FUNC|NOTYPE) +LOCAL +DEFAULT +UND \.__tls_get_addr(|_opt) +.* FILE +LOCAL +DEFAULT +ABS .* +.* OBJECT +LOCAL +DEFAULT +10 _DYNAMIC +.* NOTYPE +LOCAL +DEFAULT +7 __glink_PLTresolve +.* NOTYPE +LOCAL +DEFAULT +7 .*\.plt_call\.__tls_get_addr(|_opt) +.* GLOBAL +DEFAULT +UND gd +.* GLOBAL +DEFAULT +9 le0 +.* GLOBAL +DEFAULT +9 ld0 +.* GLOBAL +DEFAULT +9 le1 +.* GLOBAL +DEFAULT +UND ld +.* FUNC +GLOBAL +DEFAULT +11 _start +.* TLS +GLOBAL +DEFAULT +9 ld2 +.* 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 _end +.* TLS +GLOBAL +DEFAULT +9 gd0 +.* TLS +GLOBAL +DEFAULT +9 ie0 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsexe.t b/binutils-2.24/ld/testsuite/ld-powerpc/tlsexe.t new file mode 100644 index 0000000..ee25c52 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsexe.t @@ -0,0 +1,13 @@ +#source: tls.s +#as: -a64 +#ld: tmpdir/libtlslib.so +#objdump: -sj.tdata +#target: powerpc64*-*-* + +.* + +Contents of section \.tdata: + .* (12345678|f0debc9a) (9abcdef0|78563412) (23456789|01efcdab) (abcdef01|89674523) .* + .* (3456789a|12f0debc) (bcdef012|9a785634) (456789ab|2301efcd) (cdef0123|ab896745) .* + .* (56789abc|3412f0de) (def01234|bc9a7856) (6789abcd|452301ef) (ef012345|cdab8967) .* + .* (789abcde|563412f0) (f0123456|debc9a78) .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsexe32.d b/binutils-2.24/ld/testsuite/ld-powerpc/tlsexe32.d new file mode 100644 index 0000000..d0579ce --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsexe32.d @@ -0,0 +1,47 @@ +#source: tls32.s +#as: -a32 +#ld: tmpdir/libtlslib32.so +#objdump: -dr +#target: powerpc*-*-* + +.* + +Disassembly of section \.text: + +.* <_start>: +.*: (80 7f ff f0|f0 ff 7f 80) lwz r3,-16\(r31\) +.*: (7c 63 12 14|14 12 63 7c) add r3,r3,r2 +.*: (38 7f ff f4|f4 ff 7f 38) addi r3,r31,-12 +.*: (48 01 01 85|85 01 01 48) bl .*<__tls_get_addr_opt@plt> +.*: (3c 62 00 00|00 00 62 3c) addis r3,r2,0 +.*: (38 63 90 1c|1c 90 63 38) addi r3,r3,-28644 +.*: (3c 62 00 00|00 00 62 3c) addis r3,r2,0 +.*: (38 63 10 00|00 10 63 38) addi r3,r3,4096 +.*: (39 23 80 20|20 80 23 39) addi r9,r3,-32736 +.*: (3d 23 00 00|00 00 23 3d) addis r9,r3,0 +.*: (81 49 80 24|24 80 49 81) lwz r10,-32732\(r9\) +.*: (3d 22 00 00|00 00 22 3d) addis r9,r2,0 +.*: (a1 49 90 2c|2c 90 49 a1) lhz r10,-28628\(r9\) +.*: (89 42 90 30|30 90 42 89) lbz r10,-28624\(r2\) +.*: (3d 22 00 00|00 00 22 3d) addis r9,r2,0 +.*: (99 49 90 34|34 90 49 99) stb r10,-28620\(r9\) +.*: (3c 62 00 00|00 00 62 3c) addis r3,r2,0 +.*: (38 63 90 00|00 90 63 38) addi r3,r3,-28672 +.*: (3c 62 00 00|00 00 62 3c) addis r3,r2,0 +.*: (38 63 10 00|00 10 63 38) addi r3,r3,4096 +.*: (91 43 80 04|04 80 43 91) stw r10,-32764\(r3\) +.*: (3d 23 00 00|00 00 23 3d) addis r9,r3,0 +.*: (91 49 80 08|08 80 49 91) stw r10,-32760\(r9\) +.*: (3d 22 00 00|00 00 22 3d) addis r9,r2,0 +.*: (b1 49 90 2c|2c 90 49 b1) sth r10,-28628\(r9\) +.*: (a1 42 90 14|14 90 42 a1) lhz r10,-28652\(r2\) +.*: (3d 22 00 00|00 00 22 3d) addis r9,r2,0 +.*: (a9 49 90 18|18 90 49 a9) lha r10,-28648\(r9\) +Disassembly of section \.got: + +.* <_GLOBAL_OFFSET_TABLE_-0x10>: + \.\.\. +.*: (4e 80 00 21|21 00 80 4e) blrl + +.* <_GLOBAL_OFFSET_TABLE_>: +.*: (01 81 02 b8|b8 02 81 01) 00 00 00 00 00 00 00 00 .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsexe32.g b/binutils-2.24/ld/testsuite/ld-powerpc/tlsexe32.g new file mode 100644 index 0000000..917ca4d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsexe32.g @@ -0,0 +1,11 @@ +#source: tls32.s +#as: -a32 +#ld: tmpdir/libtlslib32.so +#objdump: -sj.got +#target: powerpc*-*-* + +.* + +Contents of section \.got: +.* 00000000 00000000 00000000 (4e800021|2100804e) .* +.* (018102b8|b8028101) 00000000 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsexe32.r b/binutils-2.24/ld/testsuite/ld-powerpc/tlsexe32.r new file mode 100644 index 0000000..dea4a0d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsexe32.r @@ -0,0 +1,113 @@ +#source: tls32.s +#source: tlslib32.s +#as: -a32 +#ld: +#readelf: -WSsrl +#target: powerpc*-*-* + +There are [0-9]+ section headers, starting at offset 0x[0-9a-f]+: + +Section Headers: + +\[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al + +\[[ 0-9]+\] +NULL +0+ 0+ 0+ 00 +0 +0 +0 + +\[[ 0-9]+\] \.interp +.* + +\[[ 0-9]+\] \.hash +.* + +\[[ 0-9]+\] \.dynsym +.* + +\[[ 0-9]+\] \.dynstr +.* + +\[[ 0-9]+\] \.rela\.dyn +.* + +\[[ 0-9]+\] \.rela\.plt +.* + +\[[ 0-9]+\] \.text +PROGBITS +[0-9a-f]+ [0-9a-f]+ 000070 00 +AX +0 +0 +1 + +\[[ 0-9]+\] \.tdata +PROGBITS +[0-9a-f]+ [0-9a-f]+ 00001c 00 WAT +0 +0 +4 + +\[[ 0-9]+\] \.tbss +NOBITS +[0-9a-f]+ [0-9a-f]+ 00001c 00 WAT +0 +0 +4 + +\[[ 0-9]+\] \.dynamic +DYNAMIC +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 08 +WA +4 +0 +4 + +\[[ 0-9]+\] \.got +PROGBITS +[0-9a-f]+ [0-9a-f]+ 00001c 04 WAX +0 +0 +4 + +\[[ 0-9]+\] \.plt +NOBITS +.* + +\[[ 0-9]+\] \.shstrtab +STRTAB +.* + +\[[ 0-9]+\] \.symtab +SYMTAB +.* + +\[[ 0-9]+\] \.strtab +STRTAB +.* +#... + +Elf file type is EXEC \(Executable file\) +Entry point .* +There are [0-9]+ program headers, starting at offset [0-9]+ + +Program Headers: + +Type +Offset +VirtAddr +PhysAddr +FileSiz MemSiz +Flg Align + +PHDR +0x000034 0x01800034 0x01800034 0x000c0 0x000c0 R E 0x4 + +INTERP +0x0000f4 0x018000f4 0x018000f4 0x00011 0x00011 R +0x1 + +\[Requesting program interpreter: .*\] + +LOAD .* R E 0x10000 + +LOAD .* RWE 0x10000 + +DYNAMIC .* RW +0x4 + +TLS .* 0x0001c 0x00038 R +0x4 + + Section to Segment mapping: + +Segment Sections\.\.\. + +00 + + +01 +\.interp + +02 +\.interp \.hash \.dynsym \.dynstr \.rela\.dyn \.rela\.plt \.text + +03 +\.tdata \.dynamic \.got \.plt + +04 +\.dynamic + +05 +\.tdata \.tbss + +Relocation section '\.rela\.dyn' at offset .* contains 2 entries: + Offset +Info +Type +Sym\. Value +Symbol's Name \+ Addend +[0-9a-f ]+R_PPC_TPREL32 +00000000 +gd \+ 0 +[0-9a-f ]+R_PPC_DTPMOD32 +00000000 +ld \+ 0 + +Relocation section '\.rela\.plt' at offset .* contains 1 entries: + Offset +Info +Type +Sym\. Value +Symbol's Name \+ Addend +[0-9a-f ]+R_PPC_JMP_SLOT[0-9a-f ]+__tls_get_addr_opt \+ 0 + +Symbol table '\.dynsym' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +.* NOTYPE +LOCAL +DEFAULT +UND +.* TLS +GLOBAL +DEFAULT +UND gd +.* TLS +GLOBAL +DEFAULT +UND ld +.* NOTYPE +GLOBAL +DEFAULT +12 __end +.* NOTYPE +GLOBAL +DEFAULT +12 __bss_start +.* FUNC +GLOBAL +DEFAULT +UND __tls_get_addr_opt +.* NOTYPE +GLOBAL +DEFAULT +11 _edata +.* NOTYPE +GLOBAL +DEFAULT +12 _end + +Symbol table '\.symtab' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +.* NOTYPE +LOCAL +DEFAULT +UND +.* SECTION +LOCAL +DEFAULT +1 +.* SECTION +LOCAL +DEFAULT +2 +.* SECTION +LOCAL +DEFAULT +3 +.* SECTION +LOCAL +DEFAULT +4 +.* SECTION +LOCAL +DEFAULT +5 +.* SECTION +LOCAL +DEFAULT +6 +.* SECTION +LOCAL +DEFAULT +7 +.* SECTION +LOCAL +DEFAULT +8 +.* SECTION +LOCAL +DEFAULT +9 +.* SECTION +LOCAL +DEFAULT +10 +.* SECTION +LOCAL +DEFAULT +11 +.* SECTION +LOCAL +DEFAULT +12 +.* FILE +LOCAL +DEFAULT +ABS .* +.* TLS +LOCAL +DEFAULT +8 gd4 +.* TLS +LOCAL +DEFAULT +8 ld4 +.* TLS +LOCAL +DEFAULT +8 ld5 +.* TLS +LOCAL +DEFAULT +8 ld6 +.* TLS +LOCAL +DEFAULT +8 ie4 +.* TLS +LOCAL +DEFAULT +8 le4 +.* TLS +LOCAL +DEFAULT +8 le5 +.* FILE +LOCAL +DEFAULT +ABS .* +.* OBJECT +LOCAL +DEFAULT +10 _DYNAMIC +.* OBJECT +LOCAL +DEFAULT +11 _GLOBAL_OFFSET_TABLE_ +.* TLS +GLOBAL +DEFAULT +UND gd +.* TLS +GLOBAL +DEFAULT +9 le0 +.* TLS +GLOBAL +DEFAULT +9 ld0 +.* TLS +GLOBAL +DEFAULT +9 le1 +.* TLS +GLOBAL +DEFAULT +UND ld +.* NOTYPE +GLOBAL +DEFAULT +7 _start +.* NOTYPE +GLOBAL +DEFAULT +12 __end +.* TLS +GLOBAL +DEFAULT +9 ld2 +.* TLS +GLOBAL +DEFAULT +9 ld1 +.* NOTYPE +GLOBAL +DEFAULT +12 __bss_start +.* FUNC +GLOBAL +DEFAULT +UND __tls_get_addr_opt +.* NOTYPE +GLOBAL +DEFAULT +11 _edata +.* NOTYPE +GLOBAL +DEFAULT +12 _end +.* TLS +GLOBAL +DEFAULT +9 gd0 +.* TLS +GLOBAL +DEFAULT +9 ie0 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsexe32.t b/binutils-2.24/ld/testsuite/ld-powerpc/tlsexe32.t new file mode 100644 index 0000000..58fca71 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsexe32.t @@ -0,0 +1,11 @@ +#source: tls32.s +#as: -a32 +#ld: tmpdir/libtlslib32.so +#objdump: -sj.tdata +#target: powerpc*-*-* + +.* + +Contents of section \.tdata: +.* (12345678|78563412) (23456789|89674523) (3456789a|9a785634) (456789ab|ab896745) .* +.* (56789abc|bc9a7856) (6789abcd|cdab8967) (789abcde|debc9a78) .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsexetoc.d b/binutils-2.24/ld/testsuite/ld-powerpc/tlsexetoc.d new file mode 100644 index 0000000..f38ca9c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsexetoc.d @@ -0,0 +1,73 @@ +#source: tlstoc.s +#as: -a64 +#ld: tmpdir/libtlslib.so +#objdump: -dr +#target: powerpc64*-*-* + +.* + +Disassembly of section \.text: + +.* <.*plt_call\.__tls_get_addr(|_opt)>: +.* (e9 63 00 00|00 00 63 e9) ld r11,0\(r3\) +.* (e9 83 00 08|08 00 83 e9) ld r12,8\(r3\) +.* (7c 60 1b 78|78 1b 60 7c) mr r0,r3 +.* (2c 2b 00 00|00 00 2b 2c) cmpdi r11,0 +.* (7c 6c 6a 14|14 6a 6c 7c) add r3,r12,r13 +.* (4d 82 00 20|20 00 82 4d) beqlr * +.* (7c 03 03 78|78 03 03 7c) mr r3,r0 +.* (7d 68 02 a6|a6 02 68 7d) mflr r11 +.* (f9 61 00 20|20 00 61 f9) std r11,32\(r1\) +.* (f8 41 00 28|28 00 41 f8) std r2,40\(r1\) +.* (e9 82 80 70|70 80 82 e9) ld r12,-32656\(r2\) +.* (7d 89 03 a6|a6 03 89 7d) mtctr r12 +.* (e8 42 80 78|78 80 42 e8) ld r2,-32648\(r2\) +.* (4e 80 04 21|21 04 80 4e) bctrl +.* (e9 61 00 20|20 00 61 e9) ld r11,32\(r1\) +.* (e8 41 00 28|28 00 41 e8) ld r2,40\(r1\) +.* (7d 68 03 a6|a6 03 68 7d) mtlr r11 +.* (4e 80 00 20|20 00 80 4e) blr + +.* <\._start>: +.* (38 62 80 08|08 80 62 38) addi r3,r2,-32760 +.* (4b ff ff b5|b5 ff ff 4b) bl .* +.* (60 00 00 00|00 00 00 60) nop +.* (38 62 80 18|18 80 62 38) addi r3,r2,-32744 +.* (4b ff ff a9|a9 ff ff 4b) bl .* +.* (60 00 00 00|00 00 00 60) nop +.* (3c 6d 00 00|00 00 6d 3c) addis r3,r13,0 +.* (60 00 00 00|00 00 00 60) nop +.* (38 63 90 38|38 90 63 38) addi r3,r3,-28616 +.* (3c 6d 00 00|00 00 6d 3c) addis r3,r13,0 +.* (60 00 00 00|00 00 00 60) nop +.* (38 63 10 00|00 10 63 38) addi r3,r3,4096 +.* (39 23 80 40|40 80 23 39) addi r9,r3,-32704 +.* (3d 23 00 00|00 00 23 3d) addis r9,r3,0 +.* (81 49 80 48|48 80 49 81) lwz r10,-32696\(r9\) +.* (e9 22 80 48|48 80 22 e9) ld r9,-32696\(r2\) +.* (7d 49 18 2a|2a 18 49 7d) ldx r10,r9,r3 +.* (3d 2d 00 00|00 00 2d 3d) addis r9,r13,0 +.* (a1 49 90 58|58 90 49 a1) lhz r10,-28584\(r9\) +.* (89 4d 90 60|60 90 4d 89) lbz r10,-28576\(r13\) +.* (3d 2d 00 00|00 00 2d 3d) addis r9,r13,0 +.* (99 49 90 68|68 90 49 99) stb r10,-28568\(r9\) +.* (00 00 00 00|40 02 01 00) .* +.* (00 01 02 40|00 00 00 00) .* +.* <__glink_PLTresolve>: +.* (7d 88 02 a6|a6 02 88 7d) mflr r12 +.* (42 9f 00 05|05 00 9f 42) bcl 20,4\*cr7\+so,.* +.* (7d 68 02 a6|a6 02 68 7d) mflr r11 +.* (e8 4b ff f0|f0 ff 4b e8) ld r2,-16\(r11\) +.* (7d 88 03 a6|a6 03 88 7d) mtlr r12 +.* (7d 62 5a 14|14 5a 62 7d) add r11,r2,r11 +.* (e9 8b 00 00|00 00 8b e9) ld r12,0\(r11\) +.* (e8 4b 00 08|08 00 4b e8) ld r2,8\(r11\) +.* (7d 89 03 a6|a6 03 89 7d) mtctr r12 +.* (e9 6b 00 10|10 00 6b e9) ld r11,16\(r11\) +.* (4e 80 04 20|20 04 80 4e) bctr +.* (60 00 00 00|00 00 00 60) nop +.* (60 00 00 00|00 00 00 60) nop +.* (60 00 00 00|00 00 00 60) nop +.* <__tls_get_addr_opt@plt>: +.* (38 00 00 00|00 00 00 38) li r0,0 +.* (4b ff ff c4|c4 ff ff 4b) b .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsexetoc.g b/binutils-2.24/ld/testsuite/ld-powerpc/tlsexetoc.g new file mode 100644 index 0000000..b75c8e6 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsexetoc.g @@ -0,0 +1,15 @@ +#source: tlstoc.s +#as: -a64 +#ld: tmpdir/libtlslib.so +#objdump: -sj.got +#target: powerpc64*-*-* + +.* + +Contents of section \.got: +.* (00000000|d8850110) (100185d8|00000000) 00000000 00000000 .* +.* 00000000 00000000 00000000 00000000 .* +.* 00000000 00000000 (00000000|01000000) (00000001|00000000) .* +.* 00000000 00000000 (00000000|01000000) (00000001|00000000) .* +.* 00000000 00000000 (ffffffff|5080ffff) (ffff8050|ffffffff) .* +.* 00000000 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsexetoc.r b/binutils-2.24/ld/testsuite/ld-powerpc/tlsexetoc.r new file mode 100644 index 0000000..d238f26 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsexetoc.r @@ -0,0 +1,117 @@ +#source: tlslib.s +#source: tlstoc.s +#as: -a64 +#ld: +#readelf: -WSsrl +#target: powerpc64*-*-* + +There are [0-9]+ section headers, starting at offset 0x[0-9a-f]+: + +Section Headers: + +\[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al + +\[[ 0-9]+\] +NULL +0+ 0+ 0+ 0+ +0 +0 +0 + +\[[ 0-9]+\] \.interp +.* + +\[[ 0-9]+\] \.hash +.* + +\[[ 0-9]+\] \.dynsym +.* + +\[[ 0-9]+\] \.dynstr +.* + +\[[ 0-9]+\] \.rela\.dyn +.* + +\[[ 0-9]+\] \.rela\.plt +.* + +\[[ 0-9]+\] \.text +PROGBITS .* 0+e8 0+ +AX +0 +0 +32 + +\[[ 0-9]+\] \.tdata +PROGBITS .* 0+38 0+ WAT +0 +0 +8 + +\[[ 0-9]+\] \.tbss +NOBITS .* 0+38 0+ WAT +0 +0 +8 + +\[[ 0-9]+\] \.dynamic +DYNAMIC .* 0+160 10 +WA +4 +0 +8 + +\[[ 0-9]+\] \.opd .* + +\[[ 0-9]+\] \.got +PROGBITS .* 0+58 08 +WA +0 +0 +8 + +\[[ 0-9]+\] \.plt +.* + +\[[ 0-9]+\] \.shstrtab +.* + +\[[ 0-9]+\] \.symtab +.* + +\[[ 0-9]+\] \.strtab +.* +#... + +Elf file type is EXEC \(Executable file\) +Entry point .* +There are [0-9]+ program headers, starting at offset [0-9]+ + +Program Headers: + +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align + +PHDR +0x0+40 0x0+10000040 0x0+10000040 0x0+150 0x0+150 R E 0x8 + +INTERP +0x0+190 0x0+10000190 0x0+10000190 0x0+11 0x0+11 R +0x1 + +\[Requesting program interpreter: .*\] + +LOAD .* R E 0x10000 + +LOAD .* RW +0x10000 + +DYNAMIC .* RW +0x8 + +TLS .* 0x0+38 0x0+70 R +0x8 + + Section to Segment mapping: + +Segment Sections\.\.\. + +0+ + + +01 +\.interp * + +02 +\.interp \.hash \.dynsym \.dynstr \.rela\.dyn \.rela\.plt \.text * + +03 +\.tdata \.dynamic \.opd \.got \.plt * + +04 +\.dynamic * + +05 +\.tdata \.tbss * + +Relocation section '\.rela\.dyn' at offset .* contains 3 entries: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend +[0-9a-f ]+R_PPC64_DTPMOD64 +0+ gd \+ 0 +[0-9a-f ]+R_PPC64_DTPREL64 +0+ gd \+ 0 +[0-9a-f ]+R_PPC64_DTPMOD64 +0+ ld \+ 0 + +Relocation section '\.rela\.plt' at offset .* contains 1 entries: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend +[0-9a-f ]+R_PPC64_JMP_SLOT +0+ __tls_get_addr_opt \+ 0 + +Symbol table '\.dynsym' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +.* NOTYPE +LOCAL +DEFAULT +UND * +.* TLS +GLOBAL +DEFAULT +UND gd +.* 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 _end + +Symbol table '\.symtab' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +.* NOTYPE +LOCAL +DEFAULT +UND * +.* SECTION +LOCAL +DEFAULT +1 * +.* SECTION +LOCAL +DEFAULT +2 * +.* SECTION +LOCAL +DEFAULT +3 * +.* SECTION +LOCAL +DEFAULT +4 * +.* SECTION +LOCAL +DEFAULT +5 * +.* SECTION +LOCAL +DEFAULT +6 * +.* SECTION +LOCAL +DEFAULT +7 * +.* SECTION +LOCAL +DEFAULT +8 * +.* SECTION +LOCAL +DEFAULT +9 * +.* SECTION +LOCAL +DEFAULT +10 * +.* SECTION +LOCAL +DEFAULT +11 * +.* SECTION +LOCAL +DEFAULT +12 * +.* SECTION +LOCAL +DEFAULT +13 * +.* FILE +LOCAL +DEFAULT +ABS .* +.* TLS +LOCAL +DEFAULT +8 gd4 +.* TLS +LOCAL +DEFAULT +8 ld4 +.* TLS +LOCAL +DEFAULT +8 ld5 +.* TLS +LOCAL +DEFAULT +8 ld6 +.* TLS +LOCAL +DEFAULT +8 ie4 +.* TLS +LOCAL +DEFAULT +8 le4 +.* TLS +LOCAL +DEFAULT +8 le5 +.* NOTYPE +LOCAL +DEFAULT +12 \.Lie0 +.* (FUNC|NOTYPE) +LOCAL +DEFAULT +UND \.__tls_get_addr(|_opt) +.* FILE +LOCAL +DEFAULT +ABS .* +.* OBJECT +LOCAL +DEFAULT +10 _DYNAMIC +.* NOTYPE +LOCAL +DEFAULT +7 __glink_PLTresolve +.* NOTYPE +LOCAL +DEFAULT +7 .*\.plt_call\.__tls_get_addr(|_opt) +.* TLS +GLOBAL +DEFAULT +UND gd +.* TLS +GLOBAL +DEFAULT +9 le0 +.* TLS +GLOBAL +DEFAULT +9 ld0 +.* TLS +GLOBAL +DEFAULT +9 le1 +.* TLS +GLOBAL +DEFAULT +UND ld +.* FUNC +GLOBAL +DEFAULT +11 _start +.* TLS +GLOBAL +DEFAULT +9 ld2 +.* 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 _end +.* TLS +GLOBAL +DEFAULT +9 gd0 +.* TLS +GLOBAL +DEFAULT +9 ie0 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsexetoc.t b/binutils-2.24/ld/testsuite/ld-powerpc/tlsexetoc.t new file mode 100644 index 0000000..6e1fc7d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsexetoc.t @@ -0,0 +1,13 @@ +#source: tlstoc.s +#as: -a64 +#ld: tmpdir/libtlslib.so +#objdump: -sj.tdata +#target: powerpc64*-*-* + +.* + +Contents of section \.tdata: +.* (12345678|f0debc9a) (9abcdef0|78563412) (23456789|01efcdab) (abcdef01|89674523) .* +.* (3456789a|12f0debc) (bcdef012|9a785634) (456789ab|2301efcd) (cdef0123|ab896745) .* +.* (56789abc|3412f0de) (def01234|bc9a7856) (6789abcd|452301ef) (ef012345|cdab8967) .* +.* (789abcde|563412f0) (f0123456|debc9a78) .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlslib.s b/binutils-2.24/ld/testsuite/ld-powerpc/tlslib.s new file mode 100644 index 0000000..59c40d2 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlslib.s @@ -0,0 +1,24 @@ + .global __tls_get_addr,__tls_get_addr_opt,gd,ld + .type __tls_get_addr,@function + .type __tls_get_addr_opt,@function + + .section ".opd","aw",@progbits +__tls_get_addr: +__tls_get_addr_opt: + .align 3 + .quad .L.__tls_get_addr + .quad .TOC.@tocbase + .quad 0 + + .section ".tbss","awT",@nobits + .align 3 +gd: .space 8 + + .section ".tdata","awT",@progbits + .align 2 +ld: .long 0xc0ffee + + .text +.L.__tls_get_addr: + blr + .size __tls_get_addr,. - .L.__tls_get_addr diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlslib32.s b/binutils-2.24/ld/testsuite/ld-powerpc/tlslib32.s new file mode 100644 index 0000000..14dc966 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlslib32.s @@ -0,0 +1,16 @@ + .global __tls_get_addr,__tls_get_addr_opt,gd,ld + .type __tls_get_addr,@function + .type __tls_get_addr_opt,@function + + .section ".tbss","awT",@nobits + .align 2 +gd: .space 4 + + .section ".tdata","awT",@progbits + .align 2 +ld: .long 0xc0ffee + + .text +__tls_get_addr: +__tls_get_addr_opt: + blr diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsmark.d b/binutils-2.24/ld/testsuite/ld-powerpc/tlsmark.d new file mode 100644 index 0000000..786a811 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsmark.d @@ -0,0 +1,37 @@ +#source: tlsmark.s +#source: tlslib.s +#as: -a64 +#ld: +#objdump: -dr +#target: powerpc64*-*-* + +.* + +Disassembly of section \.text: + +0+100000e8 <_start>: +.*: (48 00 00 18|18 00 00 48) b 10000100 <_start\+0x18> +.*: (60 00 00 00|00 00 00 60) nop +.*: (38 63 90 00|00 90 63 38) addi r3,r3,-28672 +.*: (e8 83 00 00|00 00 83 e8) ld r4,0\(r3\) +.*: (3c 6d 00 00|00 00 6d 3c) addis r3,r13,0 +.*: (48 00 00 0c|0c 00 00 48) b 10000108 <_start\+0x20> +.*: (3c 6d 00 00|00 00 6d 3c) addis r3,r13,0 +.*: (4b ff ff e8|e8 ff ff 4b) b 100000ec <_start\+0x4> +.*: (60 00 00 00|00 00 00 60) nop +.*: (38 63 10 00|00 10 63 38) addi r3,r3,4096 +.*: (e8 83 80 00|00 80 83 e8) ld r4,-32768\(r3\) +.*: (3c 6d 00 00|00 00 6d 3c) addis r3,r13,0 +.*: (48 00 00 0c|0c 00 00 48) b 10000124 <_start\+0x3c> +.*: (3c 6d 00 00|00 00 6d 3c) addis r3,r13,0 +.*: (48 00 00 14|14 00 00 48) b 10000134 <_start\+0x4c> +.*: (60 00 00 00|00 00 00 60) nop +.*: (38 63 90 04|04 90 63 38) addi r3,r3,-28668 +.*: (e8 a3 00 00|00 00 a3 e8) ld r5,0\(r3\) +.*: (4b ff ff ec|ec ff ff 4b) b 1000011c <_start\+0x34> +.*: (60 00 00 00|00 00 00 60) nop +.*: (38 63 10 00|00 10 63 38) addi r3,r3,4096 +.*: (e8 a3 80 04|04 80 a3 e8) ld r5,-32764\(r3\) + +0+10000140 <\.__tls_get_addr>: +.*: (4e 80 00 20|20 00 80 4e) blr diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsmark.s b/binutils-2.24/ld/testsuite/ld-powerpc/tlsmark.s new file mode 100644 index 0000000..1bda55c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsmark.s @@ -0,0 +1,46 @@ + .section ".tdata","awT",@progbits +x: .int 1 +y: .int 2 + + .section ".toc","aw",@progbits + .p2align 3 +.LC0: + .quad y@dtpmod + .quad y@dtprel +.LC1: + .quad y@dtpmod + .quad 0 + + .text + .global _start +_start: + b .L2 + +.L1: + bl __tls_get_addr(x@tlsgd) + nop + ld 4,0(3) + addi 3,2,x@got@tlsld + b .L3 +.L2: + addi 3,2,x@got@tlsgd + b .L1 +.L3: + bl __tls_get_addr(x@tlsld) + nop + ld 4,x@dtprel(3) + + addi 3,2,.LC0@toc + b .L5 +.L4: + addi 3,2,.LC1@toc + b .L6 +.L5: + bl .__tls_get_addr(.LC0@tlsgd) + nop + ld 5,0(3) + b .L4 +.L6: + bl .__tls_get_addr(.LC1@tlsld) + nop + ld 5,y@dtprel(3) diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsmark32.d b/binutils-2.24/ld/testsuite/ld-powerpc/tlsmark32.d new file mode 100644 index 0000000..3692755 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsmark32.d @@ -0,0 +1,25 @@ +#source: tlsmark32.s +#source: tlslib32.s +#as: -a32 +#ld: +#objdump: -dr +#target: powerpc*-*-* + +.* + +Disassembly of section \.text: + +0+1800094 <_start>: +.*: (48 00 00 14|14 00 00 48) b 18000a8 <_start\+0x14> +.*: (38 63 90 00|00 90 63 38) addi r3,r3,-28672 +.*: (80 83 00 00|00 00 83 80) lwz r4,0\(r3\) +.*: (3c 62 00 00|00 00 62 3c) addis r3,r2,0 +.*: (48 00 00 0c|0c 00 00 48) b 18000b0 <_start\+0x1c> +.*: (3c 62 00 00|00 00 62 3c) addis r3,r2,0 +.*: (4b ff ff ec|ec ff ff 4b) b 1800098 <_start\+0x4> +.*: (38 63 10 00|00 10 63 38) addi r3,r3,4096 +.*: (80 83 80 00|00 80 83 80) lwz r4,-32768\(r3\) + +0+18000b8 <__tls_get_addr>: +.*: (4e 80 00 20|20 00 80 4e) blr +#pass
\ No newline at end of file diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsmark32.s b/binutils-2.24/ld/testsuite/ld-powerpc/tlsmark32.s new file mode 100644 index 0000000..966d1b3 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsmark32.s @@ -0,0 +1,19 @@ + .section ".tdata","awT",@progbits +x: .int 1 + + .text + .global _start +_start: + b .L2 + +.L1: + bl __tls_get_addr(x@tlsgd) + lwz 4,0(3) + addi 3,31,x@got@tlsld + b .L3 +.L2: + addi 3,31,x@got@tlsgd + b .L1 +.L3: + bl __tls_get_addr(x@tlsld) + lwz 4,x@dtprel(3) diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt1.d b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt1.d new file mode 100644 index 0000000..df50d77 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt1.d @@ -0,0 +1,25 @@ +#source: tlsopt1.s +#source: tlslib.s +#as: -a64 +#ld: +#objdump: -dr +#target: powerpc64*-*-* + +.* + +Disassembly of section \.text: + +0+100000e8 <\.__tls_get_addr>: +.*: (4e 80 00 20|20 00 80 4e) blr + +Disassembly of section \.no_opt1: + +0+100000ec <\.no_opt1>: +.*: (38 62 80 08|08 80 62 38) addi r3,r2,-32760 +.*: (2c 24 00 00|00 00 24 2c) cmpdi r4,0 +.*: (41 82 00 10|10 00 82 41) beq .* +.*: (4b ff ff f1|f1 ff ff 4b) bl 100000e8 <\.__tls_get_addr> +.*: (60 00 00 00|00 00 00 60) nop +.*: (48 00 00 0c|0c 00 00 48) b .* +.*: (4b ff ff e5|e5 ff ff 4b) bl 100000e8 <\.__tls_get_addr> +.*: (60 00 00 00|00 00 00 60) nop diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt1.s b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt1.s new file mode 100644 index 0000000..e66e315 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt1.s @@ -0,0 +1,14 @@ + .section ".no_opt1", "ax", %progbits +# this section should not be optimised since we have old-style +# __tls_get_addr without marker relocs, and the arg setup insn +# is shared with two __tls_get_addr calls. + addi 3,2,gd@got@tlsgd + cmpdi 4,0 + beq 0f + bl __tls_get_addr + nop + b 1f +0: + bl __tls_get_addr + nop +1: diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt1_32.d b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt1_32.d new file mode 100644 index 0000000..ec9c7ca --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt1_32.d @@ -0,0 +1,24 @@ +#source: tlsopt1_32.s +#source: tlslib32.s +#as: -a32 +#ld: +#objdump: -dr +#target: powerpc*-*-* + +.* + +Disassembly of section \.text: + +0+1800094 <__tls_get_addr>: +.*: (4e 80 00 20|20 00 80 4e) blr + +Disassembly of section \.no_opt1: + +0+1800098 <\.no_opt1>: +.*: (38 6d ff f4|f4 ff 6d 38) addi r3,r13,-12 +.*: (2c 04 00 00|00 00 04 2c) cmpwi r4,0 +.*: (41 82 00 0c|0c 00 82 41) beq .* +.*: (4b ff ff f1|f1 ff ff 4b) bl 1800094 <__tls_get_addr> +.*: (48 00 00 08|08 00 00 48) b .* +.*: (4b ff ff e9|e9 ff ff 4b) bl 1800094 <__tls_get_addr> +#pass diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt1_32.s b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt1_32.s new file mode 100644 index 0000000..aba2bbc --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt1_32.s @@ -0,0 +1,12 @@ + .section ".no_opt1", "ax", %progbits +# this section should not be optimised since we have old-style +# __tls_get_addr without marker relocs, and the arg setup insn +# is shared with two __tls_get_addr calls. + addi 3,13,gd@got@tlsgd + cmpwi 4,0 + beq 0f + bl __tls_get_addr + b 1f +0: + bl __tls_get_addr +1: diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt2.d b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt2.d new file mode 100644 index 0000000..73a9b87 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt2.d @@ -0,0 +1,23 @@ +#source: tlsopt2.s +#source: tlslib.s +#as: -a64 +#ld: +#objdump: -dr +#target: powerpc64*-*-* + +.* + +Disassembly of section \.text: + +0+100000e8 <\.__tls_get_addr>: +.*: (4e 80 00 20|20 00 80 4e) blr + +Disassembly of section \.no_opt2: + +0+100000ec <\.no_opt2>: +.*: (38 62 80 08|08 80 62 38) addi r3,r2,-32760 +.*: (2c 24 00 00|00 00 24 2c) cmpdi r4,0 +.*: (41 82 00 08|08 00 82 41) beq .* +.*: (38 62 80 08|08 80 62 38) addi r3,r2,-32760 +.*: (4b ff ff ed|ed ff ff 4b) bl 100000e8 <\.__tls_get_addr> +.*: (60 00 00 00|00 00 00 60) nop diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt2.s b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt2.s new file mode 100644 index 0000000..adfbfa8 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt2.s @@ -0,0 +1,11 @@ + .section ".no_opt2", "ax", %progbits +# this section should not be optimised since we have old-style +# __tls_get_addr without marker relocs, and two arg setup insns +# feed into one __tls_get_addr call. + addi 3,2,gd@got@tlsgd + cmpdi 4,0 + beq 0f + addi 3,2,gd@got@tlsgd +0: + bl __tls_get_addr + nop diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt2_32.d b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt2_32.d new file mode 100644 index 0000000..baffe91 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt2_32.d @@ -0,0 +1,23 @@ +#source: tlsopt2_32.s +#source: tlslib32.s +#as: -a32 +#ld: +#objdump: -dr +#target: powerpc*-*-* + +.* + +Disassembly of section \.text: + +0+1800094 <__tls_get_addr>: +.*: (4e 80 00 20|20 00 80 4e) blr + +Disassembly of section \.no_opt2: + +0+1800098 <\.no_opt2>: +.*: (38 6d ff f4|f4 ff 6d 38) addi r3,r13,-12 +.*: (2c 04 00 00|00 00 04 2c) cmpwi r4,0 +.*: (41 82 00 08|08 00 82 41) beq .* +.*: (38 6d ff f4|f4 ff 6d 38) addi r3,r13,-12 +.*: (4b ff ff ed|ed ff ff 4b) bl 1800094 <__tls_get_addr> +#pass diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt2_32.s b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt2_32.s new file mode 100644 index 0000000..bca1247 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt2_32.s @@ -0,0 +1,10 @@ + .section ".no_opt2", "ax", %progbits +# this section should not be optimised since we have old-style +# __tls_get_addr without marker relocs, and two arg setup insns +# feed into one __tls_get_addr call. + addi 3,13,gd@got@tlsgd + cmpwi 4,0 + beq 0f + addi 3,13,gd@got@tlsgd +0: + bl __tls_get_addr diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt3.d b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt3.d new file mode 100644 index 0000000..334873a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt3.d @@ -0,0 +1,26 @@ +#source: tlsopt3.s +#source: tlslib.s +#as: -a64 +#ld: +#objdump: -dr +#target: powerpc64*-*-* + +.* + +Disassembly of section \.text: + +00000000100000e8 <\.__tls_get_addr>: +.*: (4e 80 00 20|20 00 80 4e) blr + +Disassembly of section \.no_opt3: + +00000000100000ec <\.no_opt3>: +.*: (38 62 80 08|08 80 62 38) addi r3,r2,-32760 +.*: (48 00 00 0c|0c 00 00 48) b .* +.*: (38 62 80 18|18 80 62 38) addi r3,r2,-32744 +.*: (48 00 00 10|10 00 00 48) b .* +.*: (4b ff ff ed|ed ff ff 4b) bl 100000e8 <\.__tls_get_addr> +.*: (60 00 00 00|00 00 00 60) nop +.*: (48 00 00 0c|0c 00 00 48) b .* +.*: (4b ff ff e1|e1 ff ff 4b) bl 100000e8 <\.__tls_get_addr> +.*: (60 00 00 00|00 00 00 60) nop diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt3.s b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt3.s new file mode 100644 index 0000000..9730ceb --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt3.s @@ -0,0 +1,19 @@ + .section ".tbss","awT",@nobits + .global gd0 + .align 3 +gd0: .space 8 + + .section ".no_opt3", "ax", %progbits +# this section should also not be optimised + addi 3,2,gd@got@tlsgd + b 0f + addi 3,2,gd0@got@tlsgd + b 1f +0: + bl __tls_get_addr + nop + b 2f +1: + bl __tls_get_addr + nop +2: diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt3_32.d b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt3_32.d new file mode 100644 index 0000000..55827a2 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt3_32.d @@ -0,0 +1,25 @@ +#source: tlsopt3_32.s +#source: tlslib32.s +#as: -a32 +#ld: +#objdump: -dr +#target: powerpc*-*-* + +.* + +Disassembly of section \.text: + +0+1800094 <__tls_get_addr>: +.*: (4e 80 00 20|20 00 80 4e) blr + +Disassembly of section \.no_opt3: + +0+1800098 <\.no_opt3>: +.*: (38 6d ff ec|ec ff 6d 38) addi r3,r13,-20 +.*: (48 00 00 0c|0c 00 00 48) b .* +.*: (38 6d ff f4|f4 ff 6d 38) addi r3,r13,-12 +.*: (48 00 00 0c|0c 00 00 48) b .* +.*: (4b ff ff ed|ed ff ff 4b) bl 1800094 <__tls_get_addr> +.*: (48 00 00 08|08 00 00 48) b .* +.*: (4b ff ff e5|e5 ff ff 4b) bl 1800094 <__tls_get_addr> +#pass diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt3_32.s b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt3_32.s new file mode 100644 index 0000000..6432c24 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt3_32.s @@ -0,0 +1,17 @@ + .section ".tbss","awT",@nobits + .global gd0 + .align 3 +gd0: .space 8 + + .section ".no_opt3", "ax", %progbits +# this section should also not be optimised + addi 3,13,gd@got@tlsgd + b 0f + addi 3,13,gd0@got@tlsgd + b 1f +0: + bl __tls_get_addr + b 2f +1: + bl __tls_get_addr +2: diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt4.d b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt4.d new file mode 100644 index 0000000..944e97f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt4.d @@ -0,0 +1,48 @@ +#source: tlsopt4.s +#source: tlslib.s +#as: -a64 +#ld: +#objdump: -dr +#target: powerpc64*-*-* + +.* + +Disassembly of section \.text: + +0+100000e8 <\.__tls_get_addr>: +.*: (4e 80 00 20|20 00 80 4e) blr + +Disassembly of section \.opt1: + +0+100000ec <\.opt1>: +.*: (3c 6d 00 00|00 00 6d 3c) addis r3,r13,0 +.*: (2c 24 00 00|00 00 24 2c) cmpdi r4,0 +.*: (41 82 00 10|10 00 82 41) beq .* +.*: (60 00 00 00|00 00 00 60) nop +.*: (38 63 90 10|10 90 63 38) addi r3,r3,-28656 +.*: (48 00 00 0c|0c 00 00 48) b .* +.*: (60 00 00 00|00 00 00 60) nop +.*: (38 63 90 10|10 90 63 38) addi r3,r3,-28656 + +Disassembly of section \.opt2: + +0+1000010c <\.opt2>: +.*: (3c 6d 00 00|00 00 6d 3c) addis r3,r13,0 +.*: (2c 24 00 00|00 00 24 2c) cmpdi r4,0 +.*: (41 82 00 08|08 00 82 41) beq .* +.*: (3c 6d 00 00|00 00 6d 3c) addis r3,r13,0 +.*: (60 00 00 00|00 00 00 60) nop +.*: (38 63 90 10|10 90 63 38) addi r3,r3,-28656 + +Disassembly of section \.opt3: + +0+10000124 <\.opt3>: +.*: (3c 6d 00 00|00 00 6d 3c) addis r3,r13,0 +.*: (48 00 00 0c|0c 00 00 48) b .* +.*: (3c 6d 00 00|00 00 6d 3c) addis r3,r13,0 +.*: (48 00 00 10|10 00 00 48) b .* +.*: (60 00 00 00|00 00 00 60) nop +.*: (38 63 90 10|10 90 63 38) addi r3,r3,-28656 +.*: (48 00 00 0c|0c 00 00 48) b .* +.*: (60 00 00 00|00 00 00 60) nop +.*: (38 63 90 08|08 90 63 38) addi r3,r3,-28664 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt4.s b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt4.s new file mode 100644 index 0000000..f84dee5 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt4.s @@ -0,0 +1,39 @@ + .section ".tbss","awT",@nobits + .global gd0 + .align 3 +gd0: .space 8 + + .section ".opt1", "ax", %progbits + addi 3,2,gd@got@tlsgd + cmpdi 4,0 + beq 0f + bl __tls_get_addr(gd@tlsgd) + nop + b 1f +0: + bl __tls_get_addr(gd@tlsgd) + nop +1: + + .section ".opt2", "ax", %progbits + addi 3,2,gd@got@tlsgd + cmpdi 4,0 + beq 0f + addi 3,2,gd@got@tlsgd +0: + bl __tls_get_addr(gd@tlsgd) + nop + + .section ".opt3", "ax", %progbits + addi 3,2,gd@got@tlsgd + b 0f + addi 3,2,gd0@got@tlsgd + b 1f +0: + bl __tls_get_addr(gd@tlsgd) + nop + b 2f +1: + bl __tls_get_addr(gd0@tlsgd) + nop +2: diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt4_32.d b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt4_32.d new file mode 100644 index 0000000..59c0a6a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt4_32.d @@ -0,0 +1,44 @@ +#source: tlsopt4_32.s +#source: tlslib32.s +#as: -a32 +#ld: +#objdump: -dr +#target: powerpc*-*-* + +.* + +Disassembly of section \.text: + +0+1800094 <__tls_get_addr>: +.*: (4e 80 00 20|20 00 80 4e) blr + +Disassembly of section \.opt1: + +0+1800098 <\.opt1>: +.*: (3c 62 00 00|00 00 62 3c) addis r3,r2,0 +.*: (2c 04 00 00|00 00 04 2c) cmpwi r4,0 +.*: (41 82 00 0c|0c 00 82 41) beq .* +.*: (38 63 90 10|10 90 63 38) addi r3,r3,-28656 +.*: (48 00 00 08|08 00 00 48) b .* +.*: (38 63 90 10|10 90 63 38) addi r3,r3,-28656 + +Disassembly of section \.opt2: + +0+18000b0 <\.opt2>: +.*: (3c 62 00 00|00 00 62 3c) addis r3,r2,0 +.*: (2c 04 00 00|00 00 04 2c) cmpwi r4,0 +.*: (41 82 00 08|08 00 82 41) beq .* +.*: (3c 62 00 00|00 00 62 3c) addis r3,r2,0 +.*: (38 63 90 10|10 90 63 38) addi r3,r3,-28656 + +Disassembly of section \.opt3: + +0+18000c4 <\.opt3>: +.*: (3c 62 00 00|00 00 62 3c) addis r3,r2,0 +.*: (48 00 00 0c|0c 00 00 48) b .* +.*: (3c 62 00 00|00 00 62 3c) addis r3,r2,0 +.*: (48 00 00 0c|0c 00 00 48) b .* +.*: (38 63 90 10|10 90 63 38) addi r3,r3,-28656 +.*: (48 00 00 08|08 00 00 48) b .* +.*: (38 63 90 08|08 90 63 38) addi r3,r3,-28664 +#pass diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt4_32.s b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt4_32.s new file mode 100644 index 0000000..9643fcb --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsopt4_32.s @@ -0,0 +1,34 @@ + .section ".tbss","awT",@nobits + .global gd0 + .align 3 +gd0: .space 8 + + .section ".opt1", "ax", %progbits + addi 3,13,gd@got@tlsgd + cmpwi 4,0 + beq 0f + bl __tls_get_addr(gd@tlsgd) + b 1f +0: + bl __tls_get_addr(gd@tlsgd) +1: + + .section ".opt2", "ax", %progbits + addi 3,13,gd@got@tlsgd + cmpwi 4,0 + beq 0f + addi 3,13,gd@got@tlsgd +0: + bl __tls_get_addr(gd@tlsgd) + + .section ".opt3", "ax", %progbits + addi 3,13,gd@got@tlsgd + b 0f + addi 3,13,gd0@got@tlsgd + b 1f +0: + bl __tls_get_addr(gd@tlsgd) + b 2f +1: + bl __tls_get_addr(gd0@tlsgd) +2: diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsso.d b/binutils-2.24/ld/testsuite/ld-powerpc/tlsso.d new file mode 100644 index 0000000..7fe7e87 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsso.d @@ -0,0 +1,79 @@ +#source: tls.s +#as: -a64 +#ld: -shared +#objdump: -dr +#target: powerpc64*-*-* + +.* + +Disassembly of section \.text: + +.* <.*plt_call\.__tls_get_addr(|_opt)>: +.* (f8 41 00 28|28 00 41 f8) std r2,40\(r1\) +.* (e9 82 80 78|78 80 82 e9) ld r12,-32648\(r2\) +.* (7d 89 03 a6|a6 03 89 7d) mtctr r12 +.* (e8 42 80 80|80 80 42 e8) ld r2,-32640\(r2\) +.* (28 22 00 00|00 00 22 28) cmpldi r2,0 +.* (4c e2 04 20|20 04 e2 4c) bnectr\+ * +.* (48 00 00 ..|.. 00 00 48) b .* <__tls_get_addr@plt> + +.* <\._start>: +.* (38 62 80 20|20 80 62 38) addi r3,r2,-32736 +.* (4b ff ff ..|.. ff ff 4b) bl .*plt_call.__tls_get_addr.* +.* (e8 41 00 28|28 00 41 e8) ld r2,40\(r1\) +.* (38 62 80 50|50 80 62 38) addi r3,r2,-32688 +.* (4b ff ff ..|.. ff ff 4b) bl .*plt_call.__tls_get_addr.* +.* (e8 41 00 28|28 00 41 e8) ld r2,40\(r1\) +.* (38 62 80 38|38 80 62 38) addi r3,r2,-32712 +.* (4b ff ff ..|.. ff ff 4b) bl .*plt_call.__tls_get_addr.* +.* (e8 41 00 28|28 00 41 e8) ld r2,40\(r1\) +.* (38 62 80 50|50 80 62 38) addi r3,r2,-32688 +.* (4b ff ff ..|.. ff ff 4b) bl .*plt_call.__tls_get_addr.* +.* (e8 41 00 28|28 00 41 e8) ld r2,40\(r1\) +.* (39 23 80 40|40 80 23 39) addi r9,r3,-32704 +.* (3d 23 00 00|00 00 23 3d) addis r9,r3,0 +.* (81 49 80 48|48 80 49 81) lwz r10,-32696\(r9\) +.* (e9 22 80 30|30 80 22 e9) ld r9,-32720\(r2\) +.* (7d 49 18 2a|2a 18 49 7d) ldx r10,r9,r3 +.* (e9 22 80 48|48 80 22 e9) ld r9,-32696\(r2\) +.* (7d 49 6a 2e|2e 6a 49 7d) lhzx r10,r9,r13 +.* (89 4d 00 00|00 00 4d 89) lbz r10,0\(r13\) +.* (3d 2d 00 00|00 00 2d 3d) addis r9,r13,0 +.* (99 49 00 00|00 00 49 99) stb r10,0\(r9\) +.* (38 62 80 08|08 80 62 38) addi r3,r2,-32760 +.* (4b ff ff ..|.. ff ff 4b) bl .*plt_call.__tls_get_addr.* +.* (e8 41 00 28|28 00 41 e8) ld r2,40\(r1\) +.* (38 62 80 50|50 80 62 38) addi r3,r2,-32688 +.* (4b ff ff ..|.. ff ff 4b) bl .*plt_call.__tls_get_addr.* +.* (e8 41 00 28|28 00 41 e8) ld r2,40\(r1\) +.* (f9 43 80 08|08 80 43 f9) std r10,-32760\(r3\) +.* (3d 23 00 00|00 00 23 3d) addis r9,r3,0 +.* (91 49 80 10|10 80 49 91) stw r10,-32752\(r9\) +.* (e9 22 80 18|18 80 22 e9) ld r9,-32744\(r2\) +.* (7d 49 19 2a|2a 19 49 7d) stdx r10,r9,r3 +.* (e9 22 80 48|48 80 22 e9) ld r9,-32696\(r2\) +.* (7d 49 6b 2e|2e 6b 49 7d) sthx r10,r9,r13 +.* (e9 4d 00 02|02 00 4d e9) lwa r10,0\(r13\) +.* (3d 2d 00 00|00 00 2d 3d) addis r9,r13,0 +.* (a9 49 00 00|00 00 49 a9) lha r10,0\(r9\) +.* (60 00 00 00|00 00 00 60) nop +.* (00 00 00 00|38 02 01 00) .* +.* (00 01 02 38|00 00 00 00) .* +.* <__glink_PLTresolve>: +.* (7d 88 02 a6|a6 02 88 7d) mflr r12 +.* (42 9f 00 05|05 00 9f 42) bcl 20,4\*cr7\+so,.* +.* (7d 68 02 a6|a6 02 68 7d) mflr r11 +.* (e8 4b ff f0|f0 ff 4b e8) ld r2,-16\(r11\) +.* (7d 88 03 a6|a6 03 88 7d) mtlr r12 +.* (7d 62 5a 14|14 5a 62 7d) add r11,r2,r11 +.* (e9 8b 00 00|00 00 8b e9) ld r12,0\(r11\) +.* (e8 4b 00 08|08 00 4b e8) ld r2,8\(r11\) +.* (7d 89 03 a6|a6 03 89 7d) mtctr r12 +.* (e9 6b 00 10|10 00 6b e9) ld r11,16\(r11\) +.* (4e 80 04 20|20 04 80 4e) bctr +.* (60 00 00 00|00 00 00 60) nop +.* (60 00 00 00|00 00 00 60) nop +.* (60 00 00 00|00 00 00 60) nop +.* <__tls_get_addr@plt>: +.* (38 00 00 00|00 00 00 38) li r0,0 +.* (4b ff ff c4|c4 ff ff 4b) b .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsso.g b/binutils-2.24/ld/testsuite/ld-powerpc/tlsso.g new file mode 100644 index 0000000..0ba9fda --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsso.g @@ -0,0 +1,15 @@ +#source: tls.s +#as: -a64 +#ld: -shared +#objdump: -sj.got +#target: powerpc64*-*-* + +.* + +Contents of section \.got: + 107e0 (00000000|e0870100) (000187e0|00000000) 00000000 00000000 .* +.* 00000000 00000000 00000000 00000000 .* +.* 00000000 00000000 00000000 00000000 .* +.* 00000000 00000000 00000000 00000000 .* +.* 00000000 00000000 00000000 00000000 .* +.* 00000000 00000000 00000000 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsso.r b/binutils-2.24/ld/testsuite/ld-powerpc/tlsso.r new file mode 100644 index 0000000..ddaaebc --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsso.r @@ -0,0 +1,133 @@ +#source: tls.s +#as: -a64 +#ld: -shared +#readelf: -WSsrl +#target: powerpc64*-*-* + +There are [0-9]+ section headers, starting at offset 0x[0-9a-f]+: + +Section Headers: + +\[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al + +\[[ 0-9]+\] +NULL +0+ 0+ 0+ 0+ +0 +0 +0 + +\[[ 0-9]+\] \.hash .* + +\[[ 0-9]+\] \.dynsym .* + +\[[ 0-9]+\] \.dynstr .* + +\[[ 0-9]+\] \.rela\.dyn .* + +\[[ 0-9]+\] \.rela\.plt .* + +\[[ 0-9]+\] \.text .* + +\[[ 0-9]+\] \.tdata +PROGBITS .* 0+38 0+ WAT +0 +0 +8 + +\[[ 0-9]+\] \.tbss +NOBITS .* 0+38 0+ WAT +0 +0 +8 + +\[[ 0-9]+\] \.dynamic .* + +\[[ 0-9]+\] \.opd .* + +\[[ 0-9]+\] \.got .* + +\[[ 0-9]+\] \.plt .* + +\[[ 0-9]+\] \.shstrtab .* + +\[[ 0-9]+\] \.symtab .* + +\[[ 0-9]+\] \.strtab .* +#... + +Elf file type is DYN \(Shared object file\) +Entry point 0x[0-9a-f]+ +There are [0-9]+ program headers, starting at offset [0-9]+ + +Program Headers: + +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align + +LOAD .* R E 0x10000 + +LOAD .* RW +0x10000 + +DYNAMIC .* RW +0x8 + +TLS .* 0x0+38 0x0+70 R +0x8 + + Section to Segment mapping: + +Segment Sections\.\.\. + +0+ +\.hash \.dynsym \.dynstr \.rela\.dyn \.rela\.plt \.text * + +01 +\.tdata \.dynamic \.opd \.got \.plt * + +02 +\.dynamic * + +03 +\.tdata \.tbss * + +Relocation section '\.rela\.dyn' at offset .* contains 18 entries: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend +[0-9a-f ]+R_PPC64_RELATIVE +55c +[0-9a-f ]+R_PPC64_RELATIVE +187e0 +[0-9a-f ]+R_PPC64_TPREL16 +0+60 le0 \+ 0 +[0-9a-f ]+R_PPC64_TPREL16_HA +0+68 le1 \+ 0 +[0-9a-f ]+R_PPC64_TPREL16_LO +0+68 le1 \+ 0 +[0-9a-f ]+R_PPC64_TPREL16_DS +[0-9a-f]+ \.tdata \+ 28 +[0-9a-f ]+R_PPC64_TPREL16_HA +[0-9a-f]+ \.tdata \+ 30 +[0-9a-f ]+R_PPC64_TPREL16_LO +[0-9a-f]+ \.tdata \+ 30 +[0-9a-f ]+R_PPC64_DTPMOD64 +0 +[0-9a-f ]+R_PPC64_DTPREL64 +0 +[0-9a-f ]+R_PPC64_DTPREL64 +18 +[0-9a-f ]+R_PPC64_DTPMOD64 +0 +[0-9a-f ]+R_PPC64_DTPMOD64 +0+ gd \+ 0 +[0-9a-f ]+R_PPC64_DTPREL64 +0+ gd \+ 0 +[0-9a-f ]+R_PPC64_DTPREL64 +0+50 ld2 \+ 0 +[0-9a-f ]+R_PPC64_DTPMOD64 +0+38 gd0 \+ 0 +[0-9a-f ]+R_PPC64_DTPREL64 +0+38 gd0 \+ 0 +[0-9a-f ]+R_PPC64_TPREL64 +0+58 ie0 \+ 0 + +Relocation section '\.rela\.plt' at offset .* contains 1 entries: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend +[0-9a-f ]+R_PPC64_JMP_SLOT +0+ __tls_get_addr \+ 0 + +Symbol table '\.dynsym' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +.* NOTYPE +LOCAL +DEFAULT +UND * +.* SECTION +LOCAL +DEFAULT +6 * +.* SECTION +LOCAL +DEFAULT +7 * +.* TLS +GLOBAL +DEFAULT +UND gd +.* TLS +GLOBAL +DEFAULT +8 le0 +.* NOTYPE +GLOBAL +DEFAULT +UND __tls_get_addr +.* TLS +GLOBAL +DEFAULT +8 ld0 +.* TLS +GLOBAL +DEFAULT +8 le1 +.* TLS +GLOBAL +DEFAULT +UND ld +.* FUNC +GLOBAL +DEFAULT +10 _start +.* 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 _end +.* TLS +GLOBAL +DEFAULT +8 gd0 +.* TLS +GLOBAL +DEFAULT +8 ie0 + +Symbol table '\.symtab' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +.* NOTYPE +LOCAL +DEFAULT +UND * +.* SECTION +LOCAL +DEFAULT +1 * +.* SECTION +LOCAL +DEFAULT +2 * +.* SECTION +LOCAL +DEFAULT +3 * +.* SECTION +LOCAL +DEFAULT +4 * +.* SECTION +LOCAL +DEFAULT +5 * +.* SECTION +LOCAL +DEFAULT +6 * +.* SECTION +LOCAL +DEFAULT +7 * +.* SECTION +LOCAL +DEFAULT +8 * +.* SECTION +LOCAL +DEFAULT +9 * +.* SECTION +LOCAL +DEFAULT +10 * +.* SECTION +LOCAL +DEFAULT +11 * +.* SECTION +LOCAL +DEFAULT +12 * +.* FILE +LOCAL +DEFAULT +ABS .* +.* TLS +LOCAL +DEFAULT +7 gd4 +.* TLS +LOCAL +DEFAULT +7 ld4 +.* TLS +LOCAL +DEFAULT +7 ld5 +.* TLS +LOCAL +DEFAULT +7 ld6 +.* TLS +LOCAL +DEFAULT +7 ie4 +.* TLS +LOCAL +DEFAULT +7 le4 +.* TLS +LOCAL +DEFAULT +7 le5 +.* NOTYPE +LOCAL +DEFAULT +UND \.__tls_get_addr +.* FILE +LOCAL +DEFAULT +ABS .* +.* OBJECT +LOCAL +DEFAULT +9 _DYNAMIC +.* NOTYPE +LOCAL +DEFAULT +6 .*\.plt_call\.__tls_get_addr +.* NOTYPE +LOCAL +DEFAULT +6 __glink_PLTresolve +.* TLS +GLOBAL +DEFAULT +UND gd +.* TLS +GLOBAL +DEFAULT +8 le0 +.* NOTYPE +GLOBAL +DEFAULT +UND __tls_get_addr +.* TLS +GLOBAL +DEFAULT +8 ld0 +.* TLS +GLOBAL +DEFAULT +8 le1 +.* TLS +GLOBAL +DEFAULT +UND ld +.* FUNC +GLOBAL +DEFAULT +10 _start +.* 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 _end +.* TLS +GLOBAL +DEFAULT +8 gd0 +.* TLS +GLOBAL +DEFAULT +8 ie0 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsso.t b/binutils-2.24/ld/testsuite/ld-powerpc/tlsso.t new file mode 100644 index 0000000..f679542 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsso.t @@ -0,0 +1,13 @@ +#source: tls.s +#as: -a64 +#ld: -shared +#objdump: -sj.tdata +#target: powerpc64*-*-* + +.* + +Contents of section \.tdata: +.* (12345678|f0debc9a) (9abcdef0|78563412) (23456789|01efcdab) (abcdef01|89674523) .* +.* (3456789a|12f0debc) (bcdef012|9a785634) (456789ab|2301efcd) (cdef0123|ab896745) .* +.* (56789abc|3412f0de) (def01234|bc9a7856) (6789abcd|452301ef) (ef012345|cdab8967) .* +.* (789abcde|563412f0) (f0123456|debc9a78) .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsso32.d b/binutils-2.24/ld/testsuite/ld-powerpc/tlsso32.d new file mode 100644 index 0000000..39c9970 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsso32.d @@ -0,0 +1,47 @@ +#source: tls32.s +#as: -a32 +#ld: -shared +#objdump: -dr +#target: powerpc*-*-* + +.* + +Disassembly of section \.text: + +.* <_start>: +.*: (38 7f ff e0|e0 ff 7f 38) addi r3,r31,-32 +.*: (48 00 00 01|01 00 00 48) bl .* +.*: (38 7f ff f4|f4 ff 7f 38) addi r3,r31,-12 +.*: (48 00 00 01|01 00 00 48) bl .* +.*: (38 7f ff e8|e8 ff 7f 38) addi r3,r31,-24 +.*: (48 01 01 95|95 01 01 48) bl .*<__tls_get_addr@plt> +.*: (38 7f ff f4|f4 ff 7f 38) addi r3,r31,-12 +.*: (48 01 01 8d|8d 01 01 48) bl .*<__tls_get_addr@plt> +.*: (39 23 80 20|20 80 23 39) addi r9,r3,-32736 +.*: (3d 23 00 00|00 00 23 3d) addis r9,r3,0 +.*: (81 49 80 24|24 80 49 81) lwz r10,-32732\(r9\) +.*: (81 3f ff f0|f0 ff 3f 81) lwz r9,-16\(r31\) +.*: (7d 49 12 2e|2e 12 49 7d) lhzx r10,r9,r2 +.*: (89 42 00 00|00 00 42 89) lbz r10,0\(r2\) +.*: (3d 22 00 00|00 00 22 3d) addis r9,r2,0 +.*: (99 49 00 00|00 00 49 99) stb r10,0\(r9\) +.*: (38 7e ff d8|d8 ff 7e 38) addi r3,r30,-40 +.*: (48 00 00 01|01 00 00 48) bl .* +.*: (38 7e ff f4|f4 ff 7e 38) addi r3,r30,-12 +.*: (48 00 00 01|01 00 00 48) bl .* +.*: (91 43 80 04|04 80 43 91) stw r10,-32764\(r3\) +.*: (3d 23 00 00|00 00 23 3d) addis r9,r3,0 +.*: (91 49 80 08|08 80 49 91) stw r10,-32760\(r9\) +.*: (81 3e ff f0|f0 ff 3e 81) lwz r9,-16\(r30\) +.*: (7d 49 13 2e|2e 13 49 7d) sthx r10,r9,r2 +.*: (a1 42 00 00|00 00 42 a1) lhz r10,0\(r2\) +.*: (3d 22 00 00|00 00 22 3d) addis r9,r2,0 +.*: (a9 49 00 00|00 00 49 a9) lha r10,0\(r9\) +Disassembly of section \.got: + +.* <_GLOBAL_OFFSET_TABLE_-0x28>: +#... +.*: (4e 80 00 21|21 00 80 4e) blrl +.* <_GLOBAL_OFFSET_TABLE_>: +.*: (00 01 03 ec|ec 03 01 00) .* +#pass diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsso32.g b/binutils-2.24/ld/testsuite/ld-powerpc/tlsso32.g new file mode 100644 index 0000000..ac2c4bb --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsso32.g @@ -0,0 +1,13 @@ +#source: tls32.s +#as: -a32 +#ld: -shared +#objdump: -sj.got +#target: powerpc*-*-* + +.* + +Contents of section \.got: +.* 00000000 00000000 00000000 00000000 .* +.* 00000000 00000000 00000000 00000000 .* +.* 00000000 (4e800021|2100804e) (000103ec|ec030100) 00000000 .* +.* 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsso32.r b/binutils-2.24/ld/testsuite/ld-powerpc/tlsso32.r new file mode 100644 index 0000000..9563b0b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsso32.r @@ -0,0 +1,131 @@ +#source: tls32.s +#as: -a32 +#ld: -shared +#readelf: -WSsrl +#target: powerpc*-*-* + +There are [0-9]+ section headers, starting at offset 0x[0-9a-f]+: + +Section Headers: + +\[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al + +\[[ 0-9]+\] +NULL +0+ 0+ 0+ 0+ +0 +0 +0 + +\[[ 0-9]+\] \.hash +.* + +\[[ 0-9]+\] \.dynsym +.* + +\[[ 0-9]+\] \.dynstr +.* + +\[[ 0-9]+\] \.rela\.dyn +.* + +\[[ 0-9]+\] \.rela\.plt +.* + +\[[ 0-9]+\] \.text +PROGBITS .* 0+70 0+ +AX +0 +0 +1 + +\[[ 0-9]+\] \.tdata +PROGBITS .* 0+1c 0+ WAT +0 +0 +4 + +\[[ 0-9]+\] \.tbss +NOBITS .* 0+1c 0+ WAT +0 +0 +4 + +\[[ 0-9]+\] \.dynamic +DYNAMIC .* 08 +WA +3 +0 +4 + +\[[ 0-9]+\] \.got +PROGBITS .* 0+34 04 WAX +0 +0 +4 + +\[[ 0-9]+\] \.plt +.* + +\[[ 0-9]+\] \.shstrtab +.* + +\[[ 0-9]+\] \.symtab +.* + +\[[ 0-9]+\] \.strtab +.* +#... + +Elf file type is DYN \(Shared object file\) +Entry point 0x[0-9a-f]+ +There are [0-9]+ program headers, starting at offset [0-9]+ + +Program Headers: + +Type +Offset +VirtAddr +PhysAddr +FileSiz MemSiz +Flg Align + +LOAD .* R E 0x10000 + +LOAD .* RWE 0x10000 + +DYNAMIC .* RW +0x4 + +TLS .* 0x0+1c 0x0+38 R +0x4 + + Section to Segment mapping: + +Segment Sections\.\.\. + +0+ +\.hash \.dynsym \.dynstr \.rela\.dyn \.rela\.plt \.text + +01 +\.tdata \.dynamic \.got \.plt + +02 +\.dynamic + +03 +\.tdata \.tbss + +Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 18 entries: + Offset +Info +Type +Sym\. Value +Symbol's Name \+ Addend +[0-9a-f ]+R_PPC_REL24 +0+ +__tls_get_addr \+ 0 +[0-9a-f ]+R_PPC_REL24 +0+ +__tls_get_addr \+ 0 +[0-9a-f ]+R_PPC_REL24 +0+ +__tls_get_addr \+ 0 +[0-9a-f ]+R_PPC_REL24 +0+ +__tls_get_addr \+ 0 +[0-9a-f ]+R_PPC_TPREL16 +0+30 +le0 \+ 0 +[0-9a-f ]+R_PPC_TPREL16_HA +0+34 +le1 \+ 0 +[0-9a-f ]+R_PPC_TPREL16_LO +0+34 +le1 \+ 0 +[0-9a-f ]+R_PPC_TPREL16 +0+103d0 +\.tdata \+ 103e4 +[0-9a-f ]+R_PPC_TPREL16_HA +0+103d0 +\.tdata \+ 103e8 +[0-9a-f ]+R_PPC_TPREL16_LO +0+103d0 +\.tdata \+ 103e8 +[0-9a-f ]+R_PPC_DTPMOD32 +0 +[0-9a-f ]+R_PPC_DTPREL32 +0 +[0-9a-f ]+R_PPC_DTPMOD32 +0 +[0-9a-f ]+R_PPC_DTPMOD32 +0+ +gd \+ 0 +[0-9a-f ]+R_PPC_DTPREL32 +0+ +gd \+ 0 +[0-9a-f ]+R_PPC_DTPMOD32 +0+1c +gd0 \+ 0 +[0-9a-f ]+R_PPC_DTPREL32 +0+1c +gd0 \+ 0 +[0-9a-f ]+R_PPC_TPREL32 +0+2c +ie0 \+ 0 + +Relocation section '\.rela\.plt' at offset 0x[0-9a-f]+ contains 1 entries: + Offset +Info +Type +Sym\. Value +Symbol's Name \+ Addend +[0-9a-f ]+R_PPC_JMP_SLOT +0+ +__tls_get_addr \+ 0 + +Symbol table '\.dynsym' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +.* NOTYPE +LOCAL +DEFAULT +UND +.* SECTION +LOCAL +DEFAULT +6 +.* SECTION +LOCAL +DEFAULT +7 +.* TLS +GLOBAL +DEFAULT +UND gd +.* TLS +GLOBAL +DEFAULT +8 le0 +.* NOTYPE +GLOBAL +DEFAULT +UND __tls_get_addr +.* TLS +GLOBAL +DEFAULT +8 ld0 +.* TLS +GLOBAL +DEFAULT +8 le1 +.* TLS +GLOBAL +DEFAULT +UND ld +.* NOTYPE +GLOBAL +DEFAULT +6 _start +.* NOTYPE +GLOBAL +DEFAULT +11 __end +.* TLS +GLOBAL +DEFAULT +8 ld2 +.* TLS +GLOBAL +DEFAULT +8 ld1 +.* NOTYPE +GLOBAL +DEFAULT +11 __bss_start +.* NOTYPE +GLOBAL +DEFAULT +10 _edata +.* NOTYPE +GLOBAL +DEFAULT +11 _end +.* TLS +GLOBAL +DEFAULT +8 gd0 +.* TLS +GLOBAL +DEFAULT +8 ie0 + +Symbol table '\.symtab' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +.* NOTYPE +LOCAL +DEFAULT +UND +.* SECTION +LOCAL +DEFAULT +1 +.* SECTION +LOCAL +DEFAULT +2 +.* SECTION +LOCAL +DEFAULT +3 +.* SECTION +LOCAL +DEFAULT +4 +.* SECTION +LOCAL +DEFAULT +5 +.* SECTION +LOCAL +DEFAULT +6 +.* SECTION +LOCAL +DEFAULT +7 +.* SECTION +LOCAL +DEFAULT +8 +.* SECTION +LOCAL +DEFAULT +9 +.* SECTION +LOCAL +DEFAULT +10 +.* SECTION +LOCAL +DEFAULT +11 +.* FILE +LOCAL +DEFAULT +ABS .* +.* TLS +LOCAL +DEFAULT +7 gd4 +.* TLS +LOCAL +DEFAULT +7 ld4 +.* TLS +LOCAL +DEFAULT +7 ld5 +.* TLS +LOCAL +DEFAULT +7 ld6 +.* TLS +LOCAL +DEFAULT +7 ie4 +.* TLS +LOCAL +DEFAULT +7 le4 +.* TLS +LOCAL +DEFAULT +7 le5 +.* FILE +LOCAL +DEFAULT +ABS .* +.* OBJECT +LOCAL +DEFAULT +9 _DYNAMIC +.* OBJECT +LOCAL +DEFAULT +10 _GLOBAL_OFFSET_TABLE_ +.* TLS +GLOBAL +DEFAULT +UND gd +.* TLS +GLOBAL +DEFAULT +8 le0 +.* NOTYPE +GLOBAL +DEFAULT +UND __tls_get_addr +.* TLS +GLOBAL +DEFAULT +8 ld0 +.* TLS +GLOBAL +DEFAULT +8 le1 +.* TLS +GLOBAL +DEFAULT +UND ld +.* NOTYPE +GLOBAL +DEFAULT +6 _start +.* NOTYPE +GLOBAL +DEFAULT +11 __end +.* TLS +GLOBAL +DEFAULT +8 ld2 +.* TLS +GLOBAL +DEFAULT +8 ld1 +.* NOTYPE +GLOBAL +DEFAULT +11 __bss_start +.* NOTYPE +GLOBAL +DEFAULT +10 _edata +.* NOTYPE +GLOBAL +DEFAULT +11 _end +.* TLS +GLOBAL +DEFAULT +8 gd0 +.* TLS +GLOBAL +DEFAULT +8 ie0 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlsso32.t b/binutils-2.24/ld/testsuite/ld-powerpc/tlsso32.t new file mode 100644 index 0000000..40edbba --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlsso32.t @@ -0,0 +1,11 @@ +#source: tls32.s +#as: -a32 +#ld: -shared +#objdump: -sj.tdata +#target: powerpc*-*-* + +.* + +Contents of section \.tdata: +.* (12345678|78563412) (23456789|89674523) (3456789a|9a785634) (456789ab|ab896745) .* +.* (56789abc|bc9a7856) (6789abcd|cdab8967) (789abcde|debc9a78) .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlstoc.d b/binutils-2.24/ld/testsuite/ld-powerpc/tlstoc.d new file mode 100644 index 0000000..dccf82e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlstoc.d @@ -0,0 +1,37 @@ +#source: tlslib.s +#source: tlstoc.s +#as: -a64 +#ld: +#objdump: -dr +#target: powerpc64*-*-* + +.* + +Disassembly of section \.text: + +.* <\.__tls_get_addr>: +.* (4e 80 00 20|20 00 80 4e) blr + +.* <\._start>: +.* (3c 6d 00 00|00 00 6d 3c) addis r3,r13,0 +.* (60 00 00 00|00 00 00 60) nop +.* (38 63 90 40|40 90 63 38) addi r3,r3,-28608 +.* (3c 6d 00 00|00 00 6d 3c) addis r3,r13,0 +.* (60 00 00 00|00 00 00 60) nop +.* (38 63 10 00|00 10 63 38) addi r3,r3,4096 +.* (3c 6d 00 00|00 00 6d 3c) addis r3,r13,0 +.* (60 00 00 00|00 00 00 60) nop +.* (38 63 90 48|48 90 63 38) addi r3,r3,-28600 +.* (3c 6d 00 00|00 00 6d 3c) addis r3,r13,0 +.* (60 00 00 00|00 00 00 60) nop +.* (38 63 10 00|00 10 63 38) addi r3,r3,4096 +.* (39 23 80 50|50 80 23 39) addi r9,r3,-32688 +.* (3d 23 00 00|00 00 23 3d) addis r9,r3,0 +.* (81 49 80 58|58 80 49 81) lwz r10,-32680\(r9\) +.* (e9 22 80 40|40 80 22 e9) ld r9,-32704\(r2\) +.* (7d 49 18 2a|2a 18 49 7d) ldx r10,r9,r3 +.* (3d 2d 00 00|00 00 2d 3d) addis r9,r13,0 +.* (a1 49 90 68|68 90 49 a1) lhz r10,-28568\(r9\) +.* (89 4d 90 70|70 90 4d 89) lbz r10,-28560\(r13\) +.* (3d 2d 00 00|00 00 2d 3d) addis r9,r13,0 +.* (99 49 90 78|78 90 49 99) stb r10,-28552\(r9\) diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlstoc.g b/binutils-2.24/ld/testsuite/ld-powerpc/tlstoc.g new file mode 100644 index 0000000..e5c1e31 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlstoc.g @@ -0,0 +1,15 @@ +#source: tlslib.s +#source: tlstoc.s +#as: -a64 +#ld: +#objdump: -sj.got +#target: powerpc64*-*-* + +.* + +Contents of section \.got: + 100101b8 (00000000|01000000) (00000001|00000000) 00000000 00000000 .* + 100101c8 (00000000|01000000) (00000001|00000000) 00000000 00000000 .* + 100101d8 (00000000|01000000) (00000001|00000000) 00000000 00000000 .* + 100101e8 (00000000|01000000) (00000001|00000000) 00000000 00000000 .* + 100101f8 (ffffffff|6080ffff) (ffff8060|ffffffff) 00000000 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlstoc.s b/binutils-2.24/ld/testsuite/ld-powerpc/tlstoc.s new file mode 100644 index 0000000..f5dbfdd --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlstoc.s @@ -0,0 +1,93 @@ + .section ".tbss","awT",@nobits + .global _start,gd0,ld0,ld1,ld2,ie0,le0,le1 + .align 3 +gd0: .space 8 +ld0: .space 8 +ld1: .space 8 +ld2: .space 8 +ie0: .space 8 +le0: .space 8 +le1: .space 8 + + .section ".tdata","awT",@progbits + .align 3 +gd4: .quad 0x123456789abcdef0 +ld4: .quad 0x23456789abcdef01 +ld5: .quad 0x3456789abcdef012 +ld6: .quad 0x456789abcdef0123 +ie4: .quad 0x56789abcdef01234 +le4: .quad 0x6789abcdef012345 +le5: .quad 0x789abcdef0123456 + + .section ".opd","aw",@progbits + .p2align 3 +_start: + .quad .L_start,.TOC.@tocbase,0 + + .text +.L_start: +#extern syms +#GD + addi 3,2,.Lgd@toc + bl .__tls_get_addr + nop + .section .toc,"aw",@progbits +.Lgd: + .quad gd@dtpmod + .quad gd@dtprel + .text +#LD + addi 3,2,.Lld@toc + bl .__tls_get_addr + nop + .section .toc,"aw",@progbits +.Lld: + .quad ld@dtpmod + .quad 0 + .text + +#global syms +#GD + addi 3,2,.Lgd0@toc + bl .__tls_get_addr + nop + .section .toc,"aw",@progbits +.Lgd0: + .quad gd0@dtpmod + .quad gd0@dtprel + .text +#LD + addi 3,2,.Lld0@toc + bl .__tls_get_addr + nop + .section .toc,"aw",@progbits +.Lld0: + .quad ld0@dtpmod + .quad 0 + .text + + addi 9,3,ld0@dtprel + + addis 9,3,ld1@dtprel@ha + lwz 10,ld1@dtprel@l(9) + + ld 9,.Lld2@toc(2) + ldx 10,9,3 + .section .toc,"aw",@progbits +.Lld2: + .quad ld2@dtprel + .text + +#IE + ld 9,.Lie0@toc(2) + lhzx 10,9,.Lie0@tls + .section .toc,"aw",@progbits +.Lie0: + .quad ie0@tprel + .text + +#LE + lbz 10,le0@tprel(13) #R_PPC64_TPREL16 le0 + + addis 9,13,le1@tprel@ha #R_PPC64_TPREL16_HA le1 + stb 10,le1@tprel@l(9) #R_PPC64_TPREL16_LO le1 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlstoc.t b/binutils-2.24/ld/testsuite/ld-powerpc/tlstoc.t new file mode 100644 index 0000000..cdf43e7 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlstoc.t @@ -0,0 +1,14 @@ +#source: tlslib.s +#source: tlstoc.s +#as: -a64 +#ld: +#objdump: -sj.tdata +#target: powerpc64*-*-* + +.* + +Contents of section \.tdata: + 10010148 (00c0ffee|eeffc000) 00000000 (12345678|f0debc9a) (9abcdef0|78563412) .* + 10010158 (23456789|01efcdab) (abcdef01|89674523) (3456789a|12f0debc) (bcdef012|9a785634) .* + 10010168 (456789ab|2301efcd) (cdef0123|ab896745) (56789abc|3412f0de) (def01234|bc9a7856) .* + 10010178 (6789abcd|452301ef) (ef012345|cdab8967) (789abcde|563412f0) (f0123456|debc9a78) .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlstocso.d b/binutils-2.24/ld/testsuite/ld-powerpc/tlstocso.d new file mode 100644 index 0000000..6aa1056 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlstocso.d @@ -0,0 +1,63 @@ +#source: tlstoc.s +#as: -a64 +#ld: -shared +#objdump: -dr +#target: powerpc64*-*-* + +.* + +Disassembly of section \.text: + +.* <.*plt_call\.__tls_get_addr(|_opt)>: +.* (f8 41 00 28|28 00 41 f8) std r2,40\(r1\) +.* (e9 82 80 70|70 80 82 e9) ld r12,-32656\(r2\) +.* (7d 89 03 a6|a6 03 89 7d) mtctr r12 +.* (e8 42 80 78|78 80 42 e8) ld r2,-32648\(r2\) +.* (28 22 00 00|00 00 22 28) cmpldi r2,0 +.* (4c e2 04 20|20 04 e2 4c) bnectr\+ * +.* (48 00 00 ..|.. 00 00 48) b .* <__tls_get_addr@plt> + +.* <\._start>: +.* (38 62 80 08|08 80 62 38) addi r3,r2,-32760 +.* (4b ff ff ..|.. ff ff 4b) bl .*plt_call.__tls_get_addr.* +.* (e8 41 00 28|28 00 41 e8) ld r2,40\(r1\) +.* (38 62 80 18|18 80 62 38) addi r3,r2,-32744 +.* (4b ff ff ..|.. ff ff 4b) bl .*plt_call.__tls_get_addr.* +.* (e8 41 00 28|28 00 41 e8) ld r2,40\(r1\) +.* (38 62 80 28|28 80 62 38) addi r3,r2,-32728 +.* (4b ff ff ..|.. ff ff 4b) bl .*plt_call.__tls_get_addr.* +.* (e8 41 00 28|28 00 41 e8) ld r2,40\(r1\) +.* (38 62 80 38|38 80 62 38) addi r3,r2,-32712 +.* (4b ff ff ..|.. ff ff 4b) bl .*plt_call.__tls_get_addr.* +.* (e8 41 00 28|28 00 41 e8) ld r2,40\(r1\) +.* (39 23 80 40|40 80 23 39) addi r9,r3,-32704 +.* (3d 23 00 00|00 00 23 3d) addis r9,r3,0 +.* (81 49 80 48|48 80 49 81) lwz r10,-32696\(r9\) +.* (e9 22 80 48|48 80 22 e9) ld r9,-32696\(r2\) +.* (7d 49 18 2a|2a 18 49 7d) ldx r10,r9,r3 +.* (e9 22 80 50|50 80 22 e9) ld r9,-32688\(r2\) +.* (7d 49 6a 2e|2e 6a 49 7d) lhzx r10,r9,r13 +.* (89 4d 00 00|00 00 4d 89) lbz r10,0\(r13\) +.* (3d 2d 00 00|00 00 2d 3d) addis r9,r13,0 +.* (99 49 00 00|00 00 49 99) stb r10,0\(r9\) +.* (60 00 00 00|00 00 00 60) nop +.* (00 00 00 00|30 02 01 00) .* +.* (00 01 02 30|00 00 00 00) .* +.* <__glink_PLTresolve>: +.* (7d 88 02 a6|a6 02 88 7d) mflr r12 +.* (42 9f 00 05|05 00 9f 42) bcl 20,4\*cr7\+so,.* +.* (7d 68 02 a6|a6 02 68 7d) mflr r11 +.* (e8 4b ff f0|f0 ff 4b e8) ld r2,-16\(r11\) +.* (7d 88 03 a6|a6 03 88 7d) mtlr r12 +.* (7d 62 5a 14|14 5a 62 7d) add r11,r2,r11 +.* (e9 8b 00 00|00 00 8b e9) ld r12,0\(r11\) +.* (e8 4b 00 08|08 00 4b e8) ld r2,8\(r11\) +.* (7d 89 03 a6|a6 03 89 7d) mtctr r12 +.* (e9 6b 00 10|10 00 6b e9) ld r11,16\(r11\) +.* (4e 80 04 20|20 04 80 4e) bctr +.* (60 00 00 00|00 00 00 60) nop +.* (60 00 00 00|00 00 00 60) nop +.* (60 00 00 00|00 00 00 60) nop +.* <__tls_get_addr@plt>: +.* (38 00 00 00|00 00 00 38) li r0,0 +.* (4b ff ff c4|c4 ff ff 4b) b .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlstocso.g b/binutils-2.24/ld/testsuite/ld-powerpc/tlstocso.g new file mode 100644 index 0000000..9da93ec --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlstocso.g @@ -0,0 +1,15 @@ +#source: tlstoc.s +#as: -a64 +#ld: -shared +#objdump: -sj.got +#target: powerpc64*-*-* + +.* + +Contents of section \.got: + 10720 (00000000|20870100) (00018720|00000000) 00000000 00000000 .* +.* 00000000 00000000 00000000 00000000 .* +.* 00000000 00000000 00000000 00000000 .* +.* 00000000 00000000 00000000 00000000 .* +.* 00000000 00000000 00000000 00000000 .* +.* 00000000 00000000 .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlstocso.r b/binutils-2.24/ld/testsuite/ld-powerpc/tlstocso.r new file mode 100644 index 0000000..f5bdfe3 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlstocso.r @@ -0,0 +1,129 @@ +#source: tlstoc.s +#as: -a64 +#ld: -shared -melf64ppc +#readelf: -WSsrl +#target: powerpc64*-*-* + +There are [0-9]+ section headers, starting at offset 0x[0-9a-f]+: + +Section Headers: + +\[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al + +\[[ 0-9]+\] +NULL +0+ 0+ 0+ 0+ +0 +0 +0 + +\[[ 0-9]+\] \.hash .* + +\[[ 0-9]+\] \.dynsym .* + +\[[ 0-9]+\] \.dynstr .* + +\[[ 0-9]+\] \.rela\.dyn .* + +\[[ 0-9]+\] \.rela\.plt .* + +\[[ 0-9]+\] \.text .* + +\[[ 0-9]+\] \.tdata +PROGBITS .* 0+38 0+ WAT +0 +0 +8 + +\[[ 0-9]+\] \.tbss +NOBITS .* 0+38 0+ WAT +0 +0 +8 + +\[[ 0-9]+\] \.dynamic .* + +\[[ 0-9]+\] \.opd .* + +\[[ 0-9]+\] \.got .* + +\[[ 0-9]+\] \.plt .* + +\[[ 0-9]+\] \.shstrtab .* + +\[[ 0-9]+\] \.symtab .* + +\[[ 0-9]+\] \.strtab .* +#... + +Elf file type is DYN \(Shared object file\) +Entry point 0x[0-9a-f]+ +There are [0-9]+ program headers, starting at offset [0-9]+ + +Program Headers: + +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align + +LOAD .* R E 0x10000 + +LOAD .* RW +0x10000 + +DYNAMIC .* RW +0x8 + +TLS .* 0x0+38 0x0+70 R +0x8 + + Section to Segment mapping: + +Segment Sections\.\.\. + +0+ +\.hash \.dynsym \.dynstr \.rela\.dyn \.rela\.plt \.text * + +01 +\.tdata \.dynamic \.opd \.got \.plt * + +02 +\.dynamic * + +03 +\.tdata \.tbss * + +Relocation section '\.rela\.dyn' at offset .* contains 13 entries: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend +[0-9a-f ]+R_PPC64_RELATIVE +4dc +[0-9a-f ]+R_PPC64_RELATIVE +18720 +[0-9a-f ]+R_PPC64_TPREL16 +0+60 le0 \+ 0 +[0-9a-f ]+R_PPC64_TPREL16_HA +0+68 le1 \+ 0 +[0-9a-f ]+R_PPC64_TPREL16_LO +0+68 le1 \+ 0 +[0-9a-f ]+R_PPC64_DTPMOD64 +0+ gd \+ 0 +[0-9a-f ]+R_PPC64_DTPREL64 +0+ gd \+ 0 +[0-9a-f ]+R_PPC64_DTPMOD64 +0+ ld \+ 0 +[0-9a-f ]+R_PPC64_DTPMOD64 +0+38 gd0 \+ 0 +[0-9a-f ]+R_PPC64_DTPREL64 +0+38 gd0 \+ 0 +[0-9a-f ]+R_PPC64_DTPMOD64 +0+40 ld0 \+ 0 +[0-9a-f ]+R_PPC64_DTPREL64 +0+50 ld2 \+ 0 +[0-9a-f ]+R_PPC64_TPREL64 +0+58 ie0 \+ 0 + +Relocation section '\.rela\.plt' at offset .* contains 1 entries: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend +[0-9a-f ]+R_PPC64_JMP_SLOT +0+ __tls_get_addr \+ 0 + +Symbol table '\.dynsym' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +.* NOTYPE +LOCAL +DEFAULT +UND * +.* SECTION +LOCAL +DEFAULT +6 * +.* SECTION +LOCAL +DEFAULT +7 * +.* TLS +GLOBAL +DEFAULT +UND gd +.* TLS +GLOBAL +DEFAULT +8 le0 +.* NOTYPE +GLOBAL +DEFAULT +UND __tls_get_addr +.* TLS +GLOBAL +DEFAULT +8 ld0 +.* TLS +GLOBAL +DEFAULT +8 le1 +.* TLS +GLOBAL +DEFAULT +UND ld +.* FUNC +GLOBAL +DEFAULT +10 _start +.* 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 _end +.* TLS +GLOBAL +DEFAULT +8 gd0 +.* TLS +GLOBAL +DEFAULT +8 ie0 + +Symbol table '\.symtab' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +.* NOTYPE +LOCAL +DEFAULT +UND * +.* SECTION +LOCAL +DEFAULT +1 * +.* SECTION +LOCAL +DEFAULT +2 * +.* SECTION +LOCAL +DEFAULT +3 * +.* SECTION +LOCAL +DEFAULT +4 * +.* SECTION +LOCAL +DEFAULT +5 * +.* SECTION +LOCAL +DEFAULT +6 * +.* SECTION +LOCAL +DEFAULT +7 * +.* SECTION +LOCAL +DEFAULT +8 * +.* SECTION +LOCAL +DEFAULT +9 * +.* SECTION +LOCAL +DEFAULT +10 * +.* SECTION +LOCAL +DEFAULT +11 * +.* SECTION +LOCAL +DEFAULT +12 * +.* FILE +LOCAL +DEFAULT +ABS .* +.* TLS +LOCAL +DEFAULT +7 gd4 +.* TLS +LOCAL +DEFAULT +7 ld4 +.* TLS +LOCAL +DEFAULT +7 ld5 +.* TLS +LOCAL +DEFAULT +7 ld6 +.* TLS +LOCAL +DEFAULT +7 ie4 +.* TLS +LOCAL +DEFAULT +7 le4 +.* TLS +LOCAL +DEFAULT +7 le5 +.* NOTYPE +LOCAL +DEFAULT +11 \.Lie0 +.* NOTYPE +LOCAL +DEFAULT +UND \.__tls_get_addr +.* FILE +LOCAL +DEFAULT +ABS .* +.* OBJECT +LOCAL +DEFAULT +9 _DYNAMIC +.* NOTYPE +LOCAL +DEFAULT +6 .*\.plt_call\.__tls_get_addr +.* NOTYPE +LOCAL +DEFAULT +6 __glink_PLTresolve +.* TLS +GLOBAL +DEFAULT +UND gd +.* TLS +GLOBAL +DEFAULT +8 le0 +.* NOTYPE +GLOBAL +DEFAULT +UND __tls_get_addr +.* TLS +GLOBAL +DEFAULT +8 ld0 +.* TLS +GLOBAL +DEFAULT +8 le1 +.* TLS +GLOBAL +DEFAULT +UND ld +.* FUNC +GLOBAL +DEFAULT +10 _start +.* 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 _end +.* TLS +GLOBAL +DEFAULT +8 gd0 +.* TLS +GLOBAL +DEFAULT +8 ie0 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tlstocso.t b/binutils-2.24/ld/testsuite/ld-powerpc/tlstocso.t new file mode 100644 index 0000000..408d2a5 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tlstocso.t @@ -0,0 +1,13 @@ +#source: tlstoc.s +#as: -a64 +#ld: -shared +#objdump: -sj.tdata +#target: powerpc64*-*-* + +.* + +Contents of section \.tdata: +.* (12345678|f0debc9a) (9abcdef0|78563412) (23456789|01efcdab) (abcdef01|89674523) .* +.* (3456789a|12f0debc) (bcdef012|9a785634) (456789ab|2301efcd) (cdef0123|ab896745) .* +.* (56789abc|3412f0de) (def01234|bc9a7856) (6789abcd|452301ef) (ef012345|cdab8967) .* +.* (789abcde|563412f0) (f0123456|debc9a78) .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tocopt.d b/binutils-2.24/ld/testsuite/ld-powerpc/tocopt.d new file mode 100644 index 0000000..161f00d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tocopt.d @@ -0,0 +1,14 @@ + +.*: file format .* + +Contents of section \.text: + 100000b0 (3d220000|0000223d) (e9298018|188029e9) (3c820000|0000823c) (38a48020|2080a438) .* + 100000c0 (e8c50000|0000c5e8) (3fa00000|0000a03f) (3bbd8028|2880bd3b) (7c62e82a|2ae8627c) .* + 100000d0 (3d220000|0000223d) (39298033|33802939) (3c820000|0000823c) (38a48008|0880a438) .* + 100000e0 (e8c50000|0000c5e8) (3fa00000|0000a03f) (3bbd8010|1080bd3b) (7c62e82a|2ae8627c) .* +Contents of section \.got: + 100100f0 (00000000|f0800110) (100180f0|00000000) (00000000|24010110) (10010124|00000000) .* + 10010100 (00000000|25010110) (10010125|00000000) (00000000|20010110) (10010120|00000000) .* + 10010110 (00000000|21010110) (10010121|00000000) (00000000|22010110) (10010122|00000000) .* +Contents of section \.sdata: + 10010120 01020304 0506 .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tocopt.out b/binutils-2.24/ld/testsuite/ld-powerpc/tocopt.out new file mode 100644 index 0000000..b551e86 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tocopt.out @@ -0,0 +1,4 @@ +.* +\(\.text\+0x14\): .* +.* +\(\.text\+0x34\): .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tocopt.s b/binutils-2.24/ld/testsuite/ld-powerpc/tocopt.s new file mode 100644 index 0000000..a2447ca --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tocopt.s @@ -0,0 +1,51 @@ + .section .toc,"aw" +x4t: + .quad x4 +x5t: + .quad x5 +x6t: + .quad x6 + + .section .sdata,"aw" +x1: + .byte 1 +x2: + .byte 2 +x3: + .byte 3 +x4: + .byte 4 +x5: + .byte 5 +x6: + .byte 6 + + .globl _start + .text +_start: +# no need for got entry, optimise to nop,addi +# note: ld doesn't yet do got optimisation, so we get nop,ld + addis 9,2,x1@got@ha + ld 9,x1@got@l(9) +# must keep got entry, optimise to nop,addi,ld + addis 4,2,x2@got@ha + addi 5,4,x2@got@l + ld 6,0(5) +# must keep got entry, optimise to nop,li,ldx + lis 29,x3@got@ha + addi 29,29,x3@got@l + ldx 3,2,29 + +# no need for toc entry, optimise to nop,addi + addis 9,2,x4t@toc@ha + ld 9,x4t@toc@l(9) +# must keep toc entry, optimise to nop,addi,ld +# if we had a reloc tying the ld to x5/x5t then we could throw away +# the toc entry and optimise to nop,nop,addi + addis 4,2,x5t@toc@ha + addi 5,4,x5t@toc@l + ld 6,0(5) +# must keep toc entry, optimise to nop,li,ldx + lis 29,x6t@toc@ha + addi 29,29,x6t@toc@l + ldx 3,2,29 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tocopt2.d b/binutils-2.24/ld/testsuite/ld-powerpc/tocopt2.d new file mode 100644 index 0000000..a3e4aa7 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tocopt2.d @@ -0,0 +1,5 @@ + +.*: file format .* + +Contents of section \.text: + 100000b0 (3d22effe|feef223d) (39297f4a|4a7f2939) .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tocopt2.out b/binutils-2.24/ld/testsuite/ld-powerpc/tocopt2.out new file mode 100644 index 0000000..9f29071 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tocopt2.out @@ -0,0 +1 @@ +.*: xt defined on removed toc entry diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tocopt2.s b/binutils-2.24/ld/testsuite/ld-powerpc/tocopt2.s new file mode 100644 index 0000000..8d07de0 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tocopt2.s @@ -0,0 +1,10 @@ + .globl xt + .section .toc,"aw" +xt: + .quad x + + .globl _start + .text +_start: + addis 9,2,xt@toc@ha + ld 9,xt@toc@l(9) diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tocopt3.d b/binutils-2.24/ld/testsuite/ld-powerpc/tocopt3.d new file mode 100644 index 0000000..a3e4aa7 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tocopt3.d @@ -0,0 +1,5 @@ + +.*: file format .* + +Contents of section \.text: + 100000b0 (3d22effe|feef223d) (39297f4a|4a7f2939) .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tocopt3.s b/binutils-2.24/ld/testsuite/ld-powerpc/tocopt3.s new file mode 100644 index 0000000..abadbfa --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tocopt3.s @@ -0,0 +1,9 @@ + .section .toc,"aw" +0: + .quad x + + .globl _start + .text +_start: + addis 9,2,0b@toc@ha + ld 9,0b@toc@l(9) diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tocopt4.d b/binutils-2.24/ld/testsuite/ld-powerpc/tocopt4.d new file mode 100644 index 0000000..1e0ccc5 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tocopt4.d @@ -0,0 +1,7 @@ + +.*: file format .* + +Contents of section \.text: + 100000b0 (e9298000|008029e9) .* +Contents of section \.got: + 100100b8 (00000000|02000000) (00000002|00000000) .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tocopt4a.s b/binutils-2.24/ld/testsuite/ld-powerpc/tocopt4a.s new file mode 100644 index 0000000..3d6f28e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tocopt4a.s @@ -0,0 +1,4 @@ + .globl _start + .text +_start: + ld 9,xt@toc(9) diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tocopt4b.s b/binutils-2.24/ld/testsuite/ld-powerpc/tocopt4b.s new file mode 100644 index 0000000..ee77d10 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tocopt4b.s @@ -0,0 +1,17 @@ + .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) diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tocopt5.d b/binutils-2.24/ld/testsuite/ld-powerpc/tocopt5.d new file mode 100644 index 0000000..758b7fc --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tocopt5.d @@ -0,0 +1,13 @@ + +.*: file format .* + +Contents of section \.text: + 100000b0 (60000000|00000060) (e9228018|188022e9) (60000000|00000060) (38a28020|2080a238) .* + 100000c0 (e8c50000|0000c5e8) (60000000|00000060) (3922802b|2b802239) (60000000|00000060) .* + 100000d0 (38a28008|0880a238) (e8c50000|0000c5e8) .* +Contents of section \.got: + 100100d8 (00000000|d8800110) (100180d8|00000000) (00000000|04010110) (10010104|00000000) .* + 100100e8 (00000000|05010110) (10010105|00000000) (00000000|00010110) (10010100|00000000) .* + 100100f8 (00000000|01010110) (10010101|00000000) .* +Contents of section \.sdata: + 10010100 01020304 0506 .* diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/tocopt5.s b/binutils-2.24/ld/testsuite/ld-powerpc/tocopt5.s new file mode 100644 index 0000000..67da1a9 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/tocopt5.s @@ -0,0 +1,43 @@ + .section .toc,"aw" +x4t: + .quad x4 +x5t: + .quad x5 +x6t: + .quad x6 + + .section .sdata,"aw" +x1: + .byte 1 +x2: + .byte 2 +x3: + .byte 3 +x4: + .byte 4 +x5: + .byte 5 +x6: + .byte 6 + + .globl _start + .text +_start: +# no need for got entry, optimise to nop,addi +# note: ld doesn't yet do got optimisation, so we get nop,ld + addis 9,2,x1@got@ha + ld 9,x1@got@l(9) +# must keep got entry, optimise to nop,addi,ld + addis 4,2,x2@got@ha + addi 5,4,x2@got@l + ld 6,0(5) + +# no need for toc entry, optimise to nop,addi + addis 9,2,x4t@toc@ha + ld 9,x4t@toc@l(9) +# must keep toc entry, optimise to nop,addi,ld +# if we had a reloc tying the ld to x5/x5t then we could throw away +# the toc entry and optimise to nop,nop,addi + addis 4,2,x5t@toc@ha + addi 5,4,x5t@toc@l + ld 6,0(5) diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-1.d b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-1.d new file mode 100644 index 0000000..d9554a1 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-1.d @@ -0,0 +1,14 @@ + +Elf file type is EXEC.* +Entry point 0x0 +There are 2 program headers, starting at offset [0-9]+ + +Program Headers: + Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align + LOAD ( +0x[0-9a-f]+){5} ([RWE ]+){3} 0x[0-f]+ + LOAD ( +0x[0-9a-f]+){5} R E 0x[0-9a-f]+ + + Section to Segment mapping: + Segment Sections... + 00 .data + 01 .text_vle .text_iv .iv_handlers diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-1.ld b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-1.ld new file mode 100644 index 0000000..f2ff319 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-1.ld @@ -0,0 +1,17 @@ +SECTIONS +{ + .data 0x00000400 : + { *(.data) *(.ctors) *(.dtors) *(.eh_frame) *(.jcr) } + .text_vle 0x00001000 : + { + . = ALIGN(16); + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.text_vle) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.text) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.init) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.init_vle) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.fini) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.fini_vle) + } + .text_iv . : { . = ALIGN(16); *(.text_iv) } + .iv_handlers 0x0001F000 : { *(.iv_handlers) } +} diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-2.d b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-2.d new file mode 100644 index 0000000..9d83bb5 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-2.d @@ -0,0 +1,16 @@ + +Elf file type is EXEC.* +Entry point 0x0 +There are 3 program headers, starting at offset [0-9]+ + +Program Headers: + Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align + LOAD ( +0x[0-9a-f]+){5} R E 0x[0-9a-f]+ + LOAD ( +0x[0-9a-f]+){5} ([RWE ]+){3} 0x[0-f]+ + LOAD ( +0x[0-9a-f]+){5} R E 0x[0-9a-f]+ + + Section to Segment mapping: + Segment Sections... + 00 .text_vle + 01 .data + 02 .text_iv .iv_handlers diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-2.ld b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-2.ld new file mode 100644 index 0000000..2320b61 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-2.ld @@ -0,0 +1,17 @@ +SECTIONS +{ + .text_vle 0x00001000 : + { + . = ALIGN(16); + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.text_vle) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.text) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.init) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.init_vle) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.fini) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.fini_vle) + } + .data 0x00001400 : + { *(.data) *(.ctors) *(.dtors) *(.eh_frame) *(.jcr) } + .text_iv . : { . = ALIGN(16); *(.text_iv) } + .iv_handlers 0x0001F000 : { *(.iv_handlers) } +} diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-3.d b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-3.d new file mode 100644 index 0000000..957b990 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-3.d @@ -0,0 +1,16 @@ + +Elf file type is EXEC.* +Entry point 0x0 +There are 3 program headers, starting at offset [0-9]+ + +Program Headers: + Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align + LOAD ( +0x[0-9a-f]+){5} R E 0x[0-9a-f]+ + LOAD ( +0x[0-9a-f]+){5} ([RWE ]+){3} 0x[0-f]+ + LOAD ( +0x[0-9a-f]+){5} R E 0x[0-9a-f]+ + + Section to Segment mapping: + Segment Sections... + 00 .text_vle .text_iv + 01 .data + 02 .iv_handlers diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-3.ld b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-3.ld new file mode 100644 index 0000000..0ed2f44 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-3.ld @@ -0,0 +1,17 @@ +SECTIONS +{ + .text_vle 0x00001000 : + { + . = ALIGN(16); + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.text_vle) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.text) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.init) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.init_vle) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.fini) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.fini_vle) + } + .text_iv . : { . = ALIGN(16); *(.text_iv) } + .data 0x00001400 : + { *(.data) *(.ctors) *(.dtors) *(.eh_frame) *(.jcr) } + .iv_handlers 0x0001F000 : { *(.iv_handlers) } +} diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-4.d b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-4.d new file mode 100644 index 0000000..9edbe06 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-4.d @@ -0,0 +1,14 @@ + +Elf file type is EXEC.* +Entry point 0x0 +There are 2 program headers, starting at offset [0-9]+ + +Program Headers: + Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align + LOAD ( +0x[0-9a-f]+){5} R E 0x[0-9a-f]+ + LOAD ( +0x[0-9a-f]+){5} ([RWE ]+){3} 0x[0-f]+ + + Section to Segment mapping: + Segment Sections... + 00 .text_vle .text_iv .iv_handlers + 01 .data diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-4.ld b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-4.ld new file mode 100644 index 0000000..503fe06 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-4.ld @@ -0,0 +1,17 @@ +SECTIONS +{ + .text_vle 0x00001000 : + { + . = ALIGN(16); + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.text_vle) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.text) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.init) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.init_vle) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.fini) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.fini_vle) + } + .text_iv . : { . = ALIGN(16); *(.text_iv) } + .iv_handlers 0x0001F000 : { *(.iv_handlers) } + .data 0x00020400 : + { *(.data) *(.ctors) *(.dtors) *(.eh_frame) *(.jcr) } +} diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-5.d b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-5.d new file mode 100644 index 0000000..957b990 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-5.d @@ -0,0 +1,16 @@ + +Elf file type is EXEC.* +Entry point 0x0 +There are 3 program headers, starting at offset [0-9]+ + +Program Headers: + Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align + LOAD ( +0x[0-9a-f]+){5} R E 0x[0-9a-f]+ + LOAD ( +0x[0-9a-f]+){5} ([RWE ]+){3} 0x[0-f]+ + LOAD ( +0x[0-9a-f]+){5} R E 0x[0-9a-f]+ + + Section to Segment mapping: + Segment Sections... + 00 .text_vle .text_iv + 01 .data + 02 .iv_handlers diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-5.ld b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-5.ld new file mode 100644 index 0000000..4000021 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-5.ld @@ -0,0 +1,44 @@ + +MEMORY +{ + code_rom (rxw) : org = 0x00001000, len = 0x1EF000 + irpt_rom (rx) : org = 0x001F0000, len = 0x2000 + int__ram (rxw) : org = 0x40000000, len = 256K +} + +REGION_ALIAS("INTR", irpt_rom) +REGION_ALIAS("CODE", code_rom) +REGION_ALIAS("RODATA", code_rom) +REGION_ALIAS("RAM", int__ram) + +SECTIONS +{ + .iv_handlers : + { + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.iv_handlers) + } > INTR + + .text_vle : + { + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.text_vle) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.text) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.init) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.init_vle) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.fini) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.fini_vle) + } > CODE + + .rodata : + { + *(.rodata) + } > RODATA + + .data : + { + *(.data) + *(.data.*) + *(.ctors) + *(.dtors) + } > RAM AT>RODATA + +} diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-6.d b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-6.d new file mode 100644 index 0000000..5c3c210 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-6.d @@ -0,0 +1,25 @@ +#source: vle-multiseg-6a.s -mregnames -mvle +#source: vle-multiseg-6b.s +#source: vle-multiseg-6c.s +#source: vle-multiseg-6d.s -mregnames -mvle +#ld: -T vle-multiseg-6.ld +#target: powerpc-*-* +#readelf: -l + +Elf file type is EXEC.* +Entry point 0x[0-9a-f]+ +There are 4 program headers, starting at offset [0-9]+ + +Program Headers: + Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align + LOAD ( +0x[0-9a-f]+){5} ([RWE ]+){3} 0x[0-f]+ + LOAD ( +0x[0-9a-f]+){5} R E 0x[0-9a-f]+ + LOAD ( +0x[0-9a-f]+){5} R E 0x[0-9a-f]+ + LOAD ( +0x[0-9a-f]+){5} R E 0x[0-9a-f]+ + + Section to Segment mapping: + Segment Sections... + 00 .data + 01 .text_vle + 02 .text_iv + 03 .text diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-6.ld b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-6.ld new file mode 100644 index 0000000..c8d88dd --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-6.ld @@ -0,0 +1,37 @@ +MEMORY +{ + vle_seg1 (rxw): org = 0x00000000, len = 0x10000 + vle_seg2 (rxw): org = 0x00100000, len = 0x10000 + nonvle_seg (rxw): org = 0x001F0000, len = 0x20000 +} +SECTIONS +{ + .data 0x00000100 : + { + *(.data) + *(.ctors) + *(.dtors) + *(.eh_frame) + *(.jcr) + } + .text_vle 0x00001000 : + { + . = ALIGN(16); + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.text*) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.init*) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.fini*) + } > vle_seg1 + + .text_iv 0x100000 : + { + . = ALIGN(16); + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.text_iv) + INPUT_SECTION_FLAGS (SHF_PPC_VLE) *(.iv_handlers) + } >vle_seg2 + + .text 0x101000 : + { + . = ALIGN(16); + INPUT_SECTION_FLAGS (!SHF_PPC_VLE) *(.text*) + } +} diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-6a.s b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-6a.s new file mode 100644 index 0000000..a50afae --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-6a.s @@ -0,0 +1,47 @@ + .text + + e_stw r12, 0x4C(r1) + e_stw r11, 0x48(r1) + e_stw r10, 0x44(r1) + e_stw r9, 0x40(r1) + e_stw r8, 0x3C(r1) + e_stw r7, 0x38(r1) + e_stw r6, 0x34(r1) + e_stw r5, 0x30(r1) + e_stw r4, 0x2c(r1) + + .globl IV_table + .section ".iv_handlers", "ax" +IV_table: + e_b dummy + .align 4 + e_b dummy + .align 4 + e_b dummy + .align 4 + e_b dummy + .align 4 + e_b dummy + .align 4 + e_b dummy + .align 4 + e_b dummy + .align 4 + e_b dummy + .align 4 +dummy: + se_nop + e_b dummy + + .section ".text_iv", "ax" + e_lis r3, IV_table@h + mtivpr r3 + e_li r3, IV_table@l+0x00 + mtivor0 r3 + e_li r3, IV_table@l+0x10 + mtivor1 r3 + e_li r3, IV_table@l+0x20 + mtivor2 r3 + + .data + .long 0xdeadbeef diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-6b.s b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-6b.s new file mode 100644 index 0000000..10fcf20 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-6b.s @@ -0,0 +1,6 @@ + .text + + and. 3,4,5 + and 3,4,5 + andc 13,14,15 + andc. 16,17,18 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-6c.s b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-6c.s new file mode 100644 index 0000000..10fcf20 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-6c.s @@ -0,0 +1,6 @@ + .text + + and. 3,4,5 + and 3,4,5 + andc 13,14,15 + andc. 16,17,18 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-6d.s b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-6d.s new file mode 100644 index 0000000..a8c6fcc --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg-6d.s @@ -0,0 +1,9 @@ + .section ".text_iv", "ax" + e_lis r3, IV_table@h + mtivpr r3 + e_li r3, IV_table@l+0x00 + mtivor0 r3 + e_li r3, IV_table@l+0x10 + mtivor1 r3 + e_li r3, IV_table@l+0x20 + mtivor2 r3 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg.s b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg.s new file mode 100644 index 0000000..b0c0886 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle-multiseg.s @@ -0,0 +1,50 @@ +# Make up several VLE text sections which the linker script will put into +# separate output sections. We will then check for separate load segments. +# .include "mpc5500_usrdefs.inc" +# .section ".text_vle" + + e_stw r12, 0x4C(r1) + e_stw r11, 0x48(r1) + e_stw r10, 0x44(r1) + e_stw r9, 0x40(r1) + e_stw r8, 0x3C(r1) + e_stw r7, 0x38(r1) + e_stw r6, 0x34(r1) + e_stw r5, 0x30(r1) + e_stw r4, 0x2c(r1) + + .globl IV_table + .section ".iv_handlers", "ax" +IV_table: + e_b dummy + .align 4 + e_b dummy + .align 4 + e_b dummy + .align 4 + e_b dummy + .align 4 + e_b dummy + .align 4 + e_b dummy + .align 4 + e_b dummy + .align 4 + e_b dummy + .align 4 +dummy: + se_nop + e_b dummy + + .section ".text_iv", "ax" + e_lis r3, IV_table@h + mtivpr r3 + e_li r3, IV_table@l+0x00 + mtivor0 r3 + e_li r3, IV_table@l+0x10 + mtivor1 r3 + e_li r3, IV_table@l+0x20 + mtivor2 r3 + + .data + .long 0xdeadbeef diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-1.d b/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-1.d new file mode 100644 index 0000000..0f59271 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-1.d @@ -0,0 +1,29 @@ +.*: file format .* + + +Disassembly of section .text: + +01800054 <sub1>: + 1800054: 00 04 se_blr + +01800056 <sub2>: + 1800056: 00 04 se_blr + +01800058 <vle_reloc>: + 1800058: e8 fe se_b 1800054 <sub1> + 180005a: e9 fd se_bl 1800054 <sub1> + 180005c: e1 fd se_ble 1800056 <sub2> + 180005e: e6 fc se_beq 1800056 <sub2> + 1800060: 78 00 00 10 e_b 1800070 <sub3> + 1800064: 78 00 00 0f e_bl 1800072 <sub4> + 1800068: 7a 05 00 0c e_ble cr1,1800074 <sub5> + 180006c: 7a 1a 00 09 e_beql cr2,1800074 <sub5> + +01800070 <sub3>: + 1800070: 00 04 se_blr + +01800072 <sub4>: + 1800072: 00 04 se_blr + +01800074 <sub5>: + 1800074: 00 04 se_blr diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-1.s b/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-1.s new file mode 100644 index 0000000..e56a22b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-1.s @@ -0,0 +1,18 @@ + .section .text +sub1: + se_blr + +sub2: + se_blr + + .section .text +vle_reloc: + se_b sub1 + se_bl sub1 + se_bc 0,1,sub2 + se_bc 1,2,sub2 + + e_b sub3 + e_bl sub4 + e_bc 0,5,sub5 + e_bcl 1,10,sub5 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-2.d b/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-2.d new file mode 100644 index 0000000..1e1c9d4 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-2.d @@ -0,0 +1,87 @@ +.*: file format .* + +Disassembly of section .text: + +01800094 <sub1>: + 1800094: 00 04 se_blr +01800096 <sub2>: + 1800096: 00 04 se_blr +01800098 <vle_reloc_2>: + 1800098: 70 20 c1 c2 e_or2i r1,450 + 180009c: 70 40 c1 81 e_or2i r2,385 + 18000a0: 70 60 c1 81 e_or2i r3,385 + 18000a4: 70 80 c1 ce e_or2i r4,462 + 18000a8: 70 a0 c1 80 e_or2i r5,384 + 18000ac: 70 40 c1 81 e_or2i r2,385 + 18000b0: 70 20 c9 c2 e_and2i. r1,450 + 18000b4: 70 40 c9 81 e_and2i. r2,385 + 18000b8: 70 60 c9 81 e_and2i. r3,385 + 18000bc: 70 80 c9 ce e_and2i. r4,462 + 18000c0: 70 a0 c9 80 e_and2i. r5,384 + 18000c4: 70 40 c9 81 e_and2i. r2,385 + 18000c8: 70 20 d1 c2 e_or2is r1,450 + 18000cc: 70 40 d1 81 e_or2is r2,385 + 18000d0: 70 60 d1 81 e_or2is r3,385 + 18000d4: 70 80 d1 ce e_or2is r4,462 + 18000d8: 70 a0 d1 80 e_or2is r5,384 + 18000dc: 70 40 d1 81 e_or2is r2,385 + 18000e0: 70 20 e1 c2 e_lis r1,450 + 18000e4: 70 40 e1 81 e_lis r2,385 + 18000e8: 70 60 e1 81 e_lis r3,385 + 18000ec: 70 80 e1 ce e_lis r4,462 + 18000f0: 70 a0 e1 80 e_lis r5,384 + 18000f4: 70 40 e1 81 e_lis r2,385 + 18000f8: 70 20 e9 c2 e_and2is. r1,450 + 18000fc: 70 40 e9 81 e_and2is. r2,385 + 1800100: 70 60 e9 81 e_and2is. r3,385 + 1800104: 70 80 e9 ce e_and2is. r4,462 + 1800108: 70 a0 e9 80 e_and2is. r5,384 + 180010c: 70 40 e9 81 e_and2is. r2,385 + 1800110: 70 01 99 c2 e_cmp16i r1,450 + 1800114: 70 02 99 81 e_cmp16i r2,385 + 1800118: 70 03 99 81 e_cmp16i r3,385 + 180011c: 70 04 99 ce e_cmp16i r4,462 + 1800120: 70 05 99 80 e_cmp16i r5,384 + 1800124: 70 02 99 81 e_cmp16i r2,385 + 1800128: 70 01 a9 c2 e_cmpl16i r1,450 + 180012c: 70 02 a9 81 e_cmpl16i r2,385 + 1800130: 70 03 a9 81 e_cmpl16i r3,385 + 1800134: 70 04 a9 ce e_cmpl16i r4,462 + 1800138: 70 05 a9 80 e_cmpl16i r5,384 + 180013c: 70 02 a9 81 e_cmpl16i r2,385 + 1800140: 70 01 b1 c2 e_cmph16i r1,450 + 1800144: 70 02 b1 81 e_cmph16i r2,385 + 1800148: 70 03 b1 81 e_cmph16i r3,385 + 180014c: 70 04 b1 ce e_cmph16i r4,462 + 1800150: 70 05 b1 80 e_cmph16i r5,384 + 1800154: 70 02 b1 81 e_cmph16i r2,385 + 1800158: 70 01 b9 c2 e_cmphl16i r1,450 + 180015c: 70 02 b9 81 e_cmphl16i r2,385 + 1800160: 70 03 b9 81 e_cmphl16i r3,385 + 1800164: 70 04 b9 ce e_cmphl16i r4,462 + 1800168: 70 05 b9 80 e_cmphl16i r5,384 + 180016c: 70 02 b9 81 e_cmphl16i r2,385 + 1800170: 70 01 89 c2 e_add2i. r1,450 + 1800174: 70 02 89 81 e_add2i. r2,385 + 1800178: 70 03 89 81 e_add2i. r3,385 + 180017c: 70 04 89 ce e_add2i. r4,462 + 1800180: 70 05 89 80 e_add2i. r5,384 + 1800184: 70 02 89 81 e_add2i. r2,385 + 1800188: 70 01 91 c2 e_add2is r1,450 + 180018c: 70 02 91 81 e_add2is r2,385 + 1800190: 70 03 91 81 e_add2is r3,385 + 1800194: 70 04 91 ce e_add2is r4,462 + 1800198: 70 05 91 80 e_add2is r5,384 + 180019c: 70 02 91 81 e_add2is r2,385 + 18001a0: 70 01 a1 c2 e_mull2i r1,450 + 18001a4: 70 02 a1 81 e_mull2i r2,385 + 18001a8: 70 03 a1 81 e_mull2i r3,385 + 18001ac: 70 04 a1 ce e_mull2i r4,462 + 18001b0: 70 05 a1 80 e_mull2i r5,384 + 18001b4: 70 02 a1 81 e_mull2i r2,385 +018001b8 <sub3>: + 18001b8: 00 04 se_blr +018001ba <sub4>: + 18001ba: 00 04 se_blr +018001bc <sub5>: + 18001bc: 00 04 se_blr diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-2.s b/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-2.s new file mode 100644 index 0000000..34cc32d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-2.s @@ -0,0 +1,92 @@ + .section .text +sub1: + se_blr + +sub2: + se_blr + + .section .text +vle_reloc_2: + e_or2i 1, low@l + e_or2i 2, high@h + e_or2i 3, high_adjust@ha + e_or2i 4, low_sdarel@sdarel@l + e_or2i 5, high_sdarel@sdarel@h + e_or2i 2, high_adjust_sdarel@sdarel@ha + + e_and2i. 1, low@l + e_and2i. 2, high@h + e_and2i. 3, high_adjust@ha + e_and2i. 4, low_sdarel@sdarel@l + e_and2i. 5, high_sdarel@sdarel@h + e_and2i. 2, high_adjust_sdarel@sdarel@ha + + e_or2is 1, low@l + e_or2is 2, high@h + e_or2is 3, high_adjust@ha + e_or2is 4, low_sdarel@sdarel@l + e_or2is 5, high_sdarel@sdarel@h + e_or2is 2, high_adjust_sdarel@sdarel@ha + + e_lis 1, low@l + e_lis 2, high@h + e_lis 3, high_adjust@ha + e_lis 4, low_sdarel@sdarel@l + e_lis 5, high_sdarel@sdarel@h + e_lis 2, high_adjust_sdarel@sdarel@ha + + e_and2is. 1, low@l + e_and2is. 2, high@h + e_and2is. 3, high_adjust@ha + e_and2is. 4, low_sdarel@sdarel@l + e_and2is. 5, high_sdarel@sdarel@h + e_and2is. 2, high_adjust_sdarel@sdarel@ha + + e_cmp16i 1, low@l + e_cmp16i 2, high@h + e_cmp16i 3, high_adjust@ha + e_cmp16i 4, low_sdarel@sdarel@l + e_cmp16i 5, high_sdarel@sdarel@h + e_cmp16i 2, high_adjust_sdarel@sdarel@ha + + e_cmpl16i 1, low@l + e_cmpl16i 2, high@h + e_cmpl16i 3, high_adjust@ha + e_cmpl16i 4, low_sdarel@sdarel@l + e_cmpl16i 5, high_sdarel@sdarel@h + e_cmpl16i 2, high_adjust_sdarel@sdarel@ha + + e_cmph16i 1, low@l + e_cmph16i 2, high@h + e_cmph16i 3, high_adjust@ha + e_cmph16i 4, low_sdarel@sdarel@l + e_cmph16i 5, high_sdarel@sdarel@h + e_cmph16i 2, high_adjust_sdarel@sdarel@ha + + e_cmphl16i 1, low@l + e_cmphl16i 2, high@h + e_cmphl16i 3, high_adjust@ha + e_cmphl16i 4, low_sdarel@sdarel@l + e_cmphl16i 5, high_sdarel@sdarel@h + e_cmphl16i 2, high_adjust_sdarel@sdarel@ha + + e_add2i. 1, low@l + e_add2i. 2, high@h + e_add2i. 3, high_adjust@ha + e_add2i. 4, low_sdarel@sdarel@l + e_add2i. 5, high_sdarel@sdarel@h + e_add2i. 2, high_adjust_sdarel@sdarel@ha + + e_add2is 1, low@l + e_add2is 2, high@h + e_add2is 3, high_adjust@ha + e_add2is 4, low_sdarel@sdarel@l + e_add2is 5, high_sdarel@sdarel@h + e_add2is 2, high_adjust_sdarel@sdarel@ha + + e_mull2i 1, low@l + e_mull2i 2, high@h + e_mull2i 3, high_adjust@ha + e_mull2i 4, low_sdarel@sdarel@l + e_mull2i 5, high_sdarel@sdarel@h + e_mull2i 2, high_adjust_sdarel@sdarel@ha diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-3.d b/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-3.d new file mode 100644 index 0000000..e29f4f0 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-3.d @@ -0,0 +1,8 @@ +.*: file format .* + +Disassembly of section .text: + +01800094 <sda21_test>: + 1800094: 1c ad 80 08 e_add16i r5,r13,-32760 + 1800098: 1c a2 80 04 e_add16i r5,r2,-32764 + 180009c: 70 00 00 ac e_li r0,172 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-3.s b/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-3.s new file mode 100644 index 0000000..3c7dfae --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-3.s @@ -0,0 +1,10 @@ + .section .text + .extern exdat1c + .extern exdat2b + .extern exdat1a + .globl sda21_test + +sda21_test: + e_add16i 5, 4, exdat1c@sda21 + e_add16i 5, 4, exdat2b@sda21 + e_add16i 5, 4, exdat0b@sda21 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-def-1.s b/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-def-1.s new file mode 100644 index 0000000..a879221 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-def-1.s @@ -0,0 +1,13 @@ + .section .text + .globl sub3 +sub3: + se_blr + + .globl sub4 +sub4: + se_blr + + .globl sub5 +sub5: + se_blr + diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-def-2.s b/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-def-2.s new file mode 100644 index 0000000..363a39f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-def-2.s @@ -0,0 +1,41 @@ + .section .text + + .globl sub3 +sub3: + se_blr + + .globl sub4 +sub4: + se_blr + + .globl sub5 +sub5: + se_blr + + .section .sdata + .globl low_sdarel +low_sdarel: + .long 2 + + .globl high_adjust_sdarel +high_adjust_sdarel: + .long 0xff + + .section .sdata2 + .globl high_sdarel +high_sdarel: + .long 0xf + + + .data + .globl low +low: + .long 5 + + .globl high +high: + .long 0x10 + + .globl high_adjust +high_adjust: + .long 0xffff diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-def-3.s b/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-def-3.s new file mode 100644 index 0000000..e3b843b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle-reloc-def-3.s @@ -0,0 +1,29 @@ + .section .sdata + .globl exdat1a + .globl exdat1b + .globl exdat1c +exdat1a: .long 6 +exdat1b: .long 7 +exdat1c: .long 8 + + .section .sdata2 + .globl exdat2a + .globl exdat2b + .globl exdat2c +exdat2a: .long 5 +exdat2b: .long 4 +exdat2c: .long 3 + + .section .PPC.EMB.sdata0 + .globl exdat0a + .globl exdat0b + .globl exdat0c +exdat0a: .long 1 +exdat0b: .long 2 +exdat0c: .long 3 + + .section .sbss + .globl exbss1a + .globl exbss1b +exbss1a: .int +exbss1b: .int diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vle.ld b/binutils-2.24/ld/testsuite/ld-powerpc/vle.ld new file mode 100644 index 0000000..01b6598 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vle.ld @@ -0,0 +1,11 @@ +SECTIONS +{ + . = 0x01800000 + SIZEOF_HEADERS; + .text : { *(.text) } + .PPC.EMB.sdata0 : { *(.PPC.EMB.sdata0) } + .sdata2 : { PROVIDE (_SDA2_BASE_ = 32768); *(.sdata2) } + . = ALIGN (0x10000) + (. & (0x10000 - 1)); + .data : { *(.data) } + .sdata : { PROVIDE (_SDA_BASE_ = 32768); *(.sdata) } + /DISCARD/ : { *(*) } +} diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vxworks-relax-2.rd b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks-relax-2.rd new file mode 100644 index 0000000..4d36109 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks-relax-2.rd @@ -0,0 +1,11 @@ + +Relocation section '.rela.text' at offset 0x[0-9a-f]+ contains 8 entries: + Offset +Info +Type +Sym.Value +Sym. Name \+ Addend +0+16 +[0-9a-f]+ R_PPC_ADDR16_HA +0+ +.text \+ 4000034 +0+1a +[0-9a-f]+ R_PPC_ADDR16_LO +0+ +.text \+ 4000034 +0+6 +[0-9a-f]+ R_PPC_ADDR16_HA +0+ +.text \+ 4000034 +0+a +[0-9a-f]+ R_PPC_ADDR16_LO +0+ +.text \+ 4000034 +0+26 +[0-9a-f]+ R_PPC_ADDR16_HA +0+ +undefined \+ 0 +0+2a +[0-9a-f]+ R_PPC_ADDR16_LO +0+ +undefined \+ 0 +0+400003e +[0-9a-f]+ R_PPC_ADDR16_HA +0+ +_start \+ 0 +0+4000042 +[0-9a-f]+ R_PPC_ADDR16_LO +0+ +_start \+ 0 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vxworks-relax-2.s b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks-relax-2.s new file mode 100644 index 0000000..bfb87aa --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks-relax-2.s @@ -0,0 +1,15 @@ + .globl _start +_start: + bl elsewhere + lis 9,elsewhere@ha + la 0,elsewhere@l(9) + bl undefined + b . + + .section .far,"ax",@progbits +elsewhere: + bl _start + b . + + .section .pad + .space 0x4000000 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vxworks-relax.rd b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks-relax.rd new file mode 100644 index 0000000..572c74d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks-relax.rd @@ -0,0 +1,9 @@ + +Relocation section '.rela.text' at offset .* contains 6 entries: + Offset Info Type Sym.Value Sym. Name \+ Addend +00080012 .* R_PPC_ADDR16_HA 00080000 .text \+ 4000020 +00080016 .* R_PPC_ADDR16_LO 00080000 .text \+ 4000020 +00080006 .* R_PPC_ADDR16_HA 00080000 .text \+ 4000020 +0008000a .* R_PPC_ADDR16_LO 00080000 .text \+ 4000020 +0408002a .* R_PPC_ADDR16_HA 00080000 _start \+ 0 +0408002e .* R_PPC_ADDR16_LO 00080000 _start \+ 0 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vxworks-relax.s b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks-relax.s new file mode 100644 index 0000000..60ec418 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks-relax.s @@ -0,0 +1,14 @@ + .globl _start +_start: + bl elsewhere + lis 9,elsewhere@ha + la 0,elsewhere@l(9) + b . + + .section .far,"ax",@progbits +elsewhere: + bl _start + b . + + .section .pad + .space 0x4000000 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1-lib.dd b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1-lib.dd new file mode 100644 index 0000000..1c1861e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1-lib.dd @@ -0,0 +1,56 @@ + +.*: file format .* + +Disassembly of section \.plt: + +00080800 <_PROCEDURE_LINKAGE_TABLE_>: + 80800: 81 9e 00 08 lwz r12,8\(r30\) + 80804: 7d 89 03 a6 mtctr r12 + 80808: 81 9e 00 04 lwz r12,4\(r30\) + 8080c: 4e 80 04 20 bctr + 80810: 60 00 00 00 nop + 80814: 60 00 00 00 nop + 80818: 60 00 00 00 nop + 8081c: 60 00 00 00 nop + 80820: 3d 9e 00 00 addis r12,r30,0 + 80824: 81 8c 00 0c lwz r12,12\(r12\) + 80828: 7d 89 03 a6 mtctr r12 + 8082c: 4e 80 04 20 bctr + 80830: 39 60 00 00 li r11,0 + 80834: 4b ff ff cc b 80800 <_PROCEDURE_LINKAGE_TABLE_> + 80838: 60 00 00 00 nop + 8083c: 60 00 00 00 nop + 80840: 3d 9e 00 00 addis r12,r30,0 + 80844: 81 8c 00 10 lwz r12,16\(r12\) + 80848: 7d 89 03 a6 mtctr r12 + 8084c: 4e 80 04 20 bctr + 80850: 39 60 00 01 li r11,1 + 80854: 4b ff ff ac b 80800 <_PROCEDURE_LINKAGE_TABLE_> + 80858: 60 00 00 00 nop + 8085c: 60 00 00 00 nop +Disassembly of section \.text: + +00080c00 <foo>: + 80c00: 94 21 ff e8 stwu r1,-24\(r1\) + 80c04: 7c 08 02 a6 mflr r0 + 80c08: 90 01 00 1c stw r0,28\(r1\) + 80c0c: 3f c0 00 00 lis r30,0 + 80c10: 83 de 00 00 lwz r30,0\(r30\) + 80c14: 83 de 00 00 lwz r30,0\(r30\) + 80c18: 80 3e 00 14 lwz r1,20\(r30\) + 80c1c: 80 01 00 00 lwz r0,0\(r1\) + 80c20: 38 00 00 01 li r0,1 + 80c24: 90 01 00 00 stw r0,0\(r1\) + 80c28: 48 00 00 1d bl 80c44 <slocal> + 80c2c: 4b ff fc 15 bl 80840 <_PROCEDURE_LINKAGE_TABLE_\+0x40> + 80c30: 4b ff fb f1 bl 80820 <_PROCEDURE_LINKAGE_TABLE_\+0x20> + 80c34: 80 01 00 1c lwz r0,28\(r1\) + 80c38: 7c 08 03 a6 mtlr r0 + 80c3c: 38 21 00 18 addi r1,r1,24 + 80c40: 4e 80 00 20 blr + +00080c44 <slocal>: + 80c44: 4e 80 00 20 blr + +00080c48 <sglobal>: + 80c48: 4e 80 00 20 blr diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1-lib.nd b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1-lib.nd new file mode 100644 index 0000000..7531ec7 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1-lib.nd @@ -0,0 +1,9 @@ +#... +Symbol table '\.dynsym' .*: +#... +.*: 00090400 +0 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _GLOBAL_OFFSET_TABLE_ +#... +Symbol table '\.symtab' .*: +#... +.*: 00090400 +0 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _GLOBAL_OFFSET_TABLE_ +#pass diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1-lib.rd b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1-lib.rd new file mode 100644 index 0000000..21f7bc8 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1-lib.rd @@ -0,0 +1,13 @@ + +Relocation section '\.rela\.plt' at offset .* contains 2 entries: + Offset Info Type Sym\.Value Sym\. Name \+ Addend +0009040c .*15 R_PPC_JMP_SLOT 00000000 sexternal \+ 0 +00090410 .*15 R_PPC_JMP_SLOT 00080c48 sglobal \+ 0 + +Relocation section '\.rela\.dyn' at offset .* contains 5 entries: + Offset Info Type Sym\.Value Sym\. Name \+ Addend +00090800 00000016 R_PPC_RELATIVE * 80c44 +00080c0e .*06 R_PPC_ADDR16_HA 00000000 __GOTT_BASE__ \+ 0 +00080c12 .*04 R_PPC_ADDR16_LO 00000000 __GOTT_BASE__ \+ 0 +00080c16 .*03 R_PPC_ADDR16 00000000 __GOTT_INDEX__ \+ 0 +00090414 .*14 R_PPC_GLOB_DAT 00090c00 x \+ 0 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1-lib.s b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1-lib.s new file mode 100644 index 0000000..9dfcb0f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1-lib.s @@ -0,0 +1,38 @@ + .text + .globl foo + .type foo, @function +foo: + stwu r1,-24(r1) + mflr r0 + stw r0,28(r1) + lis r30,__GOTT_BASE__@ha + lwz r30,__GOTT_BASE__@l(r30) + lwz r30,__GOTT_INDEX__(r30) + lwz r1,x@got(r30) + lwz r0,0(r1) + addi r0,r0,1 + stw r0,0(r1) + bl slocal + bl sglobal@plt + bl sexternal@plt + lwz r0,28(r1) + mtlr r0 + addi r1,r1,24 + blr + .size foo, .-foo + + .type slocal, @function +slocal: + blr + .size slocal, .-slocal + + .globl sglobal + .type sglobal, @function +sglobal: + blr + .size sglobal, .-sglobal + + .data + .4byte slocal + + .comm x,4,4 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1-lib.sd b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1-lib.sd new file mode 100644 index 0000000..1d2ed5c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1-lib.sd @@ -0,0 +1,12 @@ +#... +Program Headers: + Type .* Flg Align + LOAD .* R E 0x10000 + LOAD .* RW 0x10000 + DYNAMIC .* RW 0x4 + + Section to Segment mapping: + Segment Sections\.\.\. + 00 .* \.plt .* + 01 .* \.got .* + 02 .* \.dynamic $ diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1-lib.td b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1-lib.td new file mode 100644 index 0000000..9f223e3 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1-lib.td @@ -0,0 +1,3 @@ +#... + 0x0+16 \(TEXTREL\) +0x0 +#pass diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1-static.d b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1-static.d new file mode 100644 index 0000000..4c2d1fd --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1-static.d @@ -0,0 +1,4 @@ +#name: VxWorks executable test 1 (static) +#source: vxworks1.s -mregnames +#ld: tmpdir/libvxworks1.so -Tvxworks1.ld +#error: Dynamic sections created in non-dynamic link diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1.dd b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1.dd new file mode 100644 index 0000000..09e5a6a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1.dd @@ -0,0 +1,48 @@ + +.*: file format .* + +Disassembly of section \.plt: + +00080800 <_PROCEDURE_LINKAGE_TABLE_>: + 80800: 3d 80 00 09 lis r12,9 + 80802: R_PPC_ADDR16_HA _GLOBAL_OFFSET_TABLE_ + 80804: 39 8c 04 00 addi r12,r12,1024 + 80806: R_PPC_ADDR16_LO _GLOBAL_OFFSET_TABLE_ + 80808: 80 0c 00 08 lwz r0,8\(r12\) + 8080c: 7c 09 03 a6 mtctr r0 + 80810: 81 8c 00 04 lwz r12,4\(r12\) + 80814: 4e 80 04 20 bctr + 80818: 60 00 00 00 nop + 8081c: 60 00 00 00 nop + 80820: 3d 80 00 09 lis r12,9 + 80822: R_PPC_ADDR16_HA _GLOBAL_OFFSET_TABLE_\+0xc + 80824: 81 8c 04 0c lwz r12,1036\(r12\) + 80826: R_PPC_ADDR16_LO _GLOBAL_OFFSET_TABLE_\+0xc + 80828: 7d 89 03 a6 mtctr r12 + 8082c: 4e 80 04 20 bctr + 80830: 39 60 00 00 li r11,0 + 80834: 4b ff ff cc b 80800 <_PROCEDURE_LINKAGE_TABLE_> + 80838: 60 00 00 00 nop + 8083c: 60 00 00 00 nop + 80840: 3d 80 00 09 lis r12,9 + 80842: R_PPC_ADDR16_HA _GLOBAL_OFFSET_TABLE_\+0x10 + 80844: 81 8c 04 10 lwz r12,1040\(r12\) + 80846: R_PPC_ADDR16_LO _GLOBAL_OFFSET_TABLE_\+0x10 + 80848: 7d 89 03 a6 mtctr r12 + 8084c: 4e 80 04 20 bctr + 80850: 39 60 00 01 li r11,1 + 80854: 4b ff ff ac b 80800 <_PROCEDURE_LINKAGE_TABLE_> + 80858: 60 00 00 00 nop + 8085c: 60 00 00 00 nop +Disassembly of section \.text: + +00080c00 <_start>: + 80c00: 4b ff fc 41 bl 80840 <_PROCEDURE_LINKAGE_TABLE_\+0x40> + 80c00: R_PPC_PLTREL24 \.plt\+0x40 + 80c04: 48 00 00 09 bl 80c0c <sexternal> + 80c04: R_PPC_PLTREL24 sexternal + 80c08: 4b ff fc 19 bl 80820 <_PROCEDURE_LINKAGE_TABLE_\+0x20> + 80c08: R_PPC_PLTREL24 \.plt\+0x20 + +00080c0c <sexternal>: + 80c0c: 4e 80 00 20 blr diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1.ld b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1.ld new file mode 100644 index 0000000..3106d55 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1.ld @@ -0,0 +1,30 @@ +SECTIONS +{ + . = 0x80000; + .interp : { *(.interp) } + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + + . = ALIGN (0x400); + .rela.dyn : { *(.rela.dyn) } + .rela.plt : { *(.rela.plt) } + + . = ALIGN (0x400); + .plt : { *(.plt) } + + . = ALIGN (0x400); + .text : { *(.text) *(.pad) *(.far) } + + . = ALIGN (0x10000); + .dynamic : { *(.dynamic) } + + . = ALIGN (0x400); + .got : { *(.got.plt) *(.got) } + + . = ALIGN (0x400); + .data : { *(.data) } + + . = ALIGN (0x400); + .bss : { *(.bss) } +} diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1.rd b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1.rd new file mode 100644 index 0000000..b8591a8 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1.rd @@ -0,0 +1,22 @@ + +Relocation section '\.rela\.plt' at offset .* contains 2 entries: + Offset Info Type Sym\.Value Sym\. Name \+ Addend +0009040c .*15 R_PPC_JMP_SLOT 00000000 sglobal \+ 0 +00090410 .*15 R_PPC_JMP_SLOT 00000000 foo \+ 0 + +Relocation section '\.rela\.text' at offset .* contains 3 entries: + Offset Info Type Sym\.Value Sym\. Name \+ Addend +00080c00 .*12 R_PPC_PLTREL24 00080800 \.plt \+ 40 +00080c04 .*12 R_PPC_PLTREL24 00080c0c sexternal \+ 0 +00080c08 .*12 R_PPC_PLTREL24 00080800 \.plt \+ 20 + +Relocation section '\.rela\.plt\.unloaded' at offset .* contains 8 entries: + Offset Info Type Sym\.Value Sym\. Name \+ Addend +00080802 .*06 R_PPC_ADDR16_HA 00090400 _GLOBAL_OFFSET_TABLE_ \+ 0 +00080806 .*04 R_PPC_ADDR16_LO 00090400 _GLOBAL_OFFSET_TABLE_ \+ 0 +00080822 .*06 R_PPC_ADDR16_HA 00090400 _GLOBAL_OFFSET_TABLE_ \+ c +00080826 .*04 R_PPC_ADDR16_LO 00090400 _GLOBAL_OFFSET_TABLE_ \+ c +0009040c .*01 R_PPC_ADDR32 00080800 _PROCEDURE_LINKAGE_TAB.* \+ 30 +00080842 .*06 R_PPC_ADDR16_HA 00090400 _GLOBAL_OFFSET_TABLE_ \+ 10 +00080846 .*04 R_PPC_ADDR16_LO 00090400 _GLOBAL_OFFSET_TABLE_ \+ 10 +00090410 .*01 R_PPC_ADDR32 00080800 _PROCEDURE_LINKAGE_TAB.* \+ 50 diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1.s b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1.s new file mode 100644 index 0000000..cd54d57 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks1.s @@ -0,0 +1,14 @@ + .text + .globl _start + .type _start,@function +_start: + bl foo@plt + bl sexternal@plt + bl sglobal@plt + .size _start, .-_start + + .globl sexternal + .type sexternal,@function +sexternal: + blr + .size sexternal, .-sexternal diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vxworks2-static.sd b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks2-static.sd new file mode 100644 index 0000000..55fc529 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks2-static.sd @@ -0,0 +1,9 @@ +#... +Elf file type is EXEC \(Executable file\) +Entry point 0x80000 +#... +Program Headers: + Type .* + LOAD .* 0x00080000 0x00080000 .* R E 0x10000 + +#... diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vxworks2.s b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks2.s new file mode 100644 index 0000000..5e8d73a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks2.s @@ -0,0 +1,5 @@ + .globl _start + .type _start,@function +_start: + blr + .end _start diff --git a/binutils-2.24/ld/testsuite/ld-powerpc/vxworks2.sd b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks2.sd new file mode 100644 index 0000000..0876568 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-powerpc/vxworks2.sd @@ -0,0 +1,13 @@ +#... +Elf file type is EXEC \(Executable file\) +Entry point 0x80400 +#... +Program Headers: + Type .* + PHDR .* +#... + LOAD .* 0x00080000 0x00080000 .* R E 0x10000 + LOAD .* 0x00090000 0x00090000 .* RW 0x10000 + DYNAMIC .* + +#... |