diff options
author | Andrew Hsieh <andrewhsieh@google.com> | 2014-06-13 12:38:00 -0700 |
---|---|---|
committer | Andrew Hsieh <andrewhsieh@google.com> | 2014-06-13 12:38:00 -0700 |
commit | 54f1b3cf509cd889905287cb8ce6c5ae33911a21 (patch) | |
tree | e39b1a7fa04db86a8215b7f9d4656d74e394aec0 /binutils-2.25/ld/testsuite/ld-vax-elf | |
parent | 2a6558a8ecfb81d75215b4ec7dc61113e12cfd5f (diff) | |
download | toolchain_binutils-54f1b3cf509cd889905287cb8ce6c5ae33911a21.tar.gz toolchain_binutils-54f1b3cf509cd889905287cb8ce6c5ae33911a21.tar.bz2 toolchain_binutils-54f1b3cf509cd889905287cb8ce6c5ae33911a21.zip |
Add upstream binutils-2.25 snapshot 4/4 2014
For MIPS -mmsa support
Change-Id: I08c4f002fa7b33dec85ed75956e6ab551bb03c96
Diffstat (limited to 'binutils-2.25/ld/testsuite/ld-vax-elf')
27 files changed, 683 insertions, 0 deletions
diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-call.dd b/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-call.dd new file mode 100644 index 00000000..c860d799 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-call.dd @@ -0,0 +1,26 @@ + +.*: +file format .*vax.* + +Disassembly of section \.text: + +12340000 <foo>: +12340000: 00 00 \.word 0x0000 # Entry mask: < > +12340002: fb 00 ef 0f calls \$0x0,12340018 <protected_foo> +12340006: 00 00 00 +12340009: fb 00 ef 0b calls \$0x0,1234001b <hidden_foo> +1234000d: 00 00 00 +12340010: fb 00 ef 07 calls \$0x0,1234001e <internal_foo> +12340014: 00 00 00 +12340017: 04 ret + +12340018 <protected_foo>: +12340018: 00 00 \.word 0x0000 # Entry mask: < > +1234001a: 04 ret + +1234001b <hidden_foo>: +1234001b: 00 00 \.word 0x0000 # Entry mask: < > +1234001d: 04 ret + +1234001e <internal_foo>: +1234001e: 00 00 \.word 0x0000 # Entry mask: < > +12340020: 04 ret diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-call.rd b/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-call.rd new file mode 100644 index 00000000..b852c168 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-call.rd @@ -0,0 +1 @@ +There are no relocations in this file\. diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-call.s b/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-call.s new file mode 100644 index 00000000..14640450 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-call.s @@ -0,0 +1,10 @@ + .text + .globl foo + .type foo, @function +foo: + .word 0 + calls $0, protected_foo + calls $0, hidden_foo + calls $0, internal_foo + ret + .size foo, . - foo diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-call.xd b/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-call.xd new file mode 100644 index 00000000..1f4ee9d6 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-call.xd @@ -0,0 +1,2 @@ +Hex dump of section '\.got': + 0x12340024 34003412 00000000 00000000 00000000 .* diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-data.dd b/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-data.dd new file mode 100644 index 00000000..c2be30c3 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-data.dd @@ -0,0 +1,26 @@ + +.*: +file format .*vax.* + +Disassembly of section \.text: + +12340000 <foo>: +12340000: 00 00 \.word 0x0000 # Entry mask: < > +12340002: 9e ff 2c 00 movab \*12340034 <_GLOBAL_OFFSET_TABLE_\+0x10>,r0 +12340006: 00 00 50 +12340009: 9e ef 0c 00 movab 1234001b <hidden_foo>,r0 +1234000d: 00 00 50 +12340010: 9e ef 08 00 movab 1234001e <internal_foo>,r0 +12340014: 00 00 50 +12340017: 04 ret + +12340018 <protected_foo>: +12340018: 00 00 \.word 0x0000 # Entry mask: < > +1234001a: 04 ret + +1234001b <hidden_foo>: +1234001b: 00 00 \.word 0x0000 # Entry mask: < > +1234001d: 04 ret + +1234001e <internal_foo>: +1234001e: 00 00 \.word 0x0000 # Entry mask: < > +12340020: 04 ret diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-data.rd b/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-data.rd new file mode 100644 index 00000000..aaac804a --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-data.rd @@ -0,0 +1,3 @@ +Relocation section '\.rela\.got' at offset 0x[0-9a-f]+ contains 1 entries: + * Offset * Info * Type * Sym\. *Value * Sym\. * Name * \+ * Addend +12340034 [0-9a-f]+14 R_VAX_GLOB_DAT 12340018 protected_foo \+ 0 diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-data.s b/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-data.s new file mode 100644 index 00000000..fd7edf9b --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-data.s @@ -0,0 +1,10 @@ + .text + .globl foo + .type foo, @function +foo: + .word 0 + movab protected_foo, %r0 + movab hidden_foo, %r0 + movab internal_foo, %r0 + ret + .size foo, . - foo diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-data.xd b/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-data.xd new file mode 100644 index 00000000..f5d3c1b7 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-data.xd @@ -0,0 +1,4 @@ +Hex dump of section '\.got': + NOTE: This section has relocations against it, but these have NOT been applied to this dump\. + 0x12340024 38003412 00000000 00000000 00000000 .* + 0x12340034 00000000 .* diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-def.s b/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-def.s new file mode 100644 index 00000000..a548dbfa --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/export-class-def.s @@ -0,0 +1,22 @@ + .text + .globl protected_foo + .type protected_foo, @function + .protected protected_foo +protected_foo: + .word 0 + ret + .size protected_foo, . - protected_foo + .globl hidden_foo + .type hidden_foo, @function + .hidden hidden_foo +hidden_foo: + .word 0 + ret + .size hidden_foo, . - hidden_foo + .globl internal_foo + .type internal_foo, @function + .internal internal_foo +internal_foo: + .word 0 + ret + .size internal_foo, . - internal_foo diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/export-class.exp b/binutils-2.25/ld/testsuite/ld-vax-elf/export-class.exp new file mode 100644 index 00000000..83df7701 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/export-class.exp @@ -0,0 +1,80 @@ +# Expect script for symbol export classes, VAX variation. +# +# Copyright 2013 Free Software Foundation, Inc. +# +# This file is part of the GNU Binutils. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +# MA 02110-1301, USA. +# + +# +# Written by Maciej W. Rozycki <macro@codesourcery.com> +# + +# Exclude non-Linux targets; feel free to include your favorite one +# if you like. +if { ![istarget vax*-*-linux*] } { + return +} + +set testname "VAX symbol export class test" + +# Build an auxiliary shared object with conflicting versioned symbol +# definitions. +run_ld_link_tests [list \ + [list \ + "$testname (auxiliary shared object)" \ + "-shared -version-script ../ld-elf/export-class-lib.ver" "" \ + "-k" \ + { ../ld-elf/export-class-lib.s } \ + {} \ + "vax-export-class-lib.so" \ + ] \ +] + +# Build a static object that pulls symbol definitions. It has to come +# first before the auxiliary shared object and other static objects on +# the linker's command line and hence we need to build it separately. +run_ld_link_tests [list \ + [list \ + "$testname (initial static object)" \ + "-r" "" \ + "" \ + { ../ld-elf/export-class-ref.s } \ + {} \ + "vax-export-class-ref-r.o" \ + ] \ +] + +# Build static objects that satisfy symbol dependencies and preempt +# shared-object symbol definitions, and link all the objects built into +# the final shared object. The command-line order of objects linked is +# important to make sure the linker correctly preempts versioned symbols +# from the auxiliary shared object and is as follows: ref, lib, dep, def. +# Get a dump to make sure symbol dependencies are resolved internally. +run_ld_link_tests [list \ + [list \ + "$testname (final shared object)" \ + "-shared -Tdata=0x12340000 tmpdir/vax-export-class-ref-r.o tmpdir/vax-export-class-lib.so" "" \ + "-k" \ + { ../ld-elf/export-class-dep.s ../ld-elf/export-class-def.s } \ + [list \ + [list readelf -r vax-export-class.rd] \ + [list readelf "-x .data" vax-export-class.xd] \ + ] \ + "vax-export-class.so" \ + ] \ +] diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/export-class.ld b/binutils-2.25/ld/testsuite/ld-vax-elf/export-class.ld new file mode 100644 index 00000000..054d044d --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/export-class.ld @@ -0,0 +1,16 @@ +ENTRY (foo); +SECTIONS +{ + .text : { *(.text) } + .got : { *(.got.plt) *(.got) } + .dynamic : { *(.dynamic) } + .rela.got : { *(.rela.got) } + .plt : { *(.plt) } + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .shstrtab : { *(.shstrtab) } + .symtab : { *(.symtab) } + .strtab : { *(.strtab) } + /DISCARD/ : { *(*) } +} diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/got-local-aux.s b/binutils-2.25/ld/testsuite/ld-vax-elf/got-local-aux.s new file mode 100644 index 00000000..275e6fa5 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/got-local-aux.s @@ -0,0 +1,5 @@ + .globl baz + .type baz, @object +baz: + .byte 0 + .size baz, . - baz diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/got-local-def.s b/binutils-2.25/ld/testsuite/ld-vax-elf/got-local-def.s new file mode 100644 index 00000000..c30c7c5b --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/got-local-def.s @@ -0,0 +1,12 @@ + .data + .globl bar_hidden + .type bar_hidden, @object + .hidden bar_hidden +bar_hidden: + .byte 0 + .size bar_hidden, . - bar_hidden + .globl bar_visible + .type bar_visible, @object +bar_visible: + .byte 0 + .size bar_visible, . - bar_visible diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/got-local-exe.xd b/binutils-2.25/ld/testsuite/ld-vax-elf/got-local-exe.xd new file mode 100644 index 00000000..ace48f47 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/got-local-exe.xd @@ -0,0 +1,4 @@ +# Make sure there's only one GOT entry, for the symbol defined externally. +Hex dump of section '\.got': + 0x[0-9a-f]+ ........ 00000000 00000000 00000000 .* + 0x[0-9a-f]+ 00000000 .* diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/got-local-lib.xd b/binutils-2.25/ld/testsuite/ld-vax-elf/got-local-lib.xd new file mode 100644 index 00000000..24edda95 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/got-local-lib.xd @@ -0,0 +1,4 @@ +# Make sure there are only two GOT entries, for the preemptible symbols. +Hex dump of section '\.got': + 0x[0-9a-f]+ ........ 00000000 00000000 00000000 .* + 0x[0-9a-f]+ 00000000 00000000 .* diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/got-local-ref.s b/binutils-2.25/ld/testsuite/ld-vax-elf/got-local-ref.s new file mode 100644 index 00000000..f9505311 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/got-local-ref.s @@ -0,0 +1,10 @@ + .text + .globl foo + .type foo, @function +foo: + .word 0 + movab bar_hidden, %r0 + movab bar_visible, %r1 + movab baz, %r2 + ret + .size foo, . - foo diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/plt-local-hidden-pic.s b/binutils-2.25/ld/testsuite/ld-vax-elf/plt-local-hidden-pic.s new file mode 100644 index 00000000..62f24531 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/plt-local-hidden-pic.s @@ -0,0 +1,14 @@ + .text + + .hidden foo_hidden + .globl foo_hidden + .type foo_hidden, @function +foo_hidden: + .word 0 + calls $0, foo_extern + calls $0, foo_global + calls $0, foo_local + calls $0, foo_hidden + calls $0, foo_rehidden + ret + .size foo_hidden, . - foo_hidden diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/plt-local-lib.dd b/binutils-2.25/ld/testsuite/ld-vax-elf/plt-local-lib.dd new file mode 100644 index 00000000..95e81769 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/plt-local-lib.dd @@ -0,0 +1,91 @@ +.*: +file format .*vax.* + +Disassembly of section \.plt: + +00001000 <foo_local@plt-0xc>: + 1000: dd ef 76 20 pushl 307c <_GLOBAL_OFFSET_TABLE_\+0x4> + 1004: 00 00 + 1006: 17 ff 74 20 jmp \*3080 <_GLOBAL_OFFSET_TABLE_\+0x8> + 100a: 00 00 + +0000100c <foo_local@plt>: + 100c: fc 0f \.word 0x0ffc # Entry mask: < r11 r10 r9 r8 r7 r6 r5 r4 r3 r2 > + 100e: 16 ef ec ff jsb 1000 <foo_local@plt-0xc> + 1012: ff ff + 1014: 00 00 00 00 \.long 0x00000000 + +00001018 <foo_extern@plt>: + 1018: fc 0f \.word 0x0ffc # Entry mask: < r11 r10 r9 r8 r7 r6 r5 r4 r3 r2 > + 101a: 16 ef e0 ff jsb 1000 <foo_local@plt-0xc> + 101e: ff ff + 1020: 0c 00 00 00 \.long 0x0000000c + +00001024 <foo_rehidden@plt>: + 1024: fc 0f \.word 0x0ffc # Entry mask: < r11 r10 r9 r8 r7 r6 r5 r4 r3 r2 > + 1026: 16 ef d4 ff jsb 1000 <foo_local@plt-0xc> + 102a: ff ff + 102c: 18 00 00 00 \.long 0x00000018 + +00001030 <foo_global@plt>: + 1030: fc 0f \.word 0x0ffc # Entry mask: < r11 r10 r9 r8 r7 r6 r5 r4 r3 r2 > + 1032: 16 ef c8 ff jsb 1000 <foo_local@plt-0xc> + 1036: ff ff + 1038: 24 00 00 00 \.long 0x00000024 + +Disassembly of section \.text: + +00002000 <foo_extern>: + 2000: 00 00 \.word 0x0000 # Entry mask: < > + 2002: fb 00 ff 7f calls \$0x0,\*3088 <_GLOBAL_OFFSET_TABLE_\+0x10> + 2006: 10 00 00 + 2009: fb 00 ff 80 calls \$0x0,\*3090 <_GLOBAL_OFFSET_TABLE_\+0x18> + 200d: 10 00 00 + 2010: fb 00 ff 6d calls \$0x0,\*3084 <_GLOBAL_OFFSET_TABLE_\+0xc> + 2014: 10 00 00 + 2017: fb 00 ef 2e calls \$0x0,204c <foo_hidden> + 201b: 00 00 00 + 201e: fb 00 ff 67 calls \$0x0,\*308c <_GLOBAL_OFFSET_TABLE_\+0x14> + 2022: 10 00 00 + 2025: 04 ret + +00002026 <foo_local>: + 2026: 00 00 \.word 0x0000 # Entry mask: < > + 2028: fb 00 ff 59 calls \$0x0,\*3088 <_GLOBAL_OFFSET_TABLE_\+0x10> + 202c: 10 00 00 + 202f: fb 00 ff 5a calls \$0x0,\*3090 <_GLOBAL_OFFSET_TABLE_\+0x18> + 2033: 10 00 00 + 2036: fb 00 ff 47 calls \$0x0,\*3084 <_GLOBAL_OFFSET_TABLE_\+0xc> + 203a: 10 00 00 + 203d: fb 00 ef 08 calls \$0x0,204c <foo_hidden> + 2041: 00 00 00 + 2044: fb 00 ff 41 calls \$0x0,\*308c <_GLOBAL_OFFSET_TABLE_\+0x14> + 2048: 10 00 00 + 204b: 04 ret + +0000204c <foo_hidden>: + 204c: 00 00 \.word 0x0000 # Entry mask: < > + 204e: fb 00 ff 33 calls \$0x0,\*3088 <_GLOBAL_OFFSET_TABLE_\+0x10> + 2052: 10 00 00 + 2055: fb 00 ff 34 calls \$0x0,\*3090 <_GLOBAL_OFFSET_TABLE_\+0x18> + 2059: 10 00 00 + 205c: fb 00 ff 21 calls \$0x0,\*3084 <_GLOBAL_OFFSET_TABLE_\+0xc> + 2060: 10 00 00 + 2063: fb 00 ef e2 calls \$0x0,204c <foo_hidden> + 2067: ff ff ff + 206a: fb 00 ff 1b calls \$0x0,\*308c <_GLOBAL_OFFSET_TABLE_\+0x14> + 206e: 10 00 00 + 2071: 04 ret + +00002072 <foo_rehidden>: + 2072: 00 00 \.word 0x0000 # Entry mask: < > + 2074: fb 00 ff 0d calls \$0x0,\*3088 <_GLOBAL_OFFSET_TABLE_\+0x10> + 2078: 10 00 00 + 207b: fb 00 ff 0e calls \$0x0,\*3090 <_GLOBAL_OFFSET_TABLE_\+0x18> + 207f: 10 00 00 + 2082: fb 00 ff fb calls \$0x0,\*3084 <_GLOBAL_OFFSET_TABLE_\+0xc> + 2086: 0f 00 00 + 2089: fb 00 ef bc calls \$0x0,204c <foo_hidden> + 208d: ff ff ff + 2090: fb 00 ff f5 calls \$0x0,\*308c <_GLOBAL_OFFSET_TABLE_\+0x14> + 2094: 0f 00 00 + 2097: 04 ret diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/plt-local-lib.ld b/binutils-2.25/ld/testsuite/ld-vax-elf/plt-local-lib.ld new file mode 100644 index 00000000..4a0b44c5 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/plt-local-lib.ld @@ -0,0 +1,18 @@ +SECTIONS +{ + . = 0; + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .rela.plt : { *(.rela.plt) } + + . = 0x1000; + .plt : { *(.plt) } + + . = 0x2000; + .text : { *(.text) } + + . = 0x3000; + .dynamic : { *(.dynamic) } + .got : { *(.got.plt) } +} diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/plt-local-lib.s b/binutils-2.25/ld/testsuite/ld-vax-elf/plt-local-lib.s new file mode 100644 index 00000000..b05dcdf7 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/plt-local-lib.s @@ -0,0 +1,50 @@ + .text + + .globl foo_extern + .type foo_extern, @function +foo_extern: + .word 0 + calls $0, foo_extern + calls $0, foo_global + calls $0, foo_local + calls $0, foo_hidden + calls $0, foo_rehidden + ret + .size foo_extern, . - foo_extern + + .globl foo_local + .type foo_local, @function +foo_local: + .word 0 + calls $0, foo_extern + calls $0, foo_global + calls $0, foo_local + calls $0, foo_hidden + calls $0, foo_rehidden + ret + .size foo_local, . - foo_local + + .hidden foo_hidden + .globl foo_hidden + .type foo_hidden, @function +foo_hidden: + .word 0 + calls $0, foo_extern + calls $0, foo_global + calls $0, foo_local + calls $0, foo_hidden + calls $0, foo_rehidden + ret + .size foo_hidden, . - foo_hidden + + .globl foo_rehidden + .type foo_rehidden, @function +foo_rehidden: + .word 0 + calls $0, foo_extern + calls $0, foo_global + calls $0, foo_local + calls $0, foo_hidden + calls $0, foo_rehidden + ret + .size foo_rehidden, . - foo_rehidden diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/plt-local-rehidden-pic.s b/binutils-2.25/ld/testsuite/ld-vax-elf/plt-local-rehidden-pic.s new file mode 100644 index 00000000..51b1e676 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/plt-local-rehidden-pic.s @@ -0,0 +1,14 @@ + .text + + .hidden foo_rehidden + .globl foo_rehidden + .type foo_rehidden, @function +foo_rehidden: + .word 0 + calls $0, foo_extern + calls $0, foo_global + calls $0, foo_local + calls $0, foo_hidden + calls $0, foo_rehidden + ret + .size foo_rehidden, . - foo_rehidden diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/plt-local.dd b/binutils-2.25/ld/testsuite/ld-vax-elf/plt-local.dd new file mode 100644 index 00000000..84eca55f --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/plt-local.dd @@ -0,0 +1,73 @@ +.*: +file format .*vax.* + +Disassembly of section \.plt: + +00001000 <foo_extern@plt-0xc>: + 1000: dd ef 86 20 pushl 308c <_GLOBAL_OFFSET_TABLE_\+0x4> + 1004: 00 00 + 1006: 17 ff 84 20 jmp \*3090 <_GLOBAL_OFFSET_TABLE_\+0x8> + 100a: 00 00 + +0000100c <foo_extern@plt>: + 100c: fc 0f \.word 0x0ffc # Entry mask: < r11 r10 r9 r8 r7 r6 r5 r4 r3 r2 > + 100e: 16 ef ec ff jsb 1000 <foo_extern@plt-0xc> + 1012: ff ff + 1014: 00 00 00 00 \.long 0x00000000 + +Disassembly of section \.text: + +00002000 <foo_hidden>: + 2000: 00 00 \.word 0x0000 # Entry mask: < > + 2002: fb 00 ff 8b calls \$0x0,\*3094 <_GLOBAL_OFFSET_TABLE_\+0xc> + 2006: 10 00 00 + 2009: fb 00 ef 3c calls \$0x0,204c <foo_global> + 200d: 00 00 00 + 2010: fb 00 ef 5b calls \$0x0,2072 <foo_local> + 2014: 00 00 00 + 2017: fb 00 ef e2 calls \$0x0,2000 <foo_hidden> + 201b: ff ff ff + 201e: fb 00 ef 01 calls \$0x0,2026 <foo_rehidden> + 2022: 00 00 00 + 2025: 04 ret + +00002026 <foo_rehidden>: + 2026: 00 00 \.word 0x0000 # Entry mask: < > + 2028: fb 00 ff 65 calls \$0x0,\*3094 <_GLOBAL_OFFSET_TABLE_\+0xc> + 202c: 10 00 00 + 202f: fb 00 ef 16 calls \$0x0,204c <foo_global> + 2033: 00 00 00 + 2036: fb 00 ef 35 calls \$0x0,2072 <foo_local> + 203a: 00 00 00 + 203d: fb 00 ef bc calls \$0x0,2000 <foo_hidden> + 2041: ff ff ff + 2044: fb 00 ef db calls \$0x0,2026 <foo_rehidden> + 2048: ff ff ff + 204b: 04 ret + +0000204c <foo_global>: + 204c: 00 00 \.word 0x0000 # Entry mask: < > + 204e: fb 00 ff 3f calls \$0x0,\*3094 <_GLOBAL_OFFSET_TABLE_\+0xc> + 2052: 10 00 00 + 2055: fb 00 ef f0 calls \$0x0,204c <foo_global> + 2059: ff ff ff + 205c: fb 00 ef 0f calls \$0x0,2072 <foo_local> + 2060: 00 00 00 + 2063: fb 00 ef 96 calls \$0x0,2000 <foo_hidden> + 2067: ff ff ff + 206a: fb 00 ef b5 calls \$0x0,2026 <foo_rehidden> + 206e: ff ff ff + 2071: 04 ret + +00002072 <foo_local>: + 2072: 00 00 \.word 0x0000 # Entry mask: < > + 2074: fb 00 ff 19 calls \$0x0,\*3094 <_GLOBAL_OFFSET_TABLE_\+0xc> + 2078: 10 00 00 + 207b: fb 00 ef ca calls \$0x0,204c <foo_global> + 207f: ff ff ff + 2082: fb 00 ef e9 calls \$0x0,2072 <foo_local> + 2086: ff ff ff + 2089: fb 00 ef 70 calls \$0x0,2000 <foo_hidden> + 208d: ff ff ff + 2090: fb 00 ef 8f calls \$0x0,2026 <foo_rehidden> + 2094: ff ff ff + 2097: 04 ret diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/plt-local.ld b/binutils-2.25/ld/testsuite/ld-vax-elf/plt-local.ld new file mode 100644 index 00000000..ca87459e --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/plt-local.ld @@ -0,0 +1,34 @@ +ENTRY (foo_global) +SECTIONS +{ + . = 0; + .interp : { *(.interp) } + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .rela.plt : { *(.rela.plt) } + + . = 0x1000; + .plt : { *(.plt) } + + . = 0x2000; + .text : { *(.text) } + + . = 0x3000; + .dynamic : { *(.dynamic) } + .got : { *(.got.plt) } +}; +VERSION +{ + { + global: + foo_extern; + foo_global; + foo_hidden; + foo_rehidden; + local: + foo_local; + }; +} diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/plt-local.s b/binutils-2.25/ld/testsuite/ld-vax-elf/plt-local.s new file mode 100644 index 00000000..b1fa8f05 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/plt-local.s @@ -0,0 +1,25 @@ + .text + + .globl foo_global + .type foo_global, @function +foo_global: + .word 0 + calls $0, foo_extern + calls $0, foo_global + calls $0, foo_local + calls $0, foo_hidden + calls $0, foo_rehidden + ret + .size foo_global, . - foo_global + + .globl foo_local + .type foo_local, @function +foo_local: + .word 0 + calls $0, foo_extern + calls $0, foo_global + calls $0, foo_local + calls $0, foo_hidden + calls $0, foo_rehidden + ret + .size foo_local, . - foo_local diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/vax-elf.exp b/binutils-2.25/ld/testsuite/ld-vax-elf/vax-elf.exp new file mode 100644 index 00000000..440e2dad --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/vax-elf.exp @@ -0,0 +1,107 @@ +# Expect script for VAX ELF linker tests +# Copyright 2012 Free Software Foundation, Inc. +# +# This file is part of the GNU Binutils. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +# MA 02110-1301, USA. +# + +if { ![istarget vax-*-*] || ![is_elf_format] } { + return +} + +run_ld_link_tests [list \ + [list "PLT test (shared library)" \ + "-shared -T plt-local-lib.ld" "" \ + "-k" \ + { plt-local-lib.s } \ + { { objdump -d plt-local-lib.dd } } \ + "plt-local-lib.so"] \ + [list "PLT test (object 1)" \ + "-r" "" \ + "-k" \ + { plt-local-hidden-pic.s } \ + {} \ + "plt-local-hidden-pic-r.o"] \ + [list "PLT test (object 2)" \ + "-r" "" \ + "-k" \ + { plt-local-rehidden-pic.s } \ + {} \ + "plt-local-rehidden-pic-r.o"] \ + [list "PLT test (executable)" \ + "-T plt-local.ld tmpdir/plt-local-hidden-pic-r.o tmpdir/plt-local-rehidden-pic-r.o tmpdir/plt-local-lib.so" "" \ + "" \ + { plt-local.s } \ + { { objdump -d plt-local.dd } } \ + "plt-local"]] + +# Global offset table tests. Make sure hidden symbols do not get GOT +# assignments. +run_ld_link_tests [list \ + [list "GOT test (auxiliary shared library)" \ + "-shared" "" \ + "-k" \ + { got-local-aux.s } \ + {} \ + "got-local-aux.so"] \ + [list "GOT test (object 1)" \ + "-r" "" \ + "-k" \ + { got-local-ref.s } \ + {} \ + "got-local-ref-r.o"] \ + [list "GOT test (object 2)" \ + "-r" "" \ + "-k" \ + { got-local-def.s } \ + {} \ + "got-local-def-r.o"] \ + [list "GOT test (executable)" \ + "-e 0 tmpdir/got-local-aux.so tmpdir/got-local-ref-r.o tmpdir/got-local-def-r.o" "" \ + "" \ + {} \ + { { readelf "-x .got" got-local-exe.xd } } \ + "got-local-exe"] \ + [list "GOT test (shared library)" \ + "-shared tmpdir/got-local-aux.so tmpdir/got-local-ref-r.o tmpdir/got-local-def-r.o" "" \ + "" \ + {} \ + { { readelf "-x .got" got-local-lib.xd } } \ + "got-local-lib.so"]] + +# Export class relocation tests. +run_ld_link_tests [list \ + [list \ + "VAX export class call relocation test" \ + "-shared -Ttext 0x12340000 -T export-class.ld" "" \ + "-k" \ + [list export-class-call.s export-class-def.s] \ + [list \ + [list objdump -d export-class-call.dd] \ + [list readelf -r export-class-call.rd] \ + [list readelf "-x .got" export-class-call.xd]] \ + "export-class-call.so"] \ + [list \ + "VAX export class data relocation test" \ + "-shared -Ttext 0x12340000 -T export-class.ld" "" \ + "-k" \ + [list export-class-data.s export-class-def.s] \ + [list \ + [list objdump -d export-class-data.dd] \ + [list readelf -r export-class-data.rd] \ + [list readelf "-x .got" export-class-data.xd]] \ + "export-class-data.so"]] diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/vax-export-class.rd b/binutils-2.25/ld/testsuite/ld-vax-elf/vax-export-class.rd new file mode 100644 index 00000000..844a0f46 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/vax-export-class.rd @@ -0,0 +1,11 @@ +Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains [0-9]+ entries: + * Offset * Info * Type * Sym\. *Value * Sym\. * Name * \+ * Addend +12340010 00000016 R_VAX_RELATIVE * 123400a0 +12340020 00000016 R_VAX_RELATIVE * 123400a0 +12340060 00000016 R_VAX_RELATIVE * 123400a0 +12340070 00000016 R_VAX_RELATIVE * 123400a0 +12340080 00000016 R_VAX_RELATIVE * 123400a0 +12340090 00000016 R_VAX_RELATIVE * 123400a0 +12340000 [0-9a-f]+01 R_VAX_32 * 123400a0 protected_baz \+ 0 +12340040 [0-9a-f]+01 R_VAX_32 * 123400a0 protected_foo \+ 0 +12340050 [0-9a-f]+01 R_VAX_32 * 123400a0 protected_bar \+ 0 diff --git a/binutils-2.25/ld/testsuite/ld-vax-elf/vax-export-class.xd b/binutils-2.25/ld/testsuite/ld-vax-elf/vax-export-class.xd new file mode 100644 index 00000000..a797f206 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-vax-elf/vax-export-class.xd @@ -0,0 +1,11 @@ +Hex dump of section '\.data': + 0x12340000 00000000 00000000 00000000 00000000 .* + 0x12340010 a0003412 00000000 00000000 00000000 .* + 0x12340020 a0003412 00000000 00000000 00000000 .* + 0x12340030 00000000 00000000 00000000 00000000 .* + 0x12340040 00000000 00000000 00000000 00000000 .* + 0x12340050 00000000 00000000 00000000 00000000 .* + 0x12340060 a0003412 00000000 00000000 00000000 .* + 0x12340070 a0003412 00000000 00000000 00000000 .* + 0x12340080 a0003412 00000000 00000000 00000000 .* + 0x12340090 a0003412 00000000 00000000 00000000 .* |