* testsuite/ld-elf/shared.exp: Add run-time tests for -z now.
* testsuite/ld-i386/tls.exp: Likewise.
* testsuite/ld-ifunc/ifunc.exp: Likewise.
* testsuite/ld-x86-64/tls.exp: Likewise.
+2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
+
+ * testsuite/ld-elf/shared.exp: Add run-time tests for -z now.
+ * testsuite/ld-i386/tls.exp: Likewise.
+ * testsuite/ld-ifunc/ifunc.exp: Likewise.
+ * testsuite/ld-x86-64/tls.exp: Likewise.
+
2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
* testsuite/ld-x86-64/pr21038a.d: Update DW_CFA_nop paddings
{"Build libpr2404a.so"
"-shared" "-fPIC"
{pr2404a.c} {} "libpr2404a.so"}
+ {"Build libpr2404n.so"
+ "-shared -Wl,-z,now" "-fPIC"
+ {pr2404a.c} {} "libpr2404n.so"}
{"Build libpr2404b.a"
"" ""
{pr2404b.c} {} "libpr2404b.a"}
[list "Run pr2404" \
"-Wl,--no-as-needed tmpdir/pr2404b.o tmpdir/libpr2404a.so" "" \
{dummy.c} "pr2404" "pr2404.out" ] \
+ [list "Run pr2404n" \
+ "-Wl,-z,now -Wl,--no-as-needed tmpdir/pr2404b.o tmpdir/libpr2404n.so" "" \
+ {dummy.c} "pr2404n" "pr2404.out" ] \
[list "Run pr18458" \
"-Wl,--no-as-needed,-z,now tmpdir/libpr18458a.so tmpdir/libpr18458b.so" "" \
{pr18458c.c} "pr18458" "pass.out" ] \
{} \
"libpr19579.so" \
] \
+ [list \
+ "Build libpr19579now.so" \
+ "-shared -Wl,-z,now" \
+ "-fPIC" \
+ {pr19579b.c} \
+ {} \
+ "libpr19579.so" \
+ ] \
]
run_ld_link_exec_tests [list \
[list \
+ "Run pr18458 with PIE" \
+ "-pie -Wl,--no-as-needed,-z,now tmpdir/libpr18458a.so tmpdir/libpr18458b.so" \
+ "" \
+ {pr18458c.c} \
+ "pr18458p" \
+ "pass.out" \
+ "-fPIE" \
+ ] \
+ [list \
"Run pr2404 with PIE" \
"-pie -Wl,--no-as-needed tmpdir/pr2404b.o tmpdir/libpr2404a.so" \
"" \
"-fPIE" \
] \
[list \
+ "Run pr2404 with PIE (-z now)" \
+ "-pie -Wl,-z,now -Wl,--no-as-needed tmpdir/pr2404b.o tmpdir/libpr2404n.so" \
+ "" \
+ { dummy.c } \
+ "pr2404pien" \
+ "pr2404.out" \
+ "-fPIE" \
+ ] \
+ [list \
"Run pr18718" \
"" \
"" \
"-O2 -I../bfd" \
] \
[list \
+ "Run pr18718 (-z now)" \
+ "-Wl,-z,now" \
+ "" \
+ { pr18718.c check-ptr-eq.c } \
+ "pr18718" \
+ "pass.out" \
+ "-O2 -I../bfd" \
+ ] \
+ [list \
"Run pr18718 with PIE (1)" \
"-pie" \
"" \
"-O2 -fPIE -I../bfd" \
] \
[list \
+ "Run pr18718 with PIE (3)" \
+ "-pie -Wl,-z,now" \
+ "" \
+ { pr18718.c check-ptr-eq.c } \
+ "pr18718pie3" \
+ "pass.out" \
+ "-O2 -fPIE -I../bfd" \
+ ] \
+ [list \
+ "Run pr18718 with PIE (4)" \
+ "-Wl,-z,now" \
+ "" \
+ { pr18718.c check-ptr-eq.c } \
+ "pr18718pie4" \
+ "pass.out" \
+ "-O2 -fPIE -I../bfd" \
+ ] \
+ [list \
"Run pr18718 with PIC (1)" \
"" \
"" \
"-O2 -fPIC -I../bfd" \
] \
[list \
+ "Run pr18718 with PIC (3)" \
+ "-Wl,-z,now" \
+ "" \
+ { pr18718.c check-ptr-eq.c } \
+ "pr18718pic3" \
+ "pass.out" \
+ "-O2 -fPIC -I../bfd" \
+ ] \
+ [list \
+ "Run pr18718 with PIC (4)" \
+ "-pie -Wl,-z,now" \
+ "" \
+ { pr18718.c check-ptr-eq.c } \
+ "pr18718pic4" \
+ "pass.out" \
+ "-O2 -fPIC -I../bfd" \
+ ] \
+ [list \
"Run pr19579" \
"-pie -Wl,--no-as-needed,-z,text tmpdir/pr19579a.o tmpdir/libpr19579.so" \
"" \
"pass.out" \
"-fPIE" \
] \
+ [list \
+ "Run pr19579 (-z now)" \
+ "-pie -Wl,-z,now -Wl,--no-as-needed,-z,text tmpdir/pr19579a.o tmpdir/libpr19579.so" \
+ "" \
+ {dummy.c} \
+ "pr19579n" \
+ "pass.out" \
+ "-fPIE" \
+ ] \
]
}
{} \
"libtls-1b.so" \
] \
+ [list \
+ "Build libtls-1bn.so" \
+ "-Wl,-z,now -shared tmpdir/tls-gd1.o tmpdir/tls-ld1.o" \
+ "" \
+ {dummy.s} \
+ {} \
+ "libtls-1bn.so" \
+ ] \
]
run_ld_link_exec_tests [list \
"pass.out" \
] \
[list \
+ "TLS GD/LD -> LE transition without PLT (dynamic, -z now)" \
+ "-Wl,-z,now tmpdir/tls-def1.o tmpdir/tls-main1.o tmpdir/tls-gd1.o \
+ tmpdir/tls-ld1.o" \
+ "" \
+ { dummy.s } \
+ "tls-1an" \
+ "pass.out" \
+ ] \
+ [list \
"TLS GD/LD -> LE transition without PLT (PIE)" \
"-pie tmpdir/tls-def1.o tmpdir/tls-main1.o tmpdir/tls-gd1.o \
tmpdir/tls-ld1.o" \
"pass.out" \
] \
[list \
+ "TLS GD/LD -> LE transition without PLT (PIE, -z now)" \
+ "-pie -Wl,-z,now tmpdir/tls-def1.o tmpdir/tls-main1.o tmpdir/tls-gd1.o \
+ tmpdir/tls-ld1.o" \
+ "" \
+ { dummy.s } \
+ "tls-1bn" \
+ "pass.out" \
+ ] \
+ [list \
"TLS GD/LD -> LE transition without PLT (static)" \
"-static tmpdir/tls-def1.o tmpdir/tls-main1.o tmpdir/tls-gd1.o \
tmpdir/tls-ld1.o" \
"pass.out" \
] \
[list \
+ "TLS GD/LD -> IE transition without PLT (-z now)" \
+ "-Wl,-z,now tmpdir/tls-main1.o tmpdir/tls-gd1.o tmpdir/tls-ld1.o \
+ tmpdir/libtls-1a.so -Wl,-R,tmpdir" \
+ "" \
+ { dummy.s } \
+ "tls-1dn" \
+ "pass.out" \
+ ] \
+ [list \
"TLS without PLT (1)" \
"tmpdir/tls-main1.o \
tmpdir/libtls-1a.so tmpdir/libtls-1b.so -Wl,-R,tmpdir" \
"tls-1f" \
"pass.out" \
] \
+ [list \
+ "TLS without PLT (3)" \
+ "-Wl,-z,now tmpdir/tls-main1.o \
+ tmpdir/libtls-1a.so tmpdir/libtls-1bn.so -Wl,-R,tmpdir" \
+ "" \
+ { dummy.s } \
+ "tls-1en" \
+ "pass.out" \
+ ] \
+ [list \
+ "TLS without PLT (4)" \
+ "-Wl,-z,now tmpdir/tls-main1.o tmpdir/tls-def1.o \
+ tmpdir/libtls-1bn.so -Wl,-R,tmpdir" \
+ "" \
+ { dummy.s } \
+ "tls-1fn" \
+ "pass.out" \
+ ] \
]
{} \
"libpr16467c.a" \
] \
+ [list \
+ "Build libpr16467an.so" \
+ "-shared -Wl,-z,now -Wl,--version-script=pr16467a.map" \
+ "-fPIC" \
+ { pr16467a.c } \
+ {} \
+ "libpr16467an.so" \
+ ] \
+ [list \
+ "Build libpr16467bn.so" \
+ "-shared tmpdir/pr16467b.o tmpdir/libpr16467an.so \
+ -Wl,--version-script=pr16467b.map" \
+ "-fPIC" \
+ { dummy.c } \
+ {} \
+ "libpr16467bn.so" \
+ ] \
]
run_ld_link_exec_tests [list \
{} \
"libifunc-lib.so" \
] \
+ [list \
+ "Build ifunc-libn.so" \
+ "-shared -Wl,-z,now" \
+ "-fPIC" \
+ { ifunc-lib.c } \
+ {} \
+ "libifunc-libn.so" \
+ ] \
]
run_ld_link_exec_tests [list \
"" \
] \
[list \
+ "Run pr16467 (-z now)" \
+ "-Wl,-z,now -Wl,--no-as-needed tmpdir/pr16467c.o tmpdir/libpr16467bn.so tmpdir/libpr16467an.so" \
+ "" \
+ { dummy.c } \
+ "pr16467n" \
+ "pr16467.out" \
+ "" \
+ ] \
+ [list \
"Run ifunc-main" \
"-Wl,--no-as-needed tmpdir/libifunc-lib.so" \
"" \
"ifunc-main.out" \
"-fpic" \
] \
+ [list \
+ "Run ifunc-main (-z now)" \
+ "-Wl,-z,now -Wl,--no-as-needed tmpdir/libifunc-libn.so" \
+ "" \
+ { ifunc-main.c } \
+ "ifunc-mainn" \
+ "ifunc-main.out" \
+ ] \
+ [list \
+ "Run ifunc-main with PIE (-z now)" \
+ "-pie -Wl,-z,now -Wl,--no-as-needed tmpdir/libifunc-libn.so" \
+ "" \
+ { ifunc-main.c } \
+ "ifunc-mainpn" \
+ "ifunc-main.out" \
+ "-fpie" \
+ ] \
]
# Run-time tests which require working ifunc attribute support.
"libpr18808.so" \
] \
[list \
+ "Build libpr18808n.so" \
+ "-shared -Wl,-z,now" \
+ "-fPIC -O2 -g" \
+ { pr18808b.c } \
+ {} \
+ "libpr18808n.so" \
+ ] \
+ [list \
"Build pr18841a.o" \
"" \
"" \
{} \
"libpr18841c.so" \
] \
+ [list \
+ "Build libpr18841bn.so" \
+ "-Wl,-z,now -shared" \
+ "-fPIC -O0 -g" \
+ { pr18841b.c } \
+ {} \
+ "libpr18841bn.so" \
+ ] \
+ [list \
+ "Build libpr18841cn.so" \
+ "-shared" \
+ "-Wl,-z,now -fPIC -O0 -g" \
+ { pr18841c.c } \
+ {} \
+ "libpr18841cn.so" \
+ ] \
]
run_ld_link_exec_tests [list \
"pr18808.out" \
] \
[list \
+ "Run pr18808 (-z now)" \
+ "-Wl,-z,now -Wl,--no-as-needed tmpdir/pr18808a.o tmpdir/libpr18808n.so" \
+ "" \
+ { dummy.c } \
+ "pr18808n" \
+ "pr18808.out" \
+ ] \
+ [list \
"Run pr18841 with libpr18841b.so" \
"-Wl,--no-as-needed tmpdir/pr18841a.o tmpdir/libpr18841b.so" \
"" \
"pr18841c" \
"pr18841.out" \
] \
+ [list \
+ "Run pr18841 with libpr18841bn.so (-z now)" \
+ "-Wl,-z,now -Wl,--no-as-needed tmpdir/pr18841a.o tmpdir/libpr18841bn.so" \
+ "" \
+ { dummy.c } \
+ "pr18841bn" \
+ "pr18841.out" \
+ ] \
+ [list \
+ "Run pr18841 with libpr18841cn.so (-z now)" \
+ "-Wl,-z,now -Wl,--as-needed tmpdir/pr18841a.o tmpdir/libpr18841cn.so" \
+ "" \
+ { dummy.c } \
+ "pr18841cn" \
+ "pr18841.out" \
+ ] \
]
{} \
"libtls-1b.so" \
] \
+ [list \
+ "Build libtls-1bn.so" \
+ "-Wl,-z,now -shared tmpdir/tls-gd1.o tmpdir/tls-ld1.o" \
+ "" \
+ {dummy.s} \
+ {} \
+ "libtls-1bn.so" \
+ ] \
]
run_ld_link_exec_tests [list \
"pass.out" \
] \
[list \
+ "TLS GD/LD -> LE transition without PLT (dynamic, -z now)" \
+ "-Wl,-z,now tmpdir/tls-def1.o tmpdir/tls-main1.o tmpdir/tls-gd1.o \
+ tmpdir/tls-ld1.o" \
+ "" \
+ { dummy.s } \
+ "tls-1an" \
+ "pass.out" \
+ ] \
+ [list \
"TLS GD/LD -> LE transition without PLT (PIE)" \
"-pie tmpdir/tls-def1.o tmpdir/tls-main1.o tmpdir/tls-gd1.o \
tmpdir/tls-ld1.o" \
"pass.out" \
] \
[list \
+ "TLS GD/LD -> LE transition without PLT (PIE, -z now)" \
+ "-pie -Wl,-z,now tmpdir/tls-def1.o tmpdir/tls-main1.o tmpdir/tls-gd1.o \
+ tmpdir/tls-ld1.o" \
+ "" \
+ { dummy.s } \
+ "tls-1bn" \
+ "pass.out" \
+ ] \
+ [list \
"TLS GD/LD -> LE transition without PLT (static)" \
"-static tmpdir/tls-def1.o tmpdir/tls-main1.o tmpdir/tls-gd1.o \
tmpdir/tls-ld1.o" \
"pass.out" \
] \
[list \
+ "TLS GD/LD -> IE transition without PLT (-z now)" \
+ "-Wl,-z,now tmpdir/tls-main1.o tmpdir/tls-gd1.o tmpdir/tls-ld1.o \
+ tmpdir/libtls-1a.so -Wl,-R,tmpdir" \
+ "" \
+ { dummy.s } \
+ "tls-1dn" \
+ "pass.out" \
+ ] \
+ [list \
"TLS without PLT (1)" \
"-Wl,--no-as-needed,-R,tmpdir tmpdir/tls-main1.o \
tmpdir/libtls-1a.so tmpdir/libtls-1b.so" \
"tls-1f" \
"pass.out" \
] \
+ [list \
+ "TLS without PLT (3)" \
+ "-Wl,-z,now tmpdir/tls-main1.o \
+ tmpdir/libtls-1a.so tmpdir/libtls-1bn.so -Wl,-R,tmpdir" \
+ "" \
+ { dummy.s } \
+ "tls-1en" \
+ "pass.out" \
+ ] \
+ [list \
+ "TLS without PLT (4)" \
+ "-Wl,-z,now tmpdir/tls-main1.o tmpdir/tls-def1.o \
+ tmpdir/libtls-1bn.so -Wl,-R,tmpdir" \
+ "" \
+ { dummy.s } \
+ "tls-1fn" \
+ "pass.out" \
+ ] \
]