Add support for elf properties section.
[external/binutils.git] / ld / testsuite / ld-x86-64 / x86-64.exp
index 729a52d..7be4a21 100644 (file)
@@ -822,6 +822,174 @@ if { [isnative] && [which $CC] != 0 } {
            {{objdump {-dw} pr19319.dd}} \
            "pr19319" \
        ] \
+       [list \
+           "Build property 1" \
+           "" \
+           "" \
+           {pass.c property-no-copy.S} \
+           {{readelf {-n} property-1.r}} \
+           "property-1" \
+       ] \
+       [list \
+           "Build property 1 (.o)" \
+           "-r -nostdlib" \
+           "" \
+           {pass.c property-no-copy.S} \
+           {{readelf {-n} property-1.r}} \
+           "property-1.o" \
+       ] \
+       [list \
+           "Build property 1 (.so)" \
+           "-shared" \
+           "-fPIC" \
+           {pass.c property-no-copy.S} \
+           {{readelf {-n} property-1.r}} \
+           "property-1.so" \
+       ] \
+       [list \
+           "Build property 2" \
+           "" \
+           "" \
+           {pass.c property-stack.S} \
+           {{readelf {-n} property-2.r}} \
+           "property-2" \
+       ] \
+       [list \
+           "Build property 2 (.o)" \
+           "-r -nostdlib" \
+           "" \
+           {pass.c property-stack.S} \
+           {{readelf {-n} property-2.r}} \
+           "property-2.o" \
+       ] \
+       [list \
+           "Build property 2 (.so)" \
+           "-shared" \
+           "-fPIC" \
+           {pass.c property-stack.S} \
+           {{readelf {-n} property-2.r}} \
+           "property-2.so" \
+       ] \
+       [list \
+           "Build property 3" \
+           "" \
+           "" \
+           {pass.c property-stack.S property-x86-1.S} \
+           {{readelf {-n} property-3.r}} \
+           "property-3" \
+       ] \
+       [list \
+           "Build property 3 (.o)" \
+           "-r -nostdlib" \
+           "" \
+           {pass.c property-x86-1.S property-stack.S} \
+           {{readelf {-n} property-3.r}} \
+           "property-3.o" \
+       ] \
+       [list \
+           "Build property 3 (.so)" \
+           "-shared" \
+           "-fPIC" \
+           {property-x86-1.S pass.c property-stack.S} \
+           {{readelf {-n} property-3.r}} \
+           "property-3.so" \
+       ] \
+       [list \
+           "Build property 4" \
+           "" \
+           "" \
+           {pass.c property-stack.S property-x86-1.S property-x86-2.S} \
+           {{readelf {-n} property-4.r}} \
+           "property-4" \
+       ] \
+       [list \
+           "Build property 4 (.o)" \
+           "-r -nostdlib" \
+           "" \
+           {pass.c property-x86-2.S property-x86-1.S property-stack.S} \
+           {{readelf {-n} property-4.r}} \
+           "property-4.o" \
+       ] \
+       [list \
+           "Build property 4 (.so)" \
+           "-shared" \
+           "-fPIC" \
+           {property-x86-2.S property-x86-1.S pass.c property-stack.S} \
+           {{readelf {-n} property-4.r}} \
+           "property-4.so" \
+       ] \
+       [list \
+           "Build property 4 (-Wl,-z,stack-size=0)" \
+           "-Wl,-z,stack-size=0" \
+           "" \
+           {pass.c property-stack.S property-x86-1.S property-x86-2.S} \
+           {{readelf {-n} property-4.r}} \
+           "property-4" \
+       ] \
+       [list \
+           "Build property 5" \
+           "-Wl,-z,stack-size=0x900000" \
+           "" \
+           {pass.c property-stack.S property-x86-1.S property-x86-2.S} \
+           {{readelf {-n} property-5.r}} \
+           "property-5" \
+       ] \
+       [list \
+           "Build property 5 (.o)" \
+           "-r -nostdlib -Wl,-z,stack-size=0x900000" \
+           "" \
+           {pass.c property-x86-2.S property-x86-1.S property-stack.S} \
+           {{readelf {-n} property-5.r}} \
+           "property-5.o" \
+       ] \
+       [list \
+           "Build property 5 (.so)" \
+           "-shared -Wl,-z,stack-size=0x900000" \
+           "-fPIC" \
+           {property-x86-2.S property-x86-1.S pass.c property-stack.S} \
+           {{readelf {-n} property-5.r}} \
+           "property-5.so" \
+       ] \
+       [list \
+           "Build property-6.so" \
+           "-shared" \
+           "-fPIC" \
+           {property-6a.c property-6c.S} \
+           {{readelf {-n} property-6.r}} \
+           "property-6.so" \
+       ] \
+       [list \
+           "Build property-6.o" \
+           "-r -nostdlib" \
+           "" \
+           {property-6b.c property-stack.S} \
+           {{readelf {-n} property-2.r}} \
+           "property-6.o" \
+       ] \
+       [list \
+           "Build property-6" \
+           "-Wl,--as-needed tmpdir/property-6.o tmpdir/property-6.so" \
+           { dummy.s } \
+           "" \
+           {{readelf {-n} property-2.r}} \
+           "property-6" \
+       ] \
+       [list \
+           "Build property 7a (.o)" \
+           "-r -nostdlib" \
+           "" \
+           {property-unsorted-1.S} \
+           {{readelf {-n} property-7.r}} \
+           "property-7a.o" \
+       ] \
+       [list \
+           "Build property 7b (.o)" \
+           "-r -nostdlib" \
+           "" \
+           {property-unsorted-2.S} \
+           {{readelf {-n} property-7.r}} \
+           "property-7b.o" \
+       ] \
     ]
 
     run_ld_link_exec_tests [] [list \
@@ -892,6 +1060,111 @@ if { [isnative] && [which $CC] != 0 } {
            "gotpcrel1" \
            "gotpcrel1.out" \
        ] \
+       [list \
+           "Run property 1" \
+           "" \
+           "" \
+           {pass.c property-no-copy.S} \
+           "property-1" "pass.out" \
+       ] \
+       [list \
+           "Run property 1 (PIE)" \
+           "-pie" \
+           "" \
+           {pass.c property-no-copy.S} \
+           "property-1-pie" "pass.out" "-fPIE" \
+       ] \
+       [list \
+           "Run property 1 (static)" \
+           "-static" \
+           "" \
+           {pass.c property-no-copy.S} \
+           "property-1-static" "pass.out" \
+       ] \
+       [list \
+           "Run property 2" \
+           "" \
+           "" \
+           {pass.c property-stack.S} \
+           "property-2" "pass.out" \
+       ] \
+       [list \
+           "Run property 2 (PIE)" \
+           "-pie" \
+           "" \
+           {pass.c property-stack.S} \
+           "property-2-pie" "pass.out" "-fPIE" \
+       ] \
+       [list \
+           "Run property 2 (static)" \
+           "-static" \
+           "" \
+           {pass.c property-stack.S} \
+           "property-3-static" "pass.out" \
+       ] \
+       [list \
+           "Run property 3" \
+           "" \
+           "" \
+           {pass.c property-stack.S property-x86-1.S} \
+           "property-3" "pass.out" \
+       ] \
+       [list \
+           "Run property 3 (PIE)" \
+           "-pie" \
+           "" \
+           {pass.c property-x86-1.S property-stack.S} \
+           "property-3-pie" "pass.out" "-fPIE" \
+       ] \
+       [list \
+           "Run property 3 (static)" \
+           "-static" \
+           "" \
+           {property-x86-1.S pass.c property-stack.S} \
+           "property-3-static" "pass.out" \
+       ] \
+       [list \
+           "Run property 4" \
+           "" \
+           "" \
+           {pass.c property-stack.S property-x86-1.S property-x86-2.S} \
+           "property-4" "pass.out" \
+       ] \
+       [list \
+           "Run property 4 (PIE)" \
+           "-pie" \
+           "" \
+           {pass.c property-x86-2.S property-x86-1.S property-stack.S} \
+           "property-4-pie" "pass.out" "-fPIE" \
+       ] \
+       [list \
+           "Run property 4 (static)" \
+           "-static" \
+           "" \
+           {property-x86-2.S property-x86-1.S pass.c property-stack.S} \
+           "property-4-static" "pass.out" \
+       ] \
+       [list \
+           "Run property 5" \
+           "-Wl,-z,stack-size=0x900000" \
+           "" \
+           {pass.c property-stack.S property-x86-1.S property-x86-2.S} \
+           "property-5" "pass.out" \
+       ] \
+       [list \
+           "Run property 5 (PIE)" \
+           "-pie -Wl,-z,stack-size=0x900000" \
+           "" \
+           {pass.c property-x86-2.S property-x86-1.S property-stack.S} \
+           "property-5-pie" "pass.out" "-fPIE" \
+       ] \
+       [list \
+           "Run property 5 (static)" \
+           "-static -Wl,-z,stack-size=0x900000" \
+           "" \
+           {property-x86-2.S property-x86-1.S pass.c property-stack.S} \
+           "property-5-static" "pass.out" \
+       ] \
     ]
 
     if { [istarget "x86_64-*-linux*"] \