diff options
Diffstat (limited to 'binutils-2.21/ld/testsuite/ld-powerpc')
224 files changed, 4931 insertions, 0 deletions
diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/aix-abs-branch-1.dd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-abs-branch-1.dd new file mode 100644 index 0000000..6bfd136 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-abs-branch-1.ex b/binutils-2.21/ld/testsuite/ld-powerpc/aix-abs-branch-1.ex new file mode 100644 index 0000000..257cc56 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/aix-abs-branch-1.ex @@ -0,0 +1 @@ +foo diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/aix-abs-branch-1.im b/binutils-2.21/ld/testsuite/ld-powerpc/aix-abs-branch-1.im new file mode 100644 index 0000000..0efbfc9 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/aix-abs-branch-1.im @@ -0,0 +1 @@ +bar 0x1450000 diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/aix-abs-branch-1.nd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-abs-branch-1.nd new file mode 100644 index 0000000..6c5022a --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-abs-branch-1.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-abs-branch-1.s new file mode 100644 index 0000000..82c322f --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-abs-reloc-1.ex b/binutils-2.21/ld/testsuite/ld-powerpc/aix-abs-reloc-1.ex new file mode 100644 index 0000000..257cc56 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/aix-abs-reloc-1.ex @@ -0,0 +1 @@ +foo diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/aix-abs-reloc-1.im b/binutils-2.21/ld/testsuite/ld-powerpc/aix-abs-reloc-1.im new file mode 100644 index 0000000..66f78a4 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/aix-abs-reloc-1.im @@ -0,0 +1 @@ +bar 0xdeadbeef diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/aix-abs-reloc-1.nd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-abs-reloc-1.nd new file mode 100644 index 0000000..003c796 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-abs-reloc-1.od b/binutils-2.21/ld/testsuite/ld-powerpc/aix-abs-reloc-1.od new file mode 100644 index 0000000..db65b4b --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-abs-reloc-1.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-abs-reloc-1.s new file mode 100644 index 0000000..5eb3980 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-core-sec-1.ex b/binutils-2.21/ld/testsuite/ld-powerpc/aix-core-sec-1.ex new file mode 100644 index 0000000..257cc56 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/aix-core-sec-1.ex @@ -0,0 +1 @@ +foo diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/aix-core-sec-1.hd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-core-sec-1.hd new file mode 100644 index 0000000..19d09e4 --- /dev/null +++ b/binutils-2.21/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, ALLOC, LOAD diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/aix-core-sec-1.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-core-sec-1.s new file mode 100644 index 0000000..edb4669 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-core-sec-2.ex b/binutils-2.21/ld/testsuite/ld-powerpc/aix-core-sec-2.ex new file mode 100644 index 0000000..257cc56 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/aix-core-sec-2.ex @@ -0,0 +1 @@ +foo diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/aix-core-sec-2.hd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-core-sec-2.hd new file mode 100644 index 0000000..39facd8 --- /dev/null +++ b/binutils-2.21/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, ALLOC, LOAD diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/aix-core-sec-2.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-core-sec-2.s new file mode 100644 index 0000000..357796e --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-core-sec-3.ex b/binutils-2.21/ld/testsuite/ld-powerpc/aix-core-sec-3.ex new file mode 100644 index 0000000..257cc56 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/aix-core-sec-3.ex @@ -0,0 +1 @@ +foo diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/aix-core-sec-3.hd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-core-sec-3.hd new file mode 100644 index 0000000..f7acc39 --- /dev/null +++ b/binutils-2.21/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, ALLOC, LOAD diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/aix-core-sec-3.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-core-sec-3.s new file mode 100644 index 0000000..df5293f --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/aix-core-sec-3.s @@ -0,0 +1 @@ + .comm foo,8 diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/aix-export-1-all.dd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-export-1-all.dd new file mode 100644 index 0000000..90eec95 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-export-1-full.dd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-export-1-full.dd new file mode 100644 index 0000000..d300fa2 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-export-1a.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-export-1a.s new file mode 100644 index 0000000..69701e5 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-export-1b.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-export-1b.s new file mode 100644 index 0000000..32c355d --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-export-2.nd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-export-2.nd new file mode 100644 index 0000000..6f97433 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/aix-export-2.nd @@ -0,0 +1 @@ +0*10000000 B x diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/aix-export-2.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-export-2.s new file mode 100644 index 0000000..f720635 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/aix-export-2.s @@ -0,0 +1 @@ + .comm x,4 diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/aix-gc-1-32.dd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-gc-1-32.dd new file mode 100644 index 0000000..324b298 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-gc-1-64.dd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-gc-1-64.dd new file mode 100644 index 0000000..00e9a88 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-gc-1.ex b/binutils-2.21/ld/testsuite/ld-powerpc/aix-gc-1.ex new file mode 100644 index 0000000..c7a82ec --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/aix-gc-1.ex @@ -0,0 +1 @@ +exported_global diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/aix-gc-1.nd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-gc-1.nd new file mode 100644 index 0000000..f399646 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/aix-gc-1.nd @@ -0,0 +1,3 @@ +#... +0*20000008 d __rtinit +#pass diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/aix-gc-1.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-gc-1.s new file mode 100644 index 0000000..821fd5c --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-glink-1-32.d b/binutils-2.21/ld/testsuite/ld-powerpc/aix-glink-1-32.d new file mode 100644 index 0000000..129845f --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-glink-1-32.dd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-glink-1-32.dd new file mode 100644 index 0000000..33cf812 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-glink-1-64.d b/binutils-2.21/ld/testsuite/ld-powerpc/aix-glink-1-64.d new file mode 100644 index 0000000..b8ee35f --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-glink-1-64.dd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-glink-1-64.dd new file mode 100644 index 0000000..b5a557c --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-glink-1.ex b/binutils-2.21/ld/testsuite/ld-powerpc/aix-glink-1.ex new file mode 100644 index 0000000..643cdf3 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/aix-glink-1.ex @@ -0,0 +1,2 @@ +f2 +foo diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/aix-glink-1.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-glink-1.s new file mode 100644 index 0000000..f7901b2 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-glink-2-32.dd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-glink-2-32.dd new file mode 100644 index 0000000..2c91d23 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-glink-2-64.dd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-glink-2-64.dd new file mode 100644 index 0000000..5a34f0a --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-glink-2a.ex b/binutils-2.21/ld/testsuite/ld-powerpc/aix-glink-2a.ex new file mode 100644 index 0000000..406cabb --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-glink-2a.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-glink-2a.s new file mode 100644 index 0000000..fafbe43 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-glink-2b.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-glink-2b.s new file mode 100644 index 0000000..9c06d48 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-glink-2c.ex b/binutils-2.21/ld/testsuite/ld-powerpc/aix-glink-2c.ex new file mode 100644 index 0000000..4e16c9b --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/aix-glink-2c.ex @@ -0,0 +1,6 @@ +a1 +a2 +a3 +c1 +c2 +c3 diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/aix-glink-2c.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-glink-2c.s new file mode 100644 index 0000000..7dd6dad --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-glink-2d.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-glink-2d.s new file mode 100644 index 0000000..ba78609 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-glink-3-32.d b/binutils-2.21/ld/testsuite/ld-powerpc/aix-glink-3-32.d new file mode 100644 index 0000000..754789f --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-glink-3-64.d b/binutils-2.21/ld/testsuite/ld-powerpc/aix-glink-3-64.d new file mode 100644 index 0000000..3ea6817 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-glink-3.dd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-glink-3.dd new file mode 100644 index 0000000..b154936 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-glink-3.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-glink-3.s new file mode 100644 index 0000000..355dcc6 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-glink-3a.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-glink-3a.s new file mode 100644 index 0000000..76aad8c --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-glink-3b.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-glink-3b.s new file mode 100644 index 0000000..0bedb3b --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-lineno-1.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-lineno-1.s new file mode 100644 index 0000000..196e012 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-lineno-1.txt b/binutils-2.21/ld/testsuite/ld-powerpc/aix-lineno-1.txt new file mode 100644 index 0000000..0e8dc16 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-lineno-1a.dd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-lineno-1a.dd new file mode 100644 index 0000000..72410c9 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-lineno-1a.nd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-lineno-1a.nd new file mode 100644 index 0000000..5e84188 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-lineno-1b.dd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-lineno-1b.dd new file mode 100644 index 0000000..64c08df --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-lineno-1b.nd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-lineno-1b.nd new file mode 100644 index 0000000..d341470 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-dso.dnd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-dso.dnd new file mode 100644 index 0000000..1fccdeb --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-dso.drd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-dso.drd new file mode 100644 index 0000000..f262feb --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-dso.nd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-dso.nd new file mode 100644 index 0000000..be25ff3 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-dso.rd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-dso.rd new file mode 100644 index 0000000..d17151b --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-rel.nd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-rel.nd new file mode 100644 index 0000000..e2bdbc4 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-rel.rd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-no-dup-syms-1-rel.rd new file mode 100644 index 0000000..436ad98 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-no-dup-syms-1.ex b/binutils-2.21/ld/testsuite/ld-powerpc/aix-no-dup-syms-1.ex new file mode 100644 index 0000000..8f1fe4d --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/aix-no-dup-syms-1.ex @@ -0,0 +1,3 @@ +x +x1 +x2 diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/aix-no-dup-syms-1.im b/binutils-2.21/ld/testsuite/ld-powerpc/aix-no-dup-syms-1.im new file mode 100644 index 0000000..257cc56 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/aix-no-dup-syms-1.im @@ -0,0 +1 @@ +foo diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/aix-no-dup-syms-1a.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-no-dup-syms-1a.s new file mode 100644 index 0000000..3138670 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-no-dup-syms-1b.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-no-dup-syms-1b.s new file mode 100644 index 0000000..c5fcf38 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-ref-1-32.od b/binutils-2.21/ld/testsuite/ld-powerpc/aix-ref-1-32.od new file mode 100644 index 0000000..1ba90ec --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-ref-1-64.od b/binutils-2.21/ld/testsuite/ld-powerpc/aix-ref-1-64.od new file mode 100644 index 0000000..9cc6e9d --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-ref-1.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-ref-1.s new file mode 100644 index 0000000..33445a6 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-rel-1.od b/binutils-2.21/ld/testsuite/ld-powerpc/aix-rel-1.od new file mode 100644 index 0000000..0d9f2bb --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-rel-1.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-rel-1.s new file mode 100644 index 0000000..9891ba8 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-toc-1-32.dd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-toc-1-32.dd new file mode 100644 index 0000000..e129d34 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-toc-1-64.dd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-toc-1-64.dd new file mode 100644 index 0000000..c169ff6 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-toc-1.ex b/binutils-2.21/ld/testsuite/ld-powerpc/aix-toc-1.ex new file mode 100644 index 0000000..13a2943 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/aix-toc-1.ex @@ -0,0 +1,2 @@ +f1 +f2 diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/aix-toc-1a.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-toc-1a.s new file mode 100644 index 0000000..e67d5d3 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-toc-1b.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-toc-1b.s new file mode 100644 index 0000000..d4cee8a --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-weak-1-dso.dnd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-1-dso.dnd new file mode 100644 index 0000000..3105fa3 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-weak-1-dso.hd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-1-dso.hd new file mode 100644 index 0000000..7368a5a --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-weak-1-dso.nd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-1-dso.nd new file mode 100644 index 0000000..3289e25 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-weak-1-gcdso.dnd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-1-gcdso.dnd new file mode 100644 index 0000000..ba82e27 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-weak-1-gcdso.hd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-1-gcdso.hd new file mode 100644 index 0000000..6afe1be --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-weak-1-gcdso.nd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-1-gcdso.nd new file mode 100644 index 0000000..d8d9a78 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-weak-1-rel.hd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-1-rel.hd new file mode 100644 index 0000000..9ae4d47 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-weak-1-rel.nd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-1-rel.nd new file mode 100644 index 0000000..73cfe90 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-weak-1.ex b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-1.ex new file mode 100644 index 0000000..71ac1b5 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-weak-1a.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-1a.s new file mode 100644 index 0000000..da529ca --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-weak-1b.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-1b.s new file mode 100644 index 0000000..e6c2429 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-weak-2a.ex b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-2a.ex new file mode 100644 index 0000000..0e65a8f --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-weak-2a.nd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-2a.nd new file mode 100644 index 0000000..2c2ea1c --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-weak-2a.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-2a.s new file mode 100644 index 0000000..e4d8a04 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-weak-2b.nd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-2b.nd new file mode 100644 index 0000000..d54b35b --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-weak-2b.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-2b.s new file mode 100644 index 0000000..84885ab --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-weak-2c.ex b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-2c.ex new file mode 100644 index 0000000..257cc56 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-2c.ex @@ -0,0 +1 @@ +foo diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-2c.nd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-2c.nd new file mode 100644 index 0000000..d42034b --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-weak-2c.od b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-2c.od new file mode 100644 index 0000000..272c80e --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-weak-2c.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-2c.s new file mode 100644 index 0000000..5ca93d3 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-weak-3-32.d b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-3-32.d new file mode 100644 index 0000000..45976c9 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-weak-3-32.dd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-3-32.dd new file mode 100644 index 0000000..c52b735 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-weak-3-64.d b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-3-64.d new file mode 100644 index 0000000..4673175 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-weak-3-64.dd b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-3-64.dd new file mode 100644 index 0000000..7c10f6c --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-weak-3a.ex b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-3a.ex new file mode 100644 index 0000000..589f40b --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-3a.ex @@ -0,0 +1,3 @@ +x1 +x2 +x3 diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-3a.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-3a.s new file mode 100644 index 0000000..e8b9d96 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix-weak-3b.ex b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-3b.ex new file mode 100644 index 0000000..975fbec --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-3b.ex @@ -0,0 +1 @@ +y diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-3b.s b/binutils-2.21/ld/testsuite/ld-powerpc/aix-weak-3b.s new file mode 100644 index 0000000..4e69082 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/aix52.exp b/binutils-2.21/ld/testsuite/ld-powerpc/aix52.exp new file mode 100644 index 0000000..2f00cff --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/apuinfo-nul.rd b/binutils-2.21/ld/testsuite/ld-powerpc/apuinfo-nul.rd new file mode 100644 index 0000000..c20fc5e --- /dev/null +++ b/binutils-2.21/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 00000000 00000002 41505569 ............APUi + 0x00000010 6e666f00 nfo. diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/apuinfo-nul.s b/binutils-2.21/ld/testsuite/ld-powerpc/apuinfo-nul.s new file mode 100644 index 0000000..6b17142 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/apuinfo-nul1.s b/binutils-2.21/ld/testsuite/ld-powerpc/apuinfo-nul1.s new file mode 100644 index 0000000..f415e71 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/apuinfo.rd b/binutils-2.21/ld/testsuite/ld-powerpc/apuinfo.rd new file mode 100644 index 0000000..7a27bc0 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/apuinfo.rd @@ -0,0 +1,11 @@ +#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 0000001c 00000002 41505569 ............APUi + 0x00000010 6e666f00 00420001 00430001 00410001 nfo..B...C...A.. + 0x00000020 01020001 01010001 00400001 01000001 .........@...... diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/apuinfo1.s b/binutils-2.21/ld/testsuite/ld-powerpc/apuinfo1.s new file mode 100644 index 0000000..fd42eac --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/apuinfo2.s b/binutils-2.21/ld/testsuite/ld-powerpc/apuinfo2.s new file mode 100644 index 0000000..7f4e7bb --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/attr-gnu-12-1.s b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-12-1.s new file mode 100644 index 0000000..10cbe3b --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-12-1.s @@ -0,0 +1 @@ +.gnu_attribute 12,1 diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-12-11.d b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-12-11.d new file mode 100644 index 0000000..e88c4ba --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/attr-gnu-12-2.s b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-12-2.s new file mode 100644 index 0000000..c39de66 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-12-2.s @@ -0,0 +1 @@ +.gnu_attribute 12,2 diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-12-21.d b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-12-21.d new file mode 100644 index 0000000..ef14e35 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/attr-gnu-4-0.s b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-0.s new file mode 100644 index 0000000..a143746 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-0.s @@ -0,0 +1 @@ +.gnu_attribute 4,0 diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-00.d b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-00.d new file mode 100644 index 0000000..a4751a1 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/attr-gnu-4-01.d b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-01.d new file mode 100644 index 0000000..212e0c4 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/attr-gnu-4-02.d b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-02.d new file mode 100644 index 0000000..9bd42b5 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/attr-gnu-4-03.d b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-03.d new file mode 100644 index 0000000..03b0c3c --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/attr-gnu-4-1.s b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-1.s new file mode 100644 index 0000000..e985a56 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-1.s @@ -0,0 +1 @@ +.gnu_attribute 4,1 diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-10.d b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-10.d new file mode 100644 index 0000000..93297c2 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/attr-gnu-4-11.d b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-11.d new file mode 100644 index 0000000..fb2b76e --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/attr-gnu-4-12.d b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-12.d new file mode 100644 index 0000000..b7ffba0 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/attr-gnu-4-13.d b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-13.d new file mode 100644 index 0000000..6bc3de4 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/attr-gnu-4-14.d b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-14.d new file mode 100644 index 0000000..3bb6661 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/attr-gnu-4-2.s b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-2.s new file mode 100644 index 0000000..54ebf4e --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-2.s @@ -0,0 +1 @@ +.gnu_attribute 4,2 diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-20.d b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-20.d new file mode 100644 index 0000000..3d83893 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/attr-gnu-4-21.d b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-21.d new file mode 100644 index 0000000..b38f248 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/attr-gnu-4-22.d b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-22.d new file mode 100644 index 0000000..f6bd198 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/attr-gnu-4-23.d b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-23.d new file mode 100644 index 0000000..f72c258 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/attr-gnu-4-24.d b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-24.d new file mode 100644 index 0000000..fc17f91 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/attr-gnu-4-3.s b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-3.s new file mode 100644 index 0000000..32e5f5d --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-3.s @@ -0,0 +1 @@ +.gnu_attribute 4,3 diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-31.d b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-31.d new file mode 100644 index 0000000..8ee1874 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/attr-gnu-4-32.d b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-32.d new file mode 100644 index 0000000..3b7cb29 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/attr-gnu-4-33.d b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-33.d new file mode 100644 index 0000000..88367ae --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/attr-gnu-4-34.d b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-34.d new file mode 100644 index 0000000..6f6e1fe --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/attr-gnu-4-4.s b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-4.s new file mode 100644 index 0000000..3ff129a --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-4.s @@ -0,0 +1 @@ +.gnu_attribute 4,4 diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-41.d b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-4-41.d new file mode 100644 index 0000000..b909476 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/attr-gnu-8-1.s b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-8-1.s new file mode 100644 index 0000000..81c7b7f --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-8-1.s @@ -0,0 +1 @@ +.gnu_attribute 8,1 diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-8-11.d b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-8-11.d new file mode 100644 index 0000000..7e49d4a --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/attr-gnu-8-2.s b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-8-2.s new file mode 100644 index 0000000..0f18f5f --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-8-2.s @@ -0,0 +1 @@ +.gnu_attribute 8,2 diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-8-23.d b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-8-23.d new file mode 100644 index 0000000..b22e4bd --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/attr-gnu-8-3.s b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-8-3.s new file mode 100644 index 0000000..6a1cf4e --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-8-3.s @@ -0,0 +1 @@ +.gnu_attribute 8,3 diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-8-31.d b/binutils-2.21/ld/testsuite/ld-powerpc/attr-gnu-8-31.d new file mode 100644 index 0000000..53e8f99 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/oldtlslib.s b/binutils-2.21/ld/testsuite/ld-powerpc/oldtlslib.s new file mode 100644 index 0000000..5786df1 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/plt1.d b/binutils-2.21/ld/testsuite/ld-powerpc/plt1.d new file mode 100644 index 0000000..d8d9d8d --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/plt1.d @@ -0,0 +1,20 @@ +#source: plt1.s +#as: -a32 +#objdump: -dr +#target: powerpc*-*-* + +.*: file format elf32-powerpc + +Disassembly of section .text: + +0+ <_start>: + 0: 42 9f 00 05 bcl- 20,4\*cr7\+so,4 .* + 4: 7f c8 02 a6 mflr r30 + 8: 3f de 00 00 addis r30,r30,0 + a: R_PPC_REL16_HA _GLOBAL_OFFSET_TABLE_\+0x6 + c: 3b de 00 0a addi r30,r30,10 + e: R_PPC_REL16_LO _GLOBAL_OFFSET_TABLE_\+0xa + 10: 48 00 00 01 bl 10 .* + 10: R_PPC_PLTREL24 _exit + 14: 48 00 00 00 b 14 .* + 14: R_PPC_REL24 _start diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/plt1.s b/binutils-2.21/ld/testsuite/ld-powerpc/plt1.s new file mode 100644 index 0000000..c00c264 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/powerpc.exp b/binutils-2.21/ld/testsuite/ld-powerpc/powerpc.exp new file mode 100644 index 0000000..6cb797e --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/powerpc.exp @@ -0,0 +1,220 @@ +# Expect script for ld-powerpc tests +# Copyright 2002, 2003, 2005, 2006, 2007, 2008, 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*-*-*"] } { + 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 [ string match "*elf64ppc*" $tmp ] then { + return 1 + } else { + return 0 + } +} + +# List contains test-items with 3 items followed by 2 lists: +# 0:name 1:ld options 2:assembler options +# 3:filenames of assembler files 4: action and options. 5: 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 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 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"} + {"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 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 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 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 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 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 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"} + {"sym@tocbase" "-shared -melf64ppc" "-a64" {symtocbase-1.s symtocbase-2.s} + {{objdump -dj.data symtocbase.d}} "symtocbase.so"} + {"TOC opt" "-melf64ppc" "-a64" {tocopt.s} + {{objdump -s tocopt.d}} "tocopt"} +} + + +run_ld_link_tests $ppcelftests + +if [ supports_ppc64 ] then { + run_ld_link_tests $ppc64elftests + run_dump_test "relbrlt" +} + +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" diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/relax.d b/binutils-2.21/ld/testsuite/ld-powerpc/relax.d new file mode 100644 index 0000000..5a6b3dd --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/relax.d @@ -0,0 +1,15 @@ + +.*: file format .* + +Disassembly of section .text: + +00000000 <_start>: + 0: 48 00 43 21 bl 4320 <near> + 4: 48 00 00 11 bl 14 <_start\+0x14> + 8: 48 00 43 19 bl 4320 <near> + c: 48 00 00 09 bl 14 <_start\+0x14> + 10: 4b ff ff f0 b 0 <.*> + 14: 3d 80 80 00 lis r12,-32768 + 18: 39 8c 12 34 addi r12,r12,4660 + 1c: 7d 89 03 a6 mtctr r12 + 20: 4e 80 04 20 bctr diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/relax.s b/binutils-2.21/ld/testsuite/ld-powerpc/relax.s new file mode 100644 index 0000000..11afc53 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/relaxr.d b/binutils-2.21/ld/testsuite/ld-powerpc/relaxr.d new file mode 100644 index 0000000..6e55984 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/relaxr.d @@ -0,0 +1,26 @@ + +.*: file format .* + +Disassembly of section .text: + +00000000 <_start>: + 0: 48 00 00 15 bl 14 <_start\+0x14> + 4: 48 00 00 21 bl 24 <_start\+0x24> + 8: 48 00 00 0d bl 14 <_start\+0x14> + 8: R_PPC_NONE \*ABS\* + c: 48 00 00 19 bl 24 <_start\+0x24> + c: R_PPC_NONE \*ABS\* + 10: 48 00 00 00 b 10 <_start\+0x10> + 10: R_PPC_REL24 _start + 14: 3d 80 00 00 lis r12,0 + 16: R_PPC_ADDR16_HA near + 18: 39 8c 00 00 addi r12,r12,0 + 1a: R_PPC_ADDR16_LO near + 1c: 7d 89 03 a6 mtctr r12 + 20: 4e 80 04 20 bctr + 24: 3d 80 00 00 lis r12,0 + 26: R_PPC_ADDR16_HA far + 28: 39 8c 00 00 addi r12,r12,0 + 2a: R_PPC_ADDR16_LO far + 2c: 7d 89 03 a6 mtctr r12 + 30: 4e 80 04 20 bctr diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/relbrlt.d b/binutils-2.21/ld/testsuite/ld-powerpc/relbrlt.d new file mode 100644 index 0000000..69321eb --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/relbrlt.d @@ -0,0 +1,60 @@ +#source: relbrlt.s +#as: -a64 +#ld: -melf64ppc --emit-relocs +#objdump: -Dr + +.*: file format elf64-powerpc + +Disassembly of section \.text: + +0*100000b0 <_start>: +[0-9a-f ]*: 49 bf 00 2d bl .* +[0-9a-f ]*: R_PPC64_REL24 \.text\+0x37e003c +[0-9a-f ]*: 60 00 00 00 nop +[0-9a-f ]*: 49 bf 00 19 bl .* +[0-9a-f ]*: R_PPC64_REL24 \.text\+0x3bf0020 +[0-9a-f ]*: 60 00 00 00 nop +[0-9a-f ]*: 49 bf 00 21 bl .* +[0-9a-f ]*: R_PPC64_REL24 \.text\+0x57e0024 +[0-9a-f ]*: 60 00 00 00 nop +[0-9a-f ]*: 00 00 00 00 \.long 0x0 +[0-9a-f ]*: 4b ff ff e4 b .* <_start> + \.\.\. + +[0-9a-f ]*<.*plt_branch.*>: +[0-9a-f ]*: e9 62 80 00 ld r11,-32768\(r2\) +[0-9a-f ]*: R_PPC64_TOC16_DS \*ABS\*\+0x157f00d8 +[0-9a-f ]*: 7d 69 03 a6 mtctr r11 +[0-9a-f ]*: 4e 80 04 20 bctr + +[0-9a-f ]*<.*long_branch.*>: +[0-9a-f ]*: 49 bf 00 10 b .* <far> +[0-9a-f ]*: R_PPC64_REL24 \*ABS\*\+0x137e00ec + +[0-9a-f ]*<.*plt_branch.*>: +[0-9a-f ]*: e9 62 80 08 ld r11,-32760\(r2\) +[0-9a-f ]*: R_PPC64_TOC16_DS \*ABS\*\+0x157f00e0 +[0-9a-f ]*: 7d 69 03 a6 mtctr r11 +[0-9a-f ]*: 4e 80 04 20 bctr + \.\.\. + +0*137e00ec <far>: +[0-9a-f ]*: 4e 80 00 20 blr + \.\.\. + +0*13bf00d0 <far2far>: +[0-9a-f ]*: 4e 80 00 20 blr + \.\.\. + +0*157e00d4 <huge>: +[0-9a-f ]*: 4e 80 00 20 blr + +Disassembly of section \.branch_lt: + +0*157f00d8 <\.branch_lt>: +[0-9a-f ]*: 00 00 00 00 .* +[0-9a-f ]*: R_PPC64_RELATIVE \*ABS\*\+0x13bf00d0 +[0-9a-f ]*: 13 bf 00 d0 .* +[0-9a-f ]*: 00 00 00 00 .* +[0-9a-f ]*: R_PPC64_RELATIVE \*ABS\*\+0x157e00d4 +[0-9a-f ]*: 15 7e 00 d4 .* diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/relbrlt.s b/binutils-2.21/ld/testsuite/ld-powerpc/relbrlt.s new file mode 100644 index 0000000..cee0cdd --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/reloc.d b/binutils-2.21/ld/testsuite/ld-powerpc/reloc.d new file mode 100644 index 0000000..1c7eb8a --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/reloc.s b/binutils-2.21/ld/testsuite/ld-powerpc/reloc.s new file mode 100644 index 0000000..4e66151 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/sdadyn.d b/binutils-2.21/ld/testsuite/ld-powerpc/sdadyn.d new file mode 100644 index 0000000..42e389f --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/sdadyn.d @@ -0,0 +1,8 @@ + +.*: +file format elf32-powerpc + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +#... +.* R_PPC_COPY lib_var +#pass diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/sdadyn.s b/binutils-2.21/ld/testsuite/ld-powerpc/sdadyn.s new file mode 100644 index 0000000..1b2d13f --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/sdadyn.s @@ -0,0 +1,3 @@ + .globl _start +_start: + lwz 3,lib_var@sda21(0) diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/sdalib.s b/binutils-2.21/ld/testsuite/ld-powerpc/sdalib.s new file mode 100644 index 0000000..69b0391 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/symtocbase-1.s b/binutils-2.21/ld/testsuite/ld-powerpc/symtocbase-1.s new file mode 100644 index 0000000..ba6f073 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/symtocbase-2.s b/binutils-2.21/ld/testsuite/ld-powerpc/symtocbase-2.s new file mode 100644 index 0000000..1176cb8 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/symtocbase.d b/binutils-2.21/ld/testsuite/ld-powerpc/symtocbase.d new file mode 100644 index 0000000..5ffab72 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/symtocbase.d @@ -0,0 +1,24 @@ +#source: symtocbase-1.s +#source: symtocbase-2.s +#as: -a64 +#ld: -shared -melf64ppc +#objdump: -dj.data +#target: powerpc64*-*-* + +.*: file format elf64-powerpc + +Disassembly of section \.data: + +.* <i>: + \.\.\. +.*: 00 02 80 00 \.long 0x28000 +.*: 00 00 00 00 \.long 0x0 +.*: 00 02 80 00 \.long 0x28000 +.*: 00 00 00 00 \.long 0x0 +.*: 00 03 80 00 \.long 0x38000 +.*: 00 00 00 00 \.long 0x0 +.*: 00 03 80 00 \.long 0x38000 +.*: 00 00 00 00 \.long 0x0 +.*: 00 02 80 00 \.long 0x28000 +.*: 00 00 00 00 \.long 0x0 +.*: 00 03 80 00 \.long 0x38000 diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tls.d b/binutils-2.21/ld/testsuite/ld-powerpc/tls.d new file mode 100644 index 0000000..abae98a --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tls.d @@ -0,0 +1,53 @@ +#source: tls.s +#source: tlslib.s +#as: -a64 +#ld: -melf64ppc +#objdump: -dr +#target: powerpc64*-*-* + +.*: +file format elf64-powerpc + +Disassembly of section \.text: + +0+100000e8 <_start>: + 100000e8: 3c 6d 00 00 addis r3,r13,0 + 100000ec: 60 00 00 00 nop + 100000f0: 38 63 90 78 addi r3,r3,-28552 + 100000f4: 3c 6d 00 00 addis r3,r13,0 + 100000f8: 60 00 00 00 nop + 100000fc: 38 63 10 00 addi r3,r3,4096 + 10000100: 3c 6d 00 00 addis r3,r13,0 + 10000104: 60 00 00 00 nop + 10000108: 38 63 90 40 addi r3,r3,-28608 + 1000010c: 3c 6d 00 00 addis r3,r13,0 + 10000110: 60 00 00 00 nop + 10000114: 38 63 10 00 addi r3,r3,4096 + 10000118: 39 23 80 48 addi r9,r3,-32696 + 1000011c: 3d 23 00 00 addis r9,r3,0 + 10000120: 81 49 80 50 lwz r10,-32688\(r9\) + 10000124: e9 22 80 10 ld r9,-32752\(r2\) + 10000128: 7d 49 18 2a ldx r10,r9,r3 + 1000012c: 3d 2d 00 00 addis r9,r13,0 + 10000130: a1 49 90 60 lhz r10,-28576\(r9\) + 10000134: 89 4d 90 68 lbz r10,-28568\(r13\) + 10000138: 3d 2d 00 00 addis r9,r13,0 + 1000013c: 99 49 90 70 stb r10,-28560\(r9\) + 10000140: 3c 6d 00 00 addis r3,r13,0 + 10000144: 60 00 00 00 nop + 10000148: 38 63 90 00 addi r3,r3,-28672 + 1000014c: 3c 6d 00 00 addis r3,r13,0 + 10000150: 60 00 00 00 nop + 10000154: 38 63 10 00 addi r3,r3,4096 + 10000158: f9 43 80 08 std r10,-32760\(r3\) + 1000015c: 3d 23 00 00 addis r9,r3,0 + 10000160: 91 49 80 10 stw r10,-32752\(r9\) + 10000164: e9 22 80 08 ld r9,-32760\(r2\) + 10000168: 7d 49 19 2a stdx r10,r9,r3 + 1000016c: 3d 2d 00 00 addis r9,r13,0 + 10000170: b1 49 90 60 sth r10,-28576\(r9\) + 10000174: e9 4d 90 2a lwa r10,-28632\(r13\) + 10000178: 3d 2d 00 00 addis r9,r13,0 + 1000017c: a9 49 90 30 lha r10,-28624\(r9\) + +0+10000180 <\.__tls_get_addr>: + 10000180: 4e 80 00 20 blr diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tls.g b/binutils-2.21/ld/testsuite/ld-powerpc/tls.g new file mode 100644 index 0000000..051ddd1 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tls.g @@ -0,0 +1,12 @@ +#source: tls.s +#source: tlslib.s +#as: -a64 +#ld: -melf64ppc +#objdump: -sj.got +#target: powerpc64*-*-* + +.*: +file format elf64-powerpc + +Contents of section \.got: + 100101e0 00000000 100181e0 ffffffff ffff8018 .* + 100101f0 ffffffff ffff8058 .* diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tls.s b/binutils-2.21/ld/testsuite/ld-powerpc/tls.s new file mode 100644 index 0000000..5ad9f3d --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tls.s @@ -0,0 +1,92 @@ + .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 + + .text +_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.21/ld/testsuite/ld-powerpc/tls.t b/binutils-2.21/ld/testsuite/ld-powerpc/tls.t new file mode 100644 index 0000000..32a909b --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tls.t @@ -0,0 +1,14 @@ +#source: tls.s +#source: tlslib.s +#as: -a64 +#ld: -melf64ppc +#objdump: -sj.tdata +#target: powerpc64*-*-* + +.*: +file format elf64-powerpc + +Contents of section \.tdata: +.* 12345678 9abcdef0 23456789 abcdef01 .* +.* 3456789a bcdef012 456789ab cdef0123 .* +.* 56789abc def01234 6789abcd ef012345 .* +.* 789abcde f0123456 00c0ffee .* diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tls32.d b/binutils-2.21/ld/testsuite/ld-powerpc/tls32.d new file mode 100644 index 0000000..86fe04a --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tls32.d @@ -0,0 +1,50 @@ +#source: tls32.s +#source: tlslib32.s +#as: -a32 +#ld: -melf32ppc +#objdump: -dr +#target: powerpc*-*-* + +.*: +file format elf32-powerpc + +Disassembly of section \.text: + +0+1800094 <_start>: + 1800094: 3c 62 00 00 addis r3,r2,0 + 1800098: 38 63 90 3c addi r3,r3,-28612 + 180009c: 3c 62 00 00 addis r3,r2,0 + 18000a0: 38 63 10 00 addi r3,r3,4096 + 18000a4: 3c 62 00 00 addis r3,r2,0 + 18000a8: 38 63 90 20 addi r3,r3,-28640 + 18000ac: 3c 62 00 00 addis r3,r2,0 + 18000b0: 38 63 10 00 addi r3,r3,4096 + 18000b4: 39 23 80 24 addi r9,r3,-32732 + 18000b8: 3d 23 00 00 addis r9,r3,0 + 18000bc: 81 49 80 28 lwz r10,-32728\(r9\) + 18000c0: 3d 22 00 00 addis r9,r2,0 + 18000c4: a1 49 90 30 lhz r10,-28624\(r9\) + 18000c8: 89 42 90 34 lbz r10,-28620\(r2\) + 18000cc: 3d 22 00 00 addis r9,r2,0 + 18000d0: 99 49 90 38 stb r10,-28616\(r9\) + 18000d4: 3c 62 00 00 addis r3,r2,0 + 18000d8: 38 63 90 00 addi r3,r3,-28672 + 18000dc: 3c 62 00 00 addis r3,r2,0 + 18000e0: 38 63 10 00 addi r3,r3,4096 + 18000e4: 91 43 80 04 stw r10,-32764\(r3\) + 18000e8: 3d 23 00 00 addis r9,r3,0 + 18000ec: 91 49 80 08 stw r10,-32760\(r9\) + 18000f0: 3d 22 00 00 addis r9,r2,0 + 18000f4: b1 49 90 30 sth r10,-28624\(r9\) + 18000f8: a1 42 90 14 lhz r10,-28652\(r2\) + 18000fc: 3d 22 00 00 addis r9,r2,0 + 1800100: a9 49 90 18 lha r10,-28648\(r9\) + +0+1800104 <__tls_get_addr>: + 1800104: 4e 80 00 20 blr +Disassembly of section \.got: + +0+1810128 <_GLOBAL_OFFSET_TABLE_-0x4>: + 1810128: 4e 80 00 21 blrl + +0+181012c <_GLOBAL_OFFSET_TABLE_>: + \.\.\. diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tls32.g b/binutils-2.21/ld/testsuite/ld-powerpc/tls32.g new file mode 100644 index 0000000..e8c72cc --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tls32.g @@ -0,0 +1,11 @@ +#source: tls32.s +#source: tlslib32.s +#as: -a32 +#ld: -melf32ppc +#objdump: -sj.got +#target: powerpc*-*-* + +.*: +file format elf32-powerpc + +Contents of section \.got: + 1810128 4e800021 00000000 00000000 00000000 .* diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tls32.s b/binutils-2.21/ld/testsuite/ld-powerpc/tls32.s new file mode 100644 index 0000000..1c3092d --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/tls32.t b/binutils-2.21/ld/testsuite/ld-powerpc/tls32.t new file mode 100644 index 0000000..8149a28 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tls32.t @@ -0,0 +1,12 @@ +#source: tls32.s +#source: tlslib32.s +#as: -a32 +#ld: -melf32ppc +#objdump: -sj.tdata +#target: powerpc*-*-* + +.*: +file format elf32-powerpc + +Contents of section \.tdata: + 1810108 12345678 23456789 3456789a 456789ab .* + 1810118 56789abc 6789abcd 789abcde 00c0ffee .* diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlsexe.d b/binutils-2.21/ld/testsuite/ld-powerpc/tlsexe.d new file mode 100644 index 0000000..54db23d --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlsexe.d @@ -0,0 +1,90 @@ +#source: tls.s +#as: -a64 +#ld: -melf64ppc tmpdir/libtlslib.so +#objdump: -dr +#target: powerpc64*-*-* + +.*: +file format elf64-powerpc + +Disassembly of section \.text: + +.* <00000010\.plt_call\.__tls_get_addr(|_opt)\+0>: +.* e9 63 00 00 ld r11,0\(r3\) +.* e9 83 00 08 ld r12,8\(r3\) +.* 7c 60 1b 78 mr r0,r3 +.* 2c 2b 00 00 cmpdi r11,0 +.* 7c 6c 6a 14 add r3,r12,r13 +.* 4d 82 00 20 beqlr +.* 7c 03 03 78 mr r3,r0 +.* 7d 68 02 a6 mflr r11 +.* f9 61 00 20 std r11,32\(r1\) +.* f8 41 00 28 std r2,40\(r1\) +.* e9 62 80 48 ld r11,-32696\(r2\) +.* 7d 69 03 a6 mtctr r11 +.* e9 62 80 58 ld r11,-32680\(r2\) +.* e8 42 80 50 ld r2,-32688\(r2\) +.* 4e 80 04 21 bctrl +.* e9 61 00 20 ld r11,32\(r1\) +.* e8 41 00 28 ld r2,40\(r1\) +.* 7d 68 03 a6 mtlr r11 +.* 4e 80 00 20 blr + +.* <_start>: +.* e8 62 80 10 ld r3,-32752\(r2\) +.* 60 00 00 00 nop +.* 7c 63 6a 14 add r3,r3,r13 +.* 38 62 80 18 addi r3,r2,-32744 +.* 4b ff ff a5 bl .* +.* 60 00 00 00 nop +.* 3c 6d 00 00 addis r3,r13,0 +.* 60 00 00 00 nop +.* 38 63 90 38 addi r3,r3,-28616 +.* 3c 6d 00 00 addis r3,r13,0 +.* 60 00 00 00 nop +.* 38 63 10 00 addi r3,r3,4096 +.* 39 23 80 40 addi r9,r3,-32704 +.* 3d 23 00 00 addis r9,r3,0 +.* 81 49 80 48 lwz r10,-32696\(r9\) +.* e9 22 80 28 ld r9,-32728\(r2\) +.* 7d 49 18 2a ldx r10,r9,r3 +.* 3d 2d 00 00 addis r9,r13,0 +.* a1 49 90 58 lhz r10,-28584\(r9\) +.* 89 4d 90 60 lbz r10,-28576\(r13\) +.* 3d 2d 00 00 addis r9,r13,0 +.* 99 49 90 68 stb r10,-28568\(r9\) +.* 3c 6d 00 00 addis r3,r13,0 +.* 60 00 00 00 nop +.* 38 63 90 00 addi r3,r3,-28672 +.* 3c 6d 00 00 addis r3,r13,0 +.* 60 00 00 00 nop +.* 38 63 10 00 addi r3,r3,4096 +.* f9 43 80 08 std r10,-32760\(r3\) +.* 3d 23 00 00 addis r9,r3,0 +.* 91 49 80 10 stw r10,-32752\(r9\) +.* e9 22 80 08 ld r9,-32760\(r2\) +.* 7d 49 19 2a stdx r10,r9,r3 +.* 3d 2d 00 00 addis r9,r13,0 +.* b1 49 90 58 sth r10,-28584\(r9\) +.* e9 4d 90 2a lwa r10,-28632\(r13\) +.* 3d 2d 00 00 addis r9,r13,0 +.* a9 49 90 30 lha r10,-28624\(r9\) +.* 60 00 00 00 nop +.* 00 00 00 00 .* +.* 00 01 02 00 .* +.* <__glink_PLTresolve>: +.* 7d 88 02 a6 mflr r12 +.* 42 9f 00 05 bcl- 20,4\*cr7\+so,.* +.* 7d 68 02 a6 mflr r11 +.* e8 4b ff f0 ld r2,-16\(r11\) +.* 7d 88 03 a6 mtlr r12 +.* 7d 82 5a 14 add r12,r2,r11 +.* e9 6c 00 00 ld r11,0\(r12\) +.* e8 4c 00 08 ld r2,8\(r12\) +.* 7d 69 03 a6 mtctr r11 +.* e9 6c 00 10 ld r11,16\(r12\) +.* 4e 80 04 20 bctr +.* 60 00 00 00 nop +.* 60 00 00 00 nop +.* 60 00 00 00 nop +.* 38 00 00 00 li r0,0 +.* 4b ff ff c4 b .* diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlsexe.g b/binutils-2.21/ld/testsuite/ld-powerpc/tlsexe.g new file mode 100644 index 0000000..c68175f --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlsexe.g @@ -0,0 +1,12 @@ +#source: tls.s +#as: -a64 +#ld: -melf64ppc tmpdir/libtlslib.so +#objdump: -sj.got +#target: powerpc64*-*-* + +.*: +file format elf64-powerpc + +Contents of section \.got: +.* 00000000 10018618 ffffffff ffff8018 .* +.* 00000000 00000000 00000000 00000000 .* +.* 00000000 00000000 00000000 00000000 .* diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlsexe.r b/binutils-2.21/ld/testsuite/ld-powerpc/tlsexe.r new file mode 100644 index 0000000..68b36bb --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlsexe.r @@ -0,0 +1,115 @@ +#source: tls.s +#source: tlslib.s +#as: -a64 +#ld: -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]+\] \.interp +.* + +\[[ 0-9]+\] \.hash +.* + +\[[ 0-9]+\] \.dynsym +.* + +\[[ 0-9]+\] \.dynstr +.* + +\[[ 0-9]+\] \.rela\.dyn +.* + +\[[ 0-9]+\] \.rela\.plt +.* + +\[[ 0-9]+\] \.text +PROGBITS .* 0+130 0+ +AX +0 +0 +8 + +\[[ 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]+\] \.branch_lt + PROGBITS .* 0+ 0+ +WA +0 +0 +8 + +\[[ 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 (\.branch_lt |)\.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 +ABS __bss_start +.* FUNC +GLOBAL +DEFAULT +UND __tls_get_addr_opt +.* NOTYPE +GLOBAL +DEFAULT +ABS _edata +.* NOTYPE +GLOBAL +DEFAULT +ABS _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 +.* 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 +.* OBJECT +LOCAL +DEFAULT +10 _DYNAMIC +.* (NOTYPE +LOCAL +DEFAULT +7 00000010\.plt_call\.__tls_get_addr(|_opt)\+0|(FUNC|NOTYPE) +LOCAL +DEFAULT +UND \.__tls_get_addr(|_opt)) +.* (NOTYPE +LOCAL +DEFAULT +7 __glink_PLTresolve|NOTYPE +LOCAL +DEFAULT +7 00000010\.plt_call\.__tls_get_addr(|_opt)\+0) +.* ((FUNC|NOTYPE) +LOCAL +DEFAULT +UND \.__tls_get_addr(|_opt)|NOTYPE +LOCAL +DEFAULT +7 __glink_PLTresolve) +.* GLOBAL +DEFAULT +UND gd +.* GLOBAL +DEFAULT +9 le0 +.* GLOBAL +DEFAULT +9 ld0 +.* GLOBAL +DEFAULT +9 le1 +.* GLOBAL +DEFAULT +UND ld +.* NOTYPE +GLOBAL +DEFAULT +7 _start +.* TLS +GLOBAL +DEFAULT +9 ld2 +.* TLS +GLOBAL +DEFAULT +9 ld1 +.* NOTYPE +GLOBAL +DEFAULT +ABS __bss_start +.* FUNC +GLOBAL +DEFAULT +UND __tls_get_addr_opt +.* NOTYPE +GLOBAL +DEFAULT +ABS _edata +.* NOTYPE +GLOBAL +DEFAULT +ABS _end +.* TLS +GLOBAL +DEFAULT +9 gd0 +.* TLS +GLOBAL +DEFAULT +9 ie0 diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlsexe.t b/binutils-2.21/ld/testsuite/ld-powerpc/tlsexe.t new file mode 100644 index 0000000..bb512fd --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlsexe.t @@ -0,0 +1,13 @@ +#source: tls.s +#as: -a64 +#ld: -melf64ppc tmpdir/libtlslib.so +#objdump: -sj.tdata +#target: powerpc64*-*-* + +.*: +file format elf64-powerpc + +Contents of section \.tdata: + .* 12345678 9abcdef0 23456789 abcdef01 .* + .* 3456789a bcdef012 456789ab cdef0123 .* + .* 56789abc def01234 6789abcd ef012345 .* + .* 789abcde f0123456 .* diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlsexe32.d b/binutils-2.21/ld/testsuite/ld-powerpc/tlsexe32.d new file mode 100644 index 0000000..527ded0 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlsexe32.d @@ -0,0 +1,47 @@ +#source: tls32.s +#as: -a32 +#ld: -melf32ppc tmpdir/libtlslib32.so +#objdump: -dr +#target: powerpc*-*-* + +.*: +file format elf32-powerpc + +Disassembly of section \.text: + +.* <_start>: +.*: 80 7f ff f0 lwz r3,-16\(r31\) +.*: 7c 63 12 14 add r3,r3,r2 +.*: 38 7f ff f4 addi r3,r31,-12 +.*: 48 01 01 85 bl .*<__tls_get_addr_opt@plt> +.*: 3c 62 00 00 addis r3,r2,0 +.*: 38 63 90 1c addi r3,r3,-28644 +.*: 3c 62 00 00 addis r3,r2,0 +.*: 38 63 10 00 addi r3,r3,4096 +.*: 39 23 80 20 addi r9,r3,-32736 +.*: 3d 23 00 00 addis r9,r3,0 +.*: 81 49 80 24 lwz r10,-32732\(r9\) +.*: 3d 22 00 00 addis r9,r2,0 +.*: a1 49 90 2c lhz r10,-28628\(r9\) +.*: 89 42 90 30 lbz r10,-28624\(r2\) +.*: 3d 22 00 00 addis r9,r2,0 +.*: 99 49 90 34 stb r10,-28620\(r9\) +.*: 3c 62 00 00 addis r3,r2,0 +.*: 38 63 90 00 addi r3,r3,-28672 +.*: 3c 62 00 00 addis r3,r2,0 +.*: 38 63 10 00 addi r3,r3,4096 +.*: 91 43 80 04 stw r10,-32764\(r3\) +.*: 3d 23 00 00 addis r9,r3,0 +.*: 91 49 80 08 stw r10,-32760\(r9\) +.*: 3d 22 00 00 addis r9,r2,0 +.*: b1 49 90 2c sth r10,-28628\(r9\) +.*: a1 42 90 14 lhz r10,-28652\(r2\) +.*: 3d 22 00 00 addis r9,r2,0 +.*: a9 49 90 18 lha r10,-28648\(r9\) +Disassembly of section \.got: + +.* <_GLOBAL_OFFSET_TABLE_-0x10>: + \.\.\. +.*: 4e 80 00 21 blrl + +.* <_GLOBAL_OFFSET_TABLE_>: +.*: 01 81 02 b8 00 00 00 00 00 00 00 00 .* diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlsexe32.g b/binutils-2.21/ld/testsuite/ld-powerpc/tlsexe32.g new file mode 100644 index 0000000..c2023a8 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlsexe32.g @@ -0,0 +1,11 @@ +#source: tls32.s +#as: -a32 +#ld: -melf32ppc tmpdir/libtlslib32.so +#objdump: -sj.got +#target: powerpc*-*-* + +.*: +file format elf32-powerpc + +Contents of section \.got: +.* 00000000 00000000 00000000 4e800021 .* +.* 018102b8 00000000 00000000 .* diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlsexe32.r b/binutils-2.21/ld/testsuite/ld-powerpc/tlsexe32.r new file mode 100644 index 0000000..6983b08 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlsexe32.r @@ -0,0 +1,111 @@ +#source: tls32.s +#source: tlslib32.s +#as: -a32 +#ld: -melf32ppc +#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 +ABS __end +.* NOTYPE +GLOBAL +DEFAULT +ABS __bss_start +.* FUNC +GLOBAL +DEFAULT +UND __tls_get_addr_opt +.* NOTYPE +GLOBAL +DEFAULT +ABS _edata +.* NOTYPE +GLOBAL +DEFAULT +ABS _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 +.* 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 +.* 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 +ABS __end +.* TLS +GLOBAL +DEFAULT +9 ld2 +.* TLS +GLOBAL +DEFAULT +9 ld1 +.* NOTYPE +GLOBAL +DEFAULT +ABS __bss_start +.* FUNC +GLOBAL +DEFAULT +UND __tls_get_addr_opt +.* NOTYPE +GLOBAL +DEFAULT +ABS _edata +.* NOTYPE +GLOBAL +DEFAULT +ABS _end +.* TLS +GLOBAL +DEFAULT +9 gd0 +.* TLS +GLOBAL +DEFAULT +9 ie0 diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlsexe32.t b/binutils-2.21/ld/testsuite/ld-powerpc/tlsexe32.t new file mode 100644 index 0000000..2312b33 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlsexe32.t @@ -0,0 +1,11 @@ +#source: tls32.s +#as: -a32 +#ld: -melf32ppc tmpdir/libtlslib32.so +#objdump: -sj.tdata +#target: powerpc*-*-* + +.*: +file format elf32-powerpc + +Contents of section \.tdata: +.* 12345678 23456789 3456789a 456789ab .* +.* 56789abc 6789abcd 789abcde .* diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlsexetoc.d b/binutils-2.21/ld/testsuite/ld-powerpc/tlsexetoc.d new file mode 100644 index 0000000..8354e2d --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlsexetoc.d @@ -0,0 +1,74 @@ +#source: tlstoc.s +#as: -a64 +#ld: -melf64ppc tmpdir/libtlslib.so +#objdump: -dr +#target: powerpc64*-*-* + +.*: +file format elf64-powerpc + +Disassembly of section \.text: + +.* <00000010\.plt_call\.__tls_get_addr(|_opt)\+0>: +.* e9 63 00 00 ld r11,0\(r3\) +.* e9 83 00 08 ld r12,8\(r3\) +.* 7c 60 1b 78 mr r0,r3 +.* 2c 2b 00 00 cmpdi r11,0 +.* 7c 6c 6a 14 add r3,r12,r13 +.* 4d 82 00 20 beqlr +.* 7c 03 03 78 mr r3,r0 +.* 7d 68 02 a6 mflr r11 +.* f9 61 00 20 std r11,32\(r1\) +.* f8 41 00 28 std r2,40\(r1\) +.* e9 62 80 70 ld r11,-32656\(r2\) +.* 7d 69 03 a6 mtctr r11 +.* e9 62 80 80 ld r11,-32640\(r2\) +.* e8 42 80 78 ld r2,-32648\(r2\) +.* 4e 80 04 21 bctrl +.* e9 61 00 20 ld r11,32\(r1\) +.* e8 41 00 28 ld r2,40\(r1\) +.* 7d 68 03 a6 mtlr r11 +.* 4e 80 00 20 blr + +.* <_start>: +.* 38 62 80 08 addi r3,r2,-32760 +.* 4b ff ff b1 bl .* +.* 60 00 00 00 nop +.* 38 62 80 18 addi r3,r2,-32744 +.* 4b ff ff a5 bl .* +.* 60 00 00 00 nop +.* 3c 6d 00 00 addis r3,r13,0 +.* 60 00 00 00 nop +.* 38 63 90 38 addi r3,r3,-28616 +.* 3c 6d 00 00 addis r3,r13,0 +.* 60 00 00 00 nop +.* 38 63 10 00 addi r3,r3,4096 +.* 39 23 80 40 addi r9,r3,-32704 +.* 3d 23 00 00 addis r9,r3,0 +.* 81 49 80 48 lwz r10,-32696\(r9\) +.* e9 22 80 48 ld r9,-32696\(r2\) +.* 7d 49 18 2a ldx r10,r9,r3 +.* 3d 2d 00 00 addis r9,r13,0 +.* a1 49 90 58 lhz r10,-28584\(r9\) +.* 89 4d 90 60 lbz r10,-28576\(r13\) +.* 3d 2d 00 00 addis r9,r13,0 +.* 99 49 90 68 stb r10,-28568\(r9\) +.* 60 00 00 00 nop +.* 00 00 00 00 .* +.* 00 01 02 28 .* +.* <__glink_PLTresolve>: +.* 7d 88 02 a6 mflr r12 +.* 42 9f 00 05 bcl- 20,4\*cr7\+so,.* +.* 7d 68 02 a6 mflr r11 +.* e8 4b ff f0 ld r2,-16\(r11\) +.* 7d 88 03 a6 mtlr r12 +.* 7d 82 5a 14 add r12,r2,r11 +.* e9 6c 00 00 ld r11,0\(r12\) +.* e8 4c 00 08 ld r2,8\(r12\) +.* 7d 69 03 a6 mtctr r11 +.* e9 6c 00 10 ld r11,16\(r12\) +.* 4e 80 04 20 bctr +.* 60 00 00 00 nop +.* 60 00 00 00 nop +.* 60 00 00 00 nop +.* 38 00 00 00 li r0,0 +.* 4b ff ff c4 b .* diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlsexetoc.g b/binutils-2.21/ld/testsuite/ld-powerpc/tlsexetoc.g new file mode 100644 index 0000000..387e9cd --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlsexetoc.g @@ -0,0 +1,15 @@ +#source: tlstoc.s +#as: -a64 +#ld: -melf64ppc tmpdir/libtlslib.so +#objdump: -sj.got +#target: powerpc64*-*-* + +.*: +file format elf64-powerpc + +Contents of section \.got: +.* 00000000 100185b0 00000000 00000000 .* +.* 00000000 00000000 00000000 00000000 .* +.* 00000000 00000000 00000000 00000001 .* +.* 00000000 00000000 00000000 00000001 .* +.* 00000000 00000000 ffffffff ffff8050 .* +.* 00000000 00000000 .* diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlsexetoc.r b/binutils-2.21/ld/testsuite/ld-powerpc/tlsexetoc.r new file mode 100644 index 0000000..8ba8503 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlsexetoc.r @@ -0,0 +1,115 @@ +#source: tlslib.s +#source: tlstoc.s +#as: -a64 +#ld: -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]+\] \.interp +.* + +\[[ 0-9]+\] \.hash +.* + +\[[ 0-9]+\] \.dynsym +.* + +\[[ 0-9]+\] \.dynstr +.* + +\[[ 0-9]+\] \.rela\.dyn +.* + +\[[ 0-9]+\] \.rela\.plt +.* + +\[[ 0-9]+\] \.text +PROGBITS .* 0+f0 0+ +AX +0 +0 +8 + +\[[ 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]+\] \.branch_lt +PROGBITS .* 0+ 0+ +WA +0 +0 +8 + +\[[ 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 (\.branch_lt |)\.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 +ABS __bss_start +.* FUNC +GLOBAL +DEFAULT +UND __tls_get_addr_opt +.* NOTYPE +GLOBAL +DEFAULT +ABS _edata +.* NOTYPE +GLOBAL +DEFAULT +ABS _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 +.* 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 +.* OBJECT +LOCAL +DEFAULT +10 _DYNAMIC +.* (NOTYPE +LOCAL +DEFAULT +7 00000010\.plt_call\.__tls_get_addr(|_opt)\+0|(FUNC|NOTYPE) +LOCAL +DEFAULT +UND \.__tls_get_addr(|_opt)) +.* (NOTYPE +LOCAL +DEFAULT +7 __glink_PLTresolve|NOTYPE +LOCAL +DEFAULT +7 00000010\.plt_call\.__tls_get_addr(|_opt)\+0) +.* ((FUNC|NOTYPE) +LOCAL +DEFAULT +UND \.__tls_get_addr(|_opt)|NOTYPE +LOCAL +DEFAULT +7 __glink_PLTresolve) +.* 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 +.* TLS +GLOBAL +DEFAULT +9 ld2 +.* TLS +GLOBAL +DEFAULT +9 ld1 +.* NOTYPE +GLOBAL +DEFAULT +ABS __bss_start +.* FUNC +GLOBAL +DEFAULT +UND __tls_get_addr_opt +.* NOTYPE +GLOBAL +DEFAULT +ABS _edata +.* NOTYPE +GLOBAL +DEFAULT +ABS _end +.* TLS +GLOBAL +DEFAULT +9 gd0 +.* TLS +GLOBAL +DEFAULT +9 ie0 diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlsexetoc.t b/binutils-2.21/ld/testsuite/ld-powerpc/tlsexetoc.t new file mode 100644 index 0000000..10bfaa4 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlsexetoc.t @@ -0,0 +1,13 @@ +#source: tlstoc.s +#as: -a64 +#ld: -melf64ppc tmpdir/libtlslib.so +#objdump: -sj.tdata +#target: powerpc64*-*-* + +.*: +file format elf64-powerpc + +Contents of section \.tdata: +.* 12345678 9abcdef0 23456789 abcdef01 .* +.* 3456789a bcdef012 456789ab cdef0123 .* +.* 56789abc def01234 6789abcd ef012345 .* +.* 789abcde f0123456 .* diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlslib.s b/binutils-2.21/ld/testsuite/ld-powerpc/tlslib.s new file mode 100644 index 0000000..59c40d2 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/tlslib32.s b/binutils-2.21/ld/testsuite/ld-powerpc/tlslib32.s new file mode 100644 index 0000000..14dc966 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/tlsmark.d b/binutils-2.21/ld/testsuite/ld-powerpc/tlsmark.d new file mode 100644 index 0000000..8ba350e --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlsmark.d @@ -0,0 +1,42 @@ +#source: tlsmark.s +#source: tlslib.s +#as: -a64 +#ld: -melf64ppc +#objdump: -dr +#target: powerpc64*-*-* + +.*: +file format elf64-powerpc + +Disassembly of section \.text: + +0+100000e8 <_start>: + 100000e8: 48 00 00 18 b 10000100 <_start\+0x18> + 100000ec: 60 00 00 00 nop + 100000f0: 38 63 90 00 addi r3,r3,-28672 + 100000f4: e8 83 00 00 ld r4,0\(r3\) + 100000f8: 3c 6d 00 00 addis r3,r13,0 + 100000fc: 48 00 00 0c b 10000108 <_start\+0x20> + 10000100: 3c 6d 00 00 addis r3,r13,0 + 10000104: 4b ff ff e8 b 100000ec <_start\+0x4> + 10000108: 60 00 00 00 nop + 1000010c: 38 63 10 00 addi r3,r3,4096 + 10000110: e8 83 80 00 ld r4,-32768\(r3\) + 10000114: 3c 6d 00 00 addis r3,r13,0 + 10000118: 48 00 00 0c b 10000124 <_start\+0x3c> + 1000011c: 3c 6d 00 00 addis r3,r13,0 + 10000120: 48 00 00 14 b 10000134 <_start\+0x4c> + 10000124: 60 00 00 00 nop + 10000128: 38 63 90 04 addi r3,r3,-28668 + 1000012c: e8 a3 00 00 ld r5,0\(r3\) + 10000130: 4b ff ff ec b 1000011c <_start\+0x34> + 10000134: 60 00 00 00 nop + 10000138: 38 63 10 00 addi r3,r3,4096 + 1000013c: e8 a3 80 04 ld r5,-32764\(r3\) + 10000140: 38 62 80 28 addi r3,r2,-32728 + 10000144: 3f a0 10 01 lis r29,4097 + 10000148: 3b bd 01 68 addi r29,r29,360 + 1000014c: 48 00 00 09 bl 10000154 <\.__tls_get_addr> + 10000150: 60 00 00 00 nop + +0+10000154 <\.__tls_get_addr>: + 10000154: 4e 80 00 20 blr diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlsmark.s b/binutils-2.21/ld/testsuite/ld-powerpc/tlsmark.s new file mode 100644 index 0000000..dc42327 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlsmark.s @@ -0,0 +1,55 @@ + .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) + + + .section ".text.no","ax",@progbits + .p2align 2 + addi 3,2,gd@got@tlsgd + lis 29,__tls_get_addr@ha + addi 29,29,__tls_get_addr@l + bl __tls_get_addr + nop diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlsmark32.d b/binutils-2.21/ld/testsuite/ld-powerpc/tlsmark32.d new file mode 100644 index 0000000..74b74e3 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlsmark32.d @@ -0,0 +1,29 @@ +#source: tlsmark32.s +#source: tlslib32.s +#as: -a32 +#ld: -melf32ppc +#objdump: -dr +#target: powerpc*-*-* + +.*: file format elf32-powerpc + +Disassembly of section \.text: + +0+1800094 <_start>: + 1800094: 48 00 00 14 b 18000a8 <_start\+0x14> + 1800098: 38 63 90 00 addi r3,r3,-28672 + 180009c: 80 83 00 00 lwz r4,0\(r3\) + 18000a0: 3c 62 00 00 addis r3,r2,0 + 18000a4: 48 00 00 0c b 18000b0 <_start\+0x1c> + 18000a8: 3c 62 00 00 addis r3,r2,0 + 18000ac: 4b ff ff ec b 1800098 <_start\+0x4> + 18000b0: 38 63 10 00 addi r3,r3,4096 + 18000b4: 80 83 80 00 lwz r4,-32768\(r3\) + 18000b8: 38 7f ff f4 addi r3,r31,-12 + 18000bc: 3f a0 01 80 lis r29,384 + 18000c0: 3b bd 00 c8 addi r29,r29,200 + 18000c4: 48 00 00 05 bl 18000c8 <__tls_get_addr> + +0+18000c8 <__tls_get_addr>: + 18000c8: 4e 80 00 20 blr +#pass
\ No newline at end of file diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlsmark32.s b/binutils-2.21/ld/testsuite/ld-powerpc/tlsmark32.s new file mode 100644 index 0000000..2fa48ae --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlsmark32.s @@ -0,0 +1,27 @@ + .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) + + + .section ".text.no","ax",@progbits + .p2align 2 + addi 3,31,gd@got@tlsgd + lis 29,__tls_get_addr@ha + addi 29,29,__tls_get_addr@l + bl __tls_get_addr diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlsso.d b/binutils-2.21/ld/testsuite/ld-powerpc/tlsso.d new file mode 100644 index 0000000..4a3b045 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlsso.d @@ -0,0 +1,76 @@ +#source: tls.s +#as: -a64 +#ld: -shared -melf64ppc +#objdump: -dr +#target: powerpc64*-*-* + +.*: +file format elf64-powerpc + +Disassembly of section \.text: + +.* <00000010\.plt_call\.__tls_get_addr(|_opt)\+0>: +.* f8 41 00 28 std r2,40\(r1\) +.* e9 62 80 78 ld r11,-32648\(r2\) +.* 7d 69 03 a6 mtctr r11 +.* e9 62 80 88 ld r11,-32632\(r2\) +.* e8 42 80 80 ld r2,-32640\(r2\) +.* 4e 80 04 20 bctr + +.* <_start>: +.* 38 62 80 20 addi r3,r2,-32736 +.* 4b ff ff e5 bl .* +.* e8 41 00 28 ld r2,40\(r1\) +.* 38 62 80 50 addi r3,r2,-32688 +.* 4b ff ff d9 bl .* +.* e8 41 00 28 ld r2,40\(r1\) +.* 38 62 80 38 addi r3,r2,-32712 +.* 4b ff ff cd bl .* +.* e8 41 00 28 ld r2,40\(r1\) +.* 38 62 80 50 addi r3,r2,-32688 +.* 4b ff ff c1 bl .* +.* e8 41 00 28 ld r2,40\(r1\) +.* 39 23 80 40 addi r9,r3,-32704 +.* 3d 23 00 00 addis r9,r3,0 +.* 81 49 80 48 lwz r10,-32696\(r9\) +.* e9 22 80 30 ld r9,-32720\(r2\) +.* 7d 49 18 2a ldx r10,r9,r3 +.* e9 22 80 48 ld r9,-32696\(r2\) +.* 7d 49 6a 2e lhzx r10,r9,r13 +.* 89 4d 00 00 lbz r10,0\(r13\) +.* 3d 2d 00 00 addis r9,r13,0 +.* 99 49 00 00 stb r10,0\(r9\) +.* 38 62 80 08 addi r3,r2,-32760 +.* 4b ff ff 8d bl .* +.* e8 41 00 28 ld r2,40\(r1\) +.* 38 62 80 50 addi r3,r2,-32688 +.* 4b ff ff 81 bl .* +.* e8 41 00 28 ld r2,40\(r1\) +.* f9 43 80 08 std r10,-32760\(r3\) +.* 3d 23 00 00 addis r9,r3,0 +.* 91 49 80 10 stw r10,-32752\(r9\) +.* e9 22 80 18 ld r9,-32744\(r2\) +.* 7d 49 19 2a stdx r10,r9,r3 +.* e9 22 80 48 ld r9,-32696\(r2\) +.* 7d 49 6b 2e sthx r10,r9,r13 +.* e9 4d 00 02 lwa r10,0\(r13\) +.* 3d 2d 00 00 addis r9,r13,0 +.* a9 49 00 00 lha r10,0\(r9\) +.* 00 00 00 00 .* +.* 00 01 02 20 .* +.* <__glink_PLTresolve>: +.* 7d 88 02 a6 mflr r12 +.* 42 9f 00 05 bcl- 20,4\*cr7\+so,.* +.* 7d 68 02 a6 mflr r11 +.* e8 4b ff f0 ld r2,-16\(r11\) +.* 7d 88 03 a6 mtlr r12 +.* 7d 82 5a 14 add r12,r2,r11 +.* e9 6c 00 00 ld r11,0\(r12\) +.* e8 4c 00 08 ld r2,8\(r12\) +.* 7d 69 03 a6 mtctr r11 +.* e9 6c 00 10 ld r11,16\(r12\) +.* 4e 80 04 20 bctr +.* 60 00 00 00 nop +.* 60 00 00 00 nop +.* 60 00 00 00 nop +.* 38 00 00 00 li r0,0 +.* 4b ff ff c4 b .* diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlsso.g b/binutils-2.21/ld/testsuite/ld-powerpc/tlsso.g new file mode 100644 index 0000000..330cb18 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlsso.g @@ -0,0 +1,15 @@ +#source: tls.s +#as: -a64 +#ld: -shared -melf64ppc +#objdump: -sj.got +#target: powerpc64*-*-* + +.*: +file format elf64-powerpc + +Contents of section \.got: +.* 00000000 00018778 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.21/ld/testsuite/ld-powerpc/tlsso.r b/binutils-2.21/ld/testsuite/ld-powerpc/tlsso.r new file mode 100644 index 0000000..99c3659 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlsso.r @@ -0,0 +1,129 @@ +#source: tls.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]+\] \.branch_lt .* + +\[[ 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 (\.branch_lt |)\.got \.plt + +02 +\.dynamic + +03 +\.tdata \.tbss + +Relocation section '\.rela\.dyn' at offset .* contains 16 entries: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend +[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+105f0 \.tdata \+ 28 +[0-9a-f ]+R_PPC64_TPREL16_HA +0+105f0 \.tdata \+ 30 +[0-9a-f ]+R_PPC64_TPREL16_LO +0+105f0 \.tdata \+ 30 +[0-9a-f ]+R_PPC64_DTPMOD64 +0+ +[0-9a-f ]+R_PPC64_DTPREL64 +0+ +[0-9a-f ]+R_PPC64_DTPREL64 +0+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 +.* NOTYPE +GLOBAL +DEFAULT +6 _start +.* TLS +GLOBAL +DEFAULT +8 ld2 +.* TLS +GLOBAL +DEFAULT +8 ld1 +.* NOTYPE +GLOBAL +DEFAULT +ABS __bss_start +.* NOTYPE +GLOBAL +DEFAULT +ABS _edata +.* NOTYPE +GLOBAL +DEFAULT +ABS _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 +.* 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 +.* OBJECT +LOCAL +DEFAULT +ABS _DYNAMIC +.* NOTYPE +LOCAL +DEFAULT +6 00000010\.plt_call\.__tls_get_addr\+0 +.* NOTYPE +LOCAL +DEFAULT +6 __glink_PLTresolve +.* NOTYPE +LOCAL +DEFAULT +UND \.__tls_get_addr +.* 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 +.* TLS +GLOBAL +DEFAULT +8 ld2 +.* TLS +GLOBAL +DEFAULT +8 ld1 +.* NOTYPE +GLOBAL +DEFAULT +ABS __bss_start +.* NOTYPE +GLOBAL +DEFAULT +ABS _edata +.* NOTYPE +GLOBAL +DEFAULT +ABS _end +.* TLS +GLOBAL +DEFAULT +8 gd0 +.* TLS +GLOBAL +DEFAULT +8 ie0 diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlsso.t b/binutils-2.21/ld/testsuite/ld-powerpc/tlsso.t new file mode 100644 index 0000000..63f92f6 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlsso.t @@ -0,0 +1,13 @@ +#source: tls.s +#as: -a64 +#ld: -shared -melf64ppc +#objdump: -sj.tdata +#target: powerpc64*-*-* + +.*: +file format elf64-powerpc + +Contents of section \.tdata: +.* 12345678 9abcdef0 23456789 abcdef01 .* +.* 3456789a bcdef012 456789ab cdef0123 .* +.* 56789abc def01234 6789abcd ef012345 .* +.* 789abcde f0123456 .* diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlsso32.d b/binutils-2.21/ld/testsuite/ld-powerpc/tlsso32.d new file mode 100644 index 0000000..b4e45d8 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlsso32.d @@ -0,0 +1,46 @@ +#source: tls32.s +#as: -a32 +#ld: -shared -melf32ppc +#objdump: -dr +#target: powerpc*-*-* + +.*: +file format elf32-powerpc + +Disassembly of section \.text: + +.* <_start>: +.*: 38 7f ff e0 addi r3,r31,-32 +.*: 48 00 00 01 bl .* +.*: 38 7f ff f4 addi r3,r31,-12 +.*: 48 00 00 01 bl .* +.*: 38 7f ff e8 addi r3,r31,-24 +.*: 48 01 01 95 bl .*<__tls_get_addr@plt> +.*: 38 7f ff f4 addi r3,r31,-12 +.*: 48 01 01 8d bl .*<__tls_get_addr@plt> +.*: 39 23 80 20 addi r9,r3,-32736 +.*: 3d 23 00 00 addis r9,r3,0 +.*: 81 49 80 24 lwz r10,-32732\(r9\) +.*: 81 3f ff f0 lwz r9,-16\(r31\) +.*: 7d 49 12 2e lhzx r10,r9,r2 +.*: 89 42 00 00 lbz r10,0\(r2\) +.*: 3d 22 00 00 addis r9,r2,0 +.*: 99 49 00 00 stb r10,0\(r9\) +.*: 38 7e ff d8 addi r3,r30,-40 +.*: 48 00 00 01 bl .* +.*: 38 7e ff f4 addi r3,r30,-12 +.*: 48 00 00 01 bl .* +.*: 91 43 80 04 stw r10,-32764\(r3\) +.*: 3d 23 00 00 addis r9,r3,0 +.*: 91 49 80 08 stw r10,-32760\(r9\) +.*: 81 3e ff f0 lwz r9,-16\(r30\) +.*: 7d 49 13 2e sthx r10,r9,r2 +.*: a1 42 00 00 lhz r10,0\(r2\) +.*: 3d 22 00 00 addis r9,r2,0 +.*: a9 49 00 00 lha r10,0\(r9\) +Disassembly of section \.got: + +.* <\.got>: + \.\.\. +.*: 4e 80 00 21 blrl +.*: 00 01 03 ec .* + \.\.\. diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlsso32.g b/binutils-2.21/ld/testsuite/ld-powerpc/tlsso32.g new file mode 100644 index 0000000..028e869 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlsso32.g @@ -0,0 +1,13 @@ +#source: tls32.s +#as: -a32 +#ld: -shared -melf32ppc +#objdump: -sj.got +#target: powerpc*-*-* + +.*: +file format elf32-powerpc + +Contents of section \.got: +.* 00000000 00000000 00000000 00000000 .* +.* 00000000 00000000 00000000 00000000 .* +.* 00000000 4e800021 000103ec 00000000 .* +.* 00000000 .* diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlsso32.r b/binutils-2.21/ld/testsuite/ld-powerpc/tlsso32.r new file mode 100644 index 0000000..e075db2 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlsso32.r @@ -0,0 +1,129 @@ +#source: tls32.s +#as: -a32 +#ld: -shared -melf32ppc +#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 +ABS __end +.* TLS +GLOBAL +DEFAULT +8 ld2 +.* TLS +GLOBAL +DEFAULT +8 ld1 +.* NOTYPE +GLOBAL +DEFAULT +ABS __bss_start +.* NOTYPE +GLOBAL +DEFAULT +ABS _edata +.* NOTYPE +GLOBAL +DEFAULT +ABS _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 +.* 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 +.* OBJECT +LOCAL +DEFAULT +ABS _DYNAMIC +.* OBJECT +LOCAL +DEFAULT +ABS _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 +ABS __end +.* TLS +GLOBAL +DEFAULT +8 ld2 +.* TLS +GLOBAL +DEFAULT +8 ld1 +.* NOTYPE +GLOBAL +DEFAULT +ABS __bss_start +.* NOTYPE +GLOBAL +DEFAULT +ABS _edata +.* NOTYPE +GLOBAL +DEFAULT +ABS _end +.* TLS +GLOBAL +DEFAULT +8 gd0 +.* TLS +GLOBAL +DEFAULT +8 ie0 diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlsso32.t b/binutils-2.21/ld/testsuite/ld-powerpc/tlsso32.t new file mode 100644 index 0000000..4190a9a --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlsso32.t @@ -0,0 +1,11 @@ +#source: tls32.s +#as: -a32 +#ld: -shared -melf32ppc +#objdump: -sj.tdata +#target: powerpc*-*-* + +.*: +file format elf32-powerpc + +Contents of section \.tdata: +.* 12345678 23456789 3456789a 456789ab .* +.* 56789abc 6789abcd 789abcde .* diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlstoc.d b/binutils-2.21/ld/testsuite/ld-powerpc/tlstoc.d new file mode 100644 index 0000000..cfa8aba --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlstoc.d @@ -0,0 +1,37 @@ +#source: tlslib.s +#source: tlstoc.s +#as: -a64 +#ld: -melf64ppc +#objdump: -dr +#target: powerpc64*-*-* + +.*: +file format elf64-powerpc + +Disassembly of section \.text: + +.* <\.__tls_get_addr>: +.* 4e 80 00 20 blr + +.* <_start>: +.* 3c 6d 00 00 addis r3,r13,0 +.* 60 00 00 00 nop +.* 38 63 90 40 addi r3,r3,-28608 +.* 3c 6d 00 00 addis r3,r13,0 +.* 60 00 00 00 nop +.* 38 63 10 00 addi r3,r3,4096 +.* 3c 6d 00 00 addis r3,r13,0 +.* 60 00 00 00 nop +.* 38 63 90 48 addi r3,r3,-28600 +.* 3c 6d 00 00 addis r3,r13,0 +.* 60 00 00 00 nop +.* 38 63 10 00 addi r3,r3,4096 +.* 39 23 80 50 addi r9,r3,-32688 +.* 3d 23 00 00 addis r9,r3,0 +.* 81 49 80 58 lwz r10,-32680\(r9\) +.* e9 22 80 40 ld r9,-32704\(r2\) +.* 7d 49 18 2a ldx r10,r9,r3 +.* 3d 2d 00 00 addis r9,r13,0 +.* a1 49 90 68 lhz r10,-28568\(r9\) +.* 89 4d 90 70 lbz r10,-28560\(r13\) +.* 3d 2d 00 00 addis r9,r13,0 +.* 99 49 90 78 stb r10,-28552\(r9\) diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlstoc.g b/binutils-2.21/ld/testsuite/ld-powerpc/tlstoc.g new file mode 100644 index 0000000..9ae4100 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlstoc.g @@ -0,0 +1,15 @@ +#source: tlslib.s +#source: tlstoc.s +#as: -a64 +#ld: -melf64ppc +#objdump: -sj.got +#target: powerpc64*-*-* + +.*: +file format elf64-powerpc + +Contents of section \.got: + 100101a0 00000000 00000001 00000000 00000000 .* + 100101b0 00000000 00000001 00000000 00000000 .* + 100101c0 00000000 00000001 00000000 00000000 .* + 100101d0 00000000 00000001 00000000 00000000 .* + 100101e0 ffffffff ffff8060 00000000 00000000 .* diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlstoc.s b/binutils-2.21/ld/testsuite/ld-powerpc/tlstoc.s new file mode 100644 index 0000000..5008d89 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlstoc.s @@ -0,0 +1,88 @@ + .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 + + .text +_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.21/ld/testsuite/ld-powerpc/tlstoc.t b/binutils-2.21/ld/testsuite/ld-powerpc/tlstoc.t new file mode 100644 index 0000000..5a8129a --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlstoc.t @@ -0,0 +1,14 @@ +#source: tlslib.s +#source: tlstoc.s +#as: -a64 +#ld: -melf64ppc +#objdump: -sj.tdata +#target: powerpc64*-*-* + +.*: +file format elf64-powerpc + +Contents of section \.tdata: + 10010148 00c0ffee 00000000 12345678 9abcdef0 .* + 10010158 23456789 abcdef01 3456789a bcdef012 .* + 10010168 456789ab cdef0123 56789abc def01234 .* + 10010178 6789abcd ef012345 789abcde f0123456 .* diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlstocso.d b/binutils-2.21/ld/testsuite/ld-powerpc/tlstocso.d new file mode 100644 index 0000000..0b84311 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlstocso.d @@ -0,0 +1,60 @@ +#source: tlstoc.s +#as: -a64 +#ld: -shared -melf64ppc +#objdump: -dr +#target: powerpc64*-*-* + +.*: +file format elf64-powerpc + +Disassembly of section \.text: + +.* <00000010\.plt_call\.__tls_get_addr(|_opt)\+0>: +.* f8 41 00 28 std r2,40\(r1\) +.* e9 62 80 70 ld r11,-32656\(r2\) +.* 7d 69 03 a6 mtctr r11 +.* e9 62 80 80 ld r11,-32640\(r2\) +.* e8 42 80 78 ld r2,-32648\(r2\) +.* 4e 80 04 20 bctr + +.* <_start>: +.* 38 62 80 08 addi r3,r2,-32760 +.* 4b ff ff e5 bl .* +.* e8 41 00 28 ld r2,40\(r1\) +.* 38 62 80 18 addi r3,r2,-32744 +.* 4b ff ff d9 bl .* +.* e8 41 00 28 ld r2,40\(r1\) +.* 38 62 80 28 addi r3,r2,-32728 +.* 4b ff ff cd bl .* +.* e8 41 00 28 ld r2,40\(r1\) +.* 38 62 80 38 addi r3,r2,-32712 +.* 4b ff ff c1 bl .* +.* e8 41 00 28 ld r2,40\(r1\) +.* 39 23 80 40 addi r9,r3,-32704 +.* 3d 23 00 00 addis r9,r3,0 +.* 81 49 80 48 lwz r10,-32696\(r9\) +.* e9 22 80 48 ld r9,-32696\(r2\) +.* 7d 49 18 2a ldx r10,r9,r3 +.* e9 22 80 50 ld r9,-32688\(r2\) +.* 7d 49 6a 2e lhzx r10,r9,r13 +.* 89 4d 00 00 lbz r10,0\(r13\) +.* 3d 2d 00 00 addis r9,r13,0 +.* 99 49 00 00 stb r10,0\(r9\) +.* 00 00 00 00 .* +.* 00 01 02 18 .* +.* <__glink_PLTresolve>: +.* 7d 88 02 a6 mflr r12 +.* 42 9f 00 05 bcl- 20,4\*cr7\+so,.* +.* 7d 68 02 a6 mflr r11 +.* e8 4b ff f0 ld r2,-16\(r11\) +.* 7d 88 03 a6 mtlr r12 +.* 7d 82 5a 14 add r12,r2,r11 +.* e9 6c 00 00 ld r11,0\(r12\) +.* e8 4c 00 08 ld r2,8\(r12\) +.* 7d 69 03 a6 mtctr r11 +.* e9 6c 00 10 ld r11,16\(r12\) +.* 4e 80 04 20 bctr +.* 60 00 00 00 nop +.* 60 00 00 00 nop +.* 60 00 00 00 nop +.* 38 00 00 00 li r0,0 +.* 4b ff ff c4 b .* diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlstocso.g b/binutils-2.21/ld/testsuite/ld-powerpc/tlstocso.g new file mode 100644 index 0000000..d670a21 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlstocso.g @@ -0,0 +1,15 @@ +#source: tlstoc.s +#as: -a64 +#ld: -shared -melf64ppc +#objdump: -sj.got +#target: powerpc64*-*-* + +.*: +file format elf64-powerpc + +Contents of section \.got: +.* 00000000 000186c0 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.21/ld/testsuite/ld-powerpc/tlstocso.r b/binutils-2.21/ld/testsuite/ld-powerpc/tlstocso.r new file mode 100644 index 0000000..d04cf70 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlstocso.r @@ -0,0 +1,125 @@ +#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]+\] \.branch_lt .* + +\[[ 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 (\.branch_lt |)\.got \.plt + +02 +\.dynamic + +03 +\.tdata \.tbss + +Relocation section '\.rela\.dyn' at offset .* contains 11 entries: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend +[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 +.* NOTYPE +GLOBAL +DEFAULT +6 _start +.* TLS +GLOBAL +DEFAULT +8 ld2 +.* TLS +GLOBAL +DEFAULT +8 ld1 +.* NOTYPE +GLOBAL +DEFAULT +ABS __bss_start +.* NOTYPE +GLOBAL +DEFAULT +ABS _edata +.* NOTYPE +GLOBAL +DEFAULT +ABS _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 +.* 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 +.* OBJECT +LOCAL +DEFAULT +ABS _DYNAMIC +.* NOTYPE +LOCAL +DEFAULT +6 00000010\.plt_call\.__tls_get_addr\+0 +.* NOTYPE +LOCAL +DEFAULT +6 __glink_PLTresolve +.* NOTYPE +LOCAL +DEFAULT +UND \.__tls_get_addr +.* 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 +.* TLS +GLOBAL +DEFAULT +8 ld2 +.* TLS +GLOBAL +DEFAULT +8 ld1 +.* NOTYPE +GLOBAL +DEFAULT +ABS __bss_start +.* NOTYPE +GLOBAL +DEFAULT +ABS _edata +.* NOTYPE +GLOBAL +DEFAULT +ABS _end +.* TLS +GLOBAL +DEFAULT +8 gd0 +.* TLS +GLOBAL +DEFAULT +8 ie0 diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tlstocso.t b/binutils-2.21/ld/testsuite/ld-powerpc/tlstocso.t new file mode 100644 index 0000000..fe9def4 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tlstocso.t @@ -0,0 +1,13 @@ +#source: tlstoc.s +#as: -a64 +#ld: -shared -melf64ppc +#objdump: -sj.tdata +#target: powerpc64*-*-* + +.*: +file format elf64-powerpc + +Contents of section \.tdata: +.* 12345678 9abcdef0 23456789 abcdef01 .* +.* 3456789a bcdef012 456789ab cdef0123 .* +.* 56789abc def01234 6789abcd ef012345 .* +.* 789abcde f0123456 .* diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tocopt.d b/binutils-2.21/ld/testsuite/ld-powerpc/tocopt.d new file mode 100644 index 0000000..9168661 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/tocopt.d @@ -0,0 +1,14 @@ + +.*: file format .* + +Contents of section \.text: + 100000b0 60000000 e9228018 60000000 38a28020 .* + 100000c0 e8c50000 60000000 3ba08028 7c62e82a .* + 100000d0 60000000 39228033 60000000 38a28008 .* + 100000e0 e8c50000 60000000 3ba08010 7c62e82a .* +Contents of section \.got: + 100100f0 00000000 100180f0 00000000 10010124 .* + 10010100 00000000 10010125 00000000 10010120 .* + 10010110 00000000 10010121 00000000 10010122 .* +Contents of section \.sdata: + 10010120 01020304 0506 .* diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/tocopt.s b/binutils-2.21/ld/testsuite/ld-powerpc/tocopt.s new file mode 100644 index 0000000..a2447ca --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/vxworks-relax-2.rd b/binutils-2.21/ld/testsuite/ld-powerpc/vxworks-relax-2.rd new file mode 100644 index 0000000..02eb964 --- /dev/null +++ b/binutils-2.21/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 +00000016 00000106 R_PPC_ADDR16_HA 00000000 .text \+ 4000034 +0000001a 00000104 R_PPC_ADDR16_LO 00000000 .text \+ 4000034 +00000006 00000106 R_PPC_ADDR16_HA 00000000 .text \+ 4000034 +0000000a 00000104 R_PPC_ADDR16_LO 00000000 .text \+ 4000034 +00000026 00000506 R_PPC_ADDR16_HA 00000000 undefined \+ 0 +0000002a 00000504 R_PPC_ADDR16_LO 00000000 undefined \+ 0 +0400003e 00000606 R_PPC_ADDR16_HA 00000000 _start \+ 0 +04000042 00000604 R_PPC_ADDR16_LO 00000000 _start \+ 0 diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/vxworks-relax-2.s b/binutils-2.21/ld/testsuite/ld-powerpc/vxworks-relax-2.s new file mode 100644 index 0000000..bfb87aa --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/vxworks-relax.rd b/binutils-2.21/ld/testsuite/ld-powerpc/vxworks-relax.rd new file mode 100644 index 0000000..e28094c --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/vxworks-relax.rd @@ -0,0 +1,9 @@ + +Relocation section '.rela.text' at offset 0x4010150 contains 6 entries: + Offset Info Type Sym.Value Sym. Name \+ Addend +00080012 00000106 R_PPC_ADDR16_HA 00080000 .text \+ 4000020 +00080016 00000104 R_PPC_ADDR16_LO 00080000 .text \+ 4000020 +00080006 00000106 R_PPC_ADDR16_HA 00080000 .text \+ 4000020 +0008000a 00000104 R_PPC_ADDR16_LO 00080000 .text \+ 4000020 +0408002a 00000306 R_PPC_ADDR16_HA 00080000 _start \+ 0 +0408002e 00000304 R_PPC_ADDR16_LO 00080000 _start \+ 0 diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/vxworks-relax.s b/binutils-2.21/ld/testsuite/ld-powerpc/vxworks-relax.s new file mode 100644 index 0000000..60ec418 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/vxworks1-lib.dd b/binutils-2.21/ld/testsuite/ld-powerpc/vxworks1-lib.dd new file mode 100644 index 0000000..1c1861e --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/vxworks1-lib.nd b/binutils-2.21/ld/testsuite/ld-powerpc/vxworks1-lib.nd new file mode 100644 index 0000000..7531ec7 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/vxworks1-lib.rd b/binutils-2.21/ld/testsuite/ld-powerpc/vxworks1-lib.rd new file mode 100644 index 0000000..40a5d55 --- /dev/null +++ b/binutils-2.21/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 * 00080c44 +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.21/ld/testsuite/ld-powerpc/vxworks1-lib.s b/binutils-2.21/ld/testsuite/ld-powerpc/vxworks1-lib.s new file mode 100644 index 0000000..9dfcb0f --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/vxworks1-lib.sd b/binutils-2.21/ld/testsuite/ld-powerpc/vxworks1-lib.sd new file mode 100644 index 0000000..1d2ed5c --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/vxworks1-lib.td b/binutils-2.21/ld/testsuite/ld-powerpc/vxworks1-lib.td new file mode 100644 index 0000000..9f223e3 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/vxworks1-lib.td @@ -0,0 +1,3 @@ +#... + 0x0+16 \(TEXTREL\) +0x0 +#pass diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/vxworks1-static.d b/binutils-2.21/ld/testsuite/ld-powerpc/vxworks1-static.d new file mode 100644 index 0000000..4c2d1fd --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/vxworks1.dd b/binutils-2.21/ld/testsuite/ld-powerpc/vxworks1.dd new file mode 100644 index 0000000..09e5a6a --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/vxworks1.ld b/binutils-2.21/ld/testsuite/ld-powerpc/vxworks1.ld new file mode 100644 index 0000000..3106d55 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/vxworks1.rd b/binutils-2.21/ld/testsuite/ld-powerpc/vxworks1.rd new file mode 100644 index 0000000..b8591a8 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/vxworks1.s b/binutils-2.21/ld/testsuite/ld-powerpc/vxworks1.s new file mode 100644 index 0000000..cd54d57 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/vxworks2-static.sd b/binutils-2.21/ld/testsuite/ld-powerpc/vxworks2-static.sd new file mode 100644 index 0000000..55fc529 --- /dev/null +++ b/binutils-2.21/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.21/ld/testsuite/ld-powerpc/vxworks2.s b/binutils-2.21/ld/testsuite/ld-powerpc/vxworks2.s new file mode 100644 index 0000000..5e8d73a --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-powerpc/vxworks2.s @@ -0,0 +1,5 @@ + .globl _start + .type _start,@function +_start: + blr + .end _start diff --git a/binutils-2.21/ld/testsuite/ld-powerpc/vxworks2.sd b/binutils-2.21/ld/testsuite/ld-powerpc/vxworks2.sd new file mode 100644 index 0000000..0876568 --- /dev/null +++ b/binutils-2.21/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 .* + +#... |