Import binutils 2.18
[nacl-binutils.git] / ld / testsuite / ld-x86-64 / x86-64.exp
blob75c527306ed61d2fa6170d710ccb9687f96c8bec
1 # Expect script for ld-x86_64 tests
2 # Copyright (C) 2002, 2005, 2006, 2007 Free Software Foundation
4 # This file is part of the GNU Binutils.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19 # MA 02110-1301, USA.
22 # Test x86_64 linking; all types of relocs. This tests the assembler and
23 # tools like objdump as well as the linker.
25 if { !([istarget "x86_64-*-elf*"]
26 || [istarget "x86_64-*-linux*"]) } {
27 return
30 # List contains test-items with 3 items followed by 2 lists:
31 # 0:name 1:ld options 2:assembler options
32 # 3:filenames of assembler files 4: action and options. 5: name of output file
34 # Actions:
35 # objdump: Apply objdump options on result. Compare with regex (last arg).
36 # nm: Apply nm options on result. Compare with regex (last arg).
37 # readelf: Apply readelf options on result. Compare with regex (last arg).
39 set x86_64tests {
40 {"TLS -fpic -shared transitions" "-shared -melf_x86_64"
41 "--64" {tlspic1.s tlspic2.s}
42 {{readelf -WSsrl tlspic.rd} {objdump -drj.text tlspic.dd}
43 {objdump -sj.got tlspic.sd} {objdump -sj.tdata tlspic.td}}
44 "libtlspic.so"}
45 {"TLS descriptor -fpic -shared transitions" "-shared -melf_x86_64"
46 "--64" {tlsdesc.s tlspic2.s}
47 {{readelf -WSsrld tlsdesc.rd} {objdump -drj.text tlsdesc.dd}
48 {objdump "-s -j.got -j.got.plt" tlsdesc.sd} {objdump -sj.tdata tlsdesc.td}
49 {objdump -drj.plt tlsdesc.pd}} "libtlsdesc.so"}
50 {"Helper shared library" "-shared -melf_x86_64"
51 "--64" {tlslib.s} {} "libtlslib.so"}
52 {"TLS -fpic and -fno-pic exec transitions"
53 "-melf_x86_64 tmpdir/libtlslib.so" "--64" {tlsbinpic.s tlsbin.s}
54 {{readelf -WSsrl tlsbin.rd} {objdump -drj.text tlsbin.dd}
55 {objdump -sj.got tlsbin.sd} {objdump -sj.tdata tlsbin.td}}
56 "tlsbin"}
57 {"TLS descriptor -fpic and -fno-pic exec transitions"
58 "-melf_x86_64 tmpdir/libtlslib.so" "--64" {tlsbindesc.s tlsbin.s}
59 {{readelf -WSsrl tlsbindesc.rd} {objdump -drj.text tlsbindesc.dd}
60 {objdump -sj.got tlsbindesc.sd} {objdump -sj.tdata tlsbindesc.td}}
61 "tlsbindesc"}
62 {"TLS with global dynamic and descriptors"
63 "-shared -melf_x86_64" "--64" {tlsgdesc.s}
64 {{readelf -WSsrl tlsgdesc.rd} {objdump -drj.text tlsgdesc.dd}}
65 "libtlsgdesc.so"}
66 {"TLS in debug sections" "-melf_x86_64"
67 "--64" {tlsg.s}
68 {{objdump -sj.debug_foobar tlsg.sd}} "tlsg"}
71 run_ld_link_tests $x86_64tests
73 run_dump_test "abs"
74 run_dump_test "pcrel8"
75 run_dump_test "pcrel16"