-Og warning fixes
[deliverable/binutils-gdb.git] / ld / testsuite / ld-x86-64 / x86-64.exp
index 6cde22ff58ef7913ba4fa529d1c2348918a9d81f..bf73534c1b8e0619f39763a5213b99dd36c0685a 100644 (file)
@@ -50,20 +50,20 @@ set x86_64tests {
      "-melf_x86_64 tmpdir/libpltlib.so" "" "--64" {plt.s}
      {{objdump -drj.plt plt.pd}} "plt"}
     {"TLS -fpic -shared transitions"
-     "-shared -melf_x86_64 --no-ld-generated-unwind-info" ""
+     "-shared -melf_x86_64 --no-ld-generated-unwind-info --hash-style=sysv" ""
      "--64" {tlspic1.s tlspic2.s}
      {{readelf -WSsrl tlspic.rd} {objdump -drj.text\ -Mintel64 tlspic.dd}
       {objdump -sj.got tlspic.sd} {objdump -sj.tdata tlspic.td}}
       "libtlspic.so"}
     {"TLS -fpic -shared transitions with r15 as GOT base"
-     "-shared -melf_x86_64 --no-ld-generated-unwind-info" ""
+     "-shared -melf_x86_64 --no-ld-generated-unwind-info --hash-style=sysv" ""
      "--64 -mrelax-relocations=yes"
      {tlspic3.s tlspic2.s}
      {{readelf -WSsrl tlspic2.rd} {objdump -drj.text\ -Mintel64 tlspic2.dd}
       {objdump -sj.got tlspic2.sd} {objdump -sj.tdata tlspic2.td}}
       "libtlspic2.so"}
     {"TLS descriptor -fpic -shared transitions"
-     "-shared -melf_x86_64 --no-ld-generated-unwind-info" ""
+     "-shared -melf_x86_64 --no-ld-generated-unwind-info --hash-style=sysv" ""
      "--64" {tlsdesc.s tlspic2.s}
      {{readelf -WSsrld tlsdesc.rd} {objdump -drj.text tlsdesc.dd}
       {objdump "-s -j.got -j.got.plt" tlsdesc.sd} {objdump -sj.tdata tlsdesc.td}
@@ -71,25 +71,25 @@ set x86_64tests {
     {"Helper shared library" "-shared -melf_x86_64" ""
      "--64" {tlslib.s} {} "libtlslib.so"}
     {"TLS -fpic and -fno-pic exec transitions"
-     "-melf_x86_64 tmpdir/libtlslib.so --no-ld-generated-unwind-info" ""
+     "-melf_x86_64 tmpdir/libtlslib.so --no-ld-generated-unwind-info --hash-style=sysv" ""
      "--64" {tlsbinpic.s tlsbin.s}
      {{readelf -WSsrl tlsbin.rd} {objdump -drj.text tlsbin.dd}
       {objdump -sj.got tlsbin.sd} {objdump -sj.tdata tlsbin.td}}
       "tlsbin"}
     {"TLS -fpic and -fno-pic exec transitions without PLT"
-     "-melf_x86_64 tmpdir/libtlslib.so --no-ld-generated-unwind-info" ""
+     "-melf_x86_64 tmpdir/libtlslib.so --no-ld-generated-unwind-info --hash-style=sysv" ""
      "-mrelax-relocations=yes --64" {tlsbinpic2.s tlsbin.s}
      {{readelf -WSsrl tlsbin2.rd} {objdump -drj.text tlsbin2.dd}
       {objdump -sj.got tlsbin2.sd} {objdump -sj.tdata tlsbin2.td}}
       "tlsbin2"}
     {"TLS descriptor -fpic and -fno-pic exec transitions"
-     "-melf_x86_64 tmpdir/libtlslib.so --no-ld-generated-unwind-info" ""
+     "-melf_x86_64 tmpdir/libtlslib.so --no-ld-generated-unwind-info --hash-style=sysv" ""
      "--64" {tlsbindesc.s tlsbin.s}
      {{readelf -WSsrl tlsbindesc.rd} {objdump -drj.text tlsbindesc.dd}
       {objdump -sj.got tlsbindesc.sd} {objdump -sj.tdata tlsbindesc.td}}
       "tlsbindesc"}
     {"TLS with global dynamic and descriptors"
-     "-shared -melf_x86_64 --no-ld-generated-unwind-info" ""
+     "-shared -melf_x86_64 --no-ld-generated-unwind-info --hash-style=sysv" ""
      "--64" {tlsgdesc.s}
      {{readelf -WSsrl tlsgdesc.rd} {objdump -drj.text\ -Mintel64 tlsgdesc.dd}}
       "libtlsgdesc.so"}
@@ -291,6 +291,7 @@ run_dump_test "protected6a"
 run_dump_test "protected6b"
 run_dump_test "protected7a"
 run_dump_test "protected7b"
+run_dump_test "protected8"
 run_dump_test "tlsle1"
 run_dump_test "tlspie1"
 run_dump_test "tlspie2a"
@@ -310,6 +311,8 @@ run_dump_test "pr14207"
 run_dump_test "gotplt1"
 run_dump_test "pie1"
 run_dump_test "pie2"
+run_dump_test "pie3"
+run_dump_test "pie3-nacl"
 run_dump_test "pic1"
 run_dump_test "largecomm-1a"
 run_dump_test "largecomm-1b"
@@ -349,6 +352,22 @@ run_dump_test "property-x86-ibt4"
 run_dump_test "property-x86-ibt4-x32"
 run_dump_test "property-x86-ibt5"
 run_dump_test "property-x86-ibt5-x32"
+run_dump_test "property-x86-shstk1a"
+run_dump_test "property-x86-shstk1b"
+run_dump_test "property-x86-shstk1a-x32"
+run_dump_test "property-x86-shstk1b-x32"
+run_dump_test "property-x86-shstk2"
+run_dump_test "property-x86-shstk2-x32"
+run_dump_test "property-x86-shstk3a"
+run_dump_test "property-x86-shstk3b"
+run_dump_test "property-x86-shstk3a-x32"
+run_dump_test "property-x86-shstk3b-x32"
+run_dump_test "property-x86-shstk4"
+run_dump_test "property-x86-shstk4-x32"
+run_dump_test "property-x86-shstk5"
+run_dump_test "property-x86-shstk5-x32"
+run_dump_test "pr21884"
+run_dump_test "pr21884-nacl"
 
 if { ![istarget "x86_64-*-linux*"] && ![istarget "x86_64-*-nacl*"]} {
     return
@@ -551,6 +570,7 @@ run_dump_test "pr20253-4f"
 run_dump_test "pr20253-5a"
 run_dump_test "pr20253-5b"
 run_dump_test "tlsdesc2"
+run_dump_test "pr22048"
 
 proc undefined_weak {cflags ldflags} {
     set testname "Undefined weak symbol"
@@ -558,8 +578,8 @@ proc undefined_weak {cflags ldflags} {
        set testname "$testname ($cflags $ldflags)"
     }
 
-    if { [ regexp "\-fPIE" $cflags]
-        && ![ regexp "nodynamic-undefined-weak" $ldflags] } {
+    if { [string match "*-fPIE*" $cflags]
+        && ![string match "*nodynamic-undefined-weak*" $ldflags] } {
        set weak_symbol "Weak defined"
     } else {
        set weak_symbol "Weak undefined"
@@ -1021,8 +1041,82 @@ if { [isnative] && [which $CC] != 0 } {
            {{readelf {-n} property-7.r}} \
            "property-7b.o" \
        ] \
+       [list \
+           "Build pr22001-1.so" \
+           "-shared" \
+           "-fPIC" \
+           { pr22001-1a.c } \
+           {} \
+           "pr22001-1.so" \
+       ] \
+       [list \
+           "Build pr22001-1a" \
+           "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
+           "$NOPIE_CFLAGS" \
+           { pr22001-1b.c } \
+           {{error_output "pr22001-1a.err"}} \
+           "pr22001-1a" \
+       ] \
+       [list \
+           "Build pr21997-1.so" \
+           "-shared" \
+           "" \
+           { property-stack.S property-no-copy.S pr21997-1a.S } \
+           {} \
+           "pr21997-1.so" \
+       ] \
+       [list \
+           "Build pr21997-1a" \
+           "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr21997-1.so" \
+           "$NOPIE_CFLAGS" \
+           { pr21997-1b.c } \
+           {{error_output "pr21997-1a.err"}} \
+           "pr21997-1a" \
+       ] \
     ]
 
+    if  {[istarget "x86_64-*-linux*-gnux32"]} {
+       run_ld_link_exec_tests [list \
+           [list \
+               "Run pr22001-1b" \
+               "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
+               "" \
+               { pr22001-1c.c } \
+               "pr22001-1b" \
+               "pass.out" \
+               "$NOPIE_CFLAGS" \
+           ] \
+           [list \
+               "Run pr21997-1b" \
+               "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr21997-1.so" \
+               "" \
+               { pr21997-1c.c } \
+               "pr21997-1b" \
+               "pass.out" \
+               "$NOPIE_CFLAGS" \
+           ] \
+       ]
+    } else {
+       run_cc_link_tests [list \
+           [list \
+               "Build pr22001-1b" \
+               "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
+               "$NOPIE_CFLAGS" \
+               { pr22001-1c.c } \
+               {{error_output "pr22001-1b.err"}} \
+               "pr22001-1b" \
+           ] \
+           [list \
+               "Build pr21997-1b" \
+               "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr21997-1.so" \
+               "$NOPIE_CFLAGS" \
+               { pr21997-1c.c } \
+               {{error_output "pr21997-1b.err"}} \
+               "pr21997-1b" \
+           ] \
+       ]
+    }
+
     run_ld_link_exec_tests [list \
        [list \
            "Run plt-main" \
@@ -1197,6 +1291,78 @@ if { [isnative] && [which $CC] != 0 } {
            {property-x86-2.S property-x86-1.S pass.c property-stack.S} \
            "property-5-static" "pass.out" \
        ] \
+       [list \
+           "Run pr22001-1a (PIC 1)" \
+           "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
+           "" \
+           { pr22001-1b.c } \
+           "pr22001-1a-pic-1" \
+           "pass.out" \
+           "-fPIC" \
+       ] \
+       [list \
+           "Run pr22001-1a (PIC 2)" \
+           "-pie -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
+           "" \
+           { pr22001-1b.c } \
+           "pr22001-1a-pic-2" \
+           "pass.out" \
+           "-fPIC" \
+       ] \
+       [list \
+           "Run pr22001-1b (PIC 1)" \
+           "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
+           "" \
+           { pr22001-1c.c } \
+           "pr22001-1b-pic-1" \
+           "pass.out" \
+           "-fPIC" \
+       ] \
+       [list \
+           "Run pr22001-1b (PIC 2)" \
+           "-pie -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
+           "" \
+           { pr22001-1c.c } \
+           "pr22001-1b-pic-2" \
+           "pass.out" \
+           "-fPIC" \
+       ] \
+       [list \
+           "Run pr21997-1a (PIC 1)" \
+           "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr21997-1.so" \
+           "" \
+           { pr21997-1b.c } \
+           "pr21997-1a-pic-1" \
+           "pass.out" \
+           "-fPIC" \
+       ] \
+       [list \
+           "Run pr21997-1a (PIC 2)" \
+           "-pie -Wl,--no-as-needed tmpdir/pr21997-1.so" \
+           "" \
+           { pr21997-1b.c } \
+           "pr21997-1a-pic-2" \
+           "pass.out" \
+           "-fPIC" \
+       ] \
+       [list \
+           "Run pr21997-1b (PIC 1)" \
+           "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr21997-1.so" \
+           "" \
+           { pr21997-1c.c } \
+           "pr21997-1b-pic-1" \
+           "pass.out" \
+           "-fPIC" \
+       ] \
+       [list \
+           "Run pr21997-1b (PIC 2)" \
+           "-pie -Wl,--no-as-needed tmpdir/pr21997-1.so" \
+           "" \
+           { pr21997-1c.c } \
+           "pr21997-1b-pic-2" \
+           "pass.out" \
+           "-fPIC" \
+       ] \
     ]
 
     # Run-time tests which require working ifunc attribute support.
@@ -1528,7 +1694,7 @@ if { ![istarget "x86_64-*-linux*"]} {
 run_ld_link_tests [list \
     [list \
        "basic PLT generation (-z now)" \
-       "-z now -melf_x86_64 tmpdir/libpltlib.so" \
+       "-z now -melf_x86_64 --hash-style=sysv tmpdir/libpltlib.so" \
        "" \
        "--64" \
        {plt2.s} \
@@ -1556,7 +1722,11 @@ run_ld_link_tests [list \
 ]
 
 # Linux only tests
-run_dump_test "pr17618"
+global LD_CLASS
+if { "$LD_CLASS" == "64bit" } then {
+    # This test needs 64-bit linker.
+    run_dump_test "pr17618"
+}
 run_dump_test "pltgot-1"
 run_dump_test "pltgot-2"
 run_dump_test "pr20830a"
This page took 0.03378 seconds and 4 git commands to generate.