1 # Expect script for symbol export classes, i386 variation.
3 # Copyright 2012 Free Software Foundation, Inc.
5 # This file is part of the GNU Binutils.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
24 # Written by Maciej W. Rozycki <macro@codesourcery.com>
27 # Exclude non-ELF targets.
28 if { ![is_elf_format] } {
32 if { !([istarget i?86-*-linux*]
33 || [istarget i?86-*-gnu*]) } {
37 set testname "i386 symbol export class test"
39 # Build an auxiliary shared object with conflicting versioned symbol
41 run_ld_link_tests [list \
43 "$testname (auxiliary shared object)" \
44 "-shared -version-script ../ld-elf/export-class-lib.ver" \
46 { ../ld-elf/export-class-lib.s } \
48 "i386-export-class-lib.so" \
52 # Build a static object that pulls symbol definitions. It has to come
53 # first before the auxiliary shared object and other static objects on
54 # the linker's command line and hence we need to build it separately.
55 run_ld_link_tests [list \
57 "$testname (initial static object)" \
60 { ../ld-elf/export-class-ref.s } \
62 "i386-export-class-ref-r.o" \
66 # Build static objects that satisfy symbol dependencies and preempt
67 # shared-object symbol definitions, and link all the objects built into
68 # the final shared object. The command-line order of objects linked is
69 # important to make sure the linker correctly preempts versioned symbols
70 # from the auxiliary shared object and is as follows: ref, lib, dep, def.
71 # Get a dump to make sure symbol dependencies are resolved internally.
72 run_ld_link_tests [list \
74 "$testname (final shared object)" \
75 "-shared -Tdata=0x12340000 tmpdir/i386-export-class-ref-r.o tmpdir/i386-export-class-lib.so" \
77 { ../ld-elf/export-class-dep.s ../ld-elf/export-class-def.s } \
79 { readelf -r i386-export-class.rd } \
80 { readelf "-x .data" i386-export-class.xd } \
82 "i386-export-class.so" \