aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-i386
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-i386')
-rw-r--r--ld/testsuite/ld-i386/i386.exp273
-rw-r--r--ld/testsuite/ld-i386/pass.c8
-rw-r--r--ld/testsuite/ld-i386/property-1.r7
-rw-r--r--ld/testsuite/ld-i386/property-2.r7
-rw-r--r--ld/testsuite/ld-i386/property-3.r8
-rw-r--r--ld/testsuite/ld-i386/property-4.r8
-rw-r--r--ld/testsuite/ld-i386/property-5.r8
-rw-r--r--ld/testsuite/ld-i386/property-6.r7
-rw-r--r--ld/testsuite/ld-i386/property-6a.c7
-rw-r--r--ld/testsuite/ld-i386/property-6b.c8
-rw-r--r--ld/testsuite/ld-i386/property-6c.S18
-rw-r--r--ld/testsuite/ld-i386/property-7.r6
-rw-r--r--ld/testsuite/ld-i386/property-no-copy.S15
-rw-r--r--ld/testsuite/ld-i386/property-stack.S18
-rw-r--r--ld/testsuite/ld-i386/property-unsorted-1.S34
-rw-r--r--ld/testsuite/ld-i386/property-unsorted-2.S22
-rw-r--r--ld/testsuite/ld-i386/property-x86-1.S32
-rw-r--r--ld/testsuite/ld-i386/property-x86-2.S25
18 files changed, 511 insertions, 0 deletions
diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
index c489227..844b36f 100644
--- a/ld/testsuite/ld-i386/i386.exp
+++ b/ld/testsuite/ld-i386/i386.exp
@@ -736,6 +736,174 @@ if { [isnative]
{{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 \
@@ -814,6 +982,111 @@ if { [isnative]
"got1" \
"got1.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" \
+ ] \
]
undefined_weak "" ""
diff --git a/ld/testsuite/ld-i386/pass.c b/ld/testsuite/ld-i386/pass.c
new file mode 100644
index 0000000..8fb892c
--- /dev/null
+++ b/ld/testsuite/ld-i386/pass.c
@@ -0,0 +1,8 @@
+#include <stdio.h>
+
+int
+main ()
+{
+ printf ("PASS\n");
+ return 0;
+}
diff --git a/ld/testsuite/ld-i386/property-1.r b/ld/testsuite/ld-i386/property-1.r
new file mode 100644
index 0000000..d8f08c0
--- /dev/null
+++ b/ld/testsuite/ld-i386/property-1.r
@@ -0,0 +1,7 @@
+#...
+Displaying notes found in: .note.gnu.property
+ Owner Data size Description
+ GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0
+ Properties: no copy on protected
+
+#pass
diff --git a/ld/testsuite/ld-i386/property-2.r b/ld/testsuite/ld-i386/property-2.r
new file mode 100644
index 0000000..5e3d156
--- /dev/null
+++ b/ld/testsuite/ld-i386/property-2.r
@@ -0,0 +1,7 @@
+#...
+Displaying notes found in: .note.gnu.property
+ Owner Data size Description
+ GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0
+ Properties: stack size: 0x800000
+
+#pass
diff --git a/ld/testsuite/ld-i386/property-3.r b/ld/testsuite/ld-i386/property-3.r
new file mode 100644
index 0000000..0ed91f5
--- /dev/null
+++ b/ld/testsuite/ld-i386/property-3.r
@@ -0,0 +1,8 @@
+#...
+Displaying notes found in: .note.gnu.property
+ Owner Data size Description
+ GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0
+ Properties: stack size: 0x800000
+ x86 ISA used: 586, SSE
+ x86 ISA needed: i486, 586
+#pass
diff --git a/ld/testsuite/ld-i386/property-4.r b/ld/testsuite/ld-i386/property-4.r
new file mode 100644
index 0000000..cb2bc15
--- /dev/null
+++ b/ld/testsuite/ld-i386/property-4.r
@@ -0,0 +1,8 @@
+#...
+Displaying notes found in: .note.gnu.property
+ Owner Data size Description
+ GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0
+ Properties: stack size: 0x800000
+ x86 ISA used: i486, 586, SSE
+ x86 ISA needed: i486, 586, SSE
+#pass
diff --git a/ld/testsuite/ld-i386/property-5.r b/ld/testsuite/ld-i386/property-5.r
new file mode 100644
index 0000000..5529650
--- /dev/null
+++ b/ld/testsuite/ld-i386/property-5.r
@@ -0,0 +1,8 @@
+#...
+Displaying notes found in: .note.gnu.property
+ Owner Data size Description
+ GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0
+ Properties: stack size: 0x900000
+ x86 ISA used: i486, 586, SSE
+ x86 ISA needed: i486, 586, SSE
+#pass
diff --git a/ld/testsuite/ld-i386/property-6.r b/ld/testsuite/ld-i386/property-6.r
new file mode 100644
index 0000000..97a479f
--- /dev/null
+++ b/ld/testsuite/ld-i386/property-6.r
@@ -0,0 +1,7 @@
+#...
+Displaying notes found in: .note.gnu.property
+ Owner Data size Description
+ GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0
+ Properties: stack size: 0xa00000
+
+#pass
diff --git a/ld/testsuite/ld-i386/property-6a.c b/ld/testsuite/ld-i386/property-6a.c
new file mode 100644
index 0000000..c7cc10b
--- /dev/null
+++ b/ld/testsuite/ld-i386/property-6a.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+void
+property (void)
+{
+ printf ("PASS\n");
+}
diff --git a/ld/testsuite/ld-i386/property-6b.c b/ld/testsuite/ld-i386/property-6b.c
new file mode 100644
index 0000000..5336b0e
--- /dev/null
+++ b/ld/testsuite/ld-i386/property-6b.c
@@ -0,0 +1,8 @@
+extern void property (void);
+
+int
+main ()
+{
+ property ();
+ return 0;
+}
diff --git a/ld/testsuite/ld-i386/property-6c.S b/ld/testsuite/ld-i386/property-6c.S
new file mode 100644
index 0000000..13f729d
--- /dev/null
+++ b/ld/testsuite/ld-i386/property-6c.S
@@ -0,0 +1,18 @@
+ .section ".note.gnu.property", "a"
+ .p2align 2
+ .long 1f - 0f /* name length. */
+ .long 3f - 1f /* data length. */
+ /* NT_GNU_PROPERTY_TYPE_0 */
+ .long 5 /* note type. */
+0:
+ .asciz "GNU" /* vendor name. */
+1:
+ .p2align 2
+ /* GNU_PROPERTY_STACK_SIZE */
+ .long 1 /* pr_type. */
+ .long 5f - 4f /* pr_datasz. */
+4:
+ .dc.a 0xa00000 /* Stack size. */
+5:
+ .p2align 2
+3:
diff --git a/ld/testsuite/ld-i386/property-7.r b/ld/testsuite/ld-i386/property-7.r
new file mode 100644
index 0000000..ad6af84
--- /dev/null
+++ b/ld/testsuite/ld-i386/property-7.r
@@ -0,0 +1,6 @@
+#...
+Displaying notes found in: .note.gnu.property
+ Owner Data size Description
+ GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0
+ Properties: stack size: 0x800000
+ no copy on protected
diff --git a/ld/testsuite/ld-i386/property-no-copy.S b/ld/testsuite/ld-i386/property-no-copy.S
new file mode 100644
index 0000000..3116911
--- /dev/null
+++ b/ld/testsuite/ld-i386/property-no-copy.S
@@ -0,0 +1,15 @@
+ .section ".note.gnu.property", "a"
+ .p2align 2
+ .long 1f - 0f /* name length. */
+ .long 3f - 1f /* data length. */
+ /* NT_GNU_PROPERTY_TYPE_0 */
+ .long 5 /* note type. */
+0:
+ .asciz "GNU" /* vendor name. */
+1:
+ .p2align 2
+ /* GNU_PROPERTY_NO_COPY_ON_PROTECTED */
+ .long 2 /* pr_type. */
+ .long 0 /* pr_datasz. */
+ .p2align 2
+3:
diff --git a/ld/testsuite/ld-i386/property-stack.S b/ld/testsuite/ld-i386/property-stack.S
new file mode 100644
index 0000000..5e9bcce
--- /dev/null
+++ b/ld/testsuite/ld-i386/property-stack.S
@@ -0,0 +1,18 @@
+ .section ".note.gnu.property", "a"
+ .p2align 2
+ .long 1f - 0f /* name length. */
+ .long 3f - 1f /* data length. */
+ /* NT_GNU_PROPERTY_TYPE_0 */
+ .long 5 /* note type. */
+0:
+ .asciz "GNU" /* vendor name. */
+1:
+ .p2align 2
+ /* GNU_PROPERTY_STACK_SIZE */
+ .long 1 /* pr_type. */
+ .long 5f - 4f /* pr_datasz. */
+4:
+ .dc.a 0x800000 /* Stack size. */
+5:
+ .p2align 2
+3:
diff --git a/ld/testsuite/ld-i386/property-unsorted-1.S b/ld/testsuite/ld-i386/property-unsorted-1.S
new file mode 100644
index 0000000..1cbb272
--- /dev/null
+++ b/ld/testsuite/ld-i386/property-unsorted-1.S
@@ -0,0 +1,34 @@
+ .section ".note.gnu.property", "a"
+ .p2align 2
+ .long 1f - 0f /* name length. */
+ .long 3f - 1f /* data length. */
+ /* NT_GNU_PROPERTY_TYPE_0 */
+ .long 5 /* note type. */
+0:
+ .asciz "GNU" /* vendor name. */
+1:
+ .p2align 2
+ /* GNU_PROPERTY_NO_COPY_ON_PROTECTED */
+ .long 2 /* pr_type. */
+ .long 0 /* pr_datasz. */
+ .p2align 2
+3:
+
+ .section ".note.gnu.property", "a"
+ .p2align 2
+ .long 1f - 0f /* name length. */
+ .long 3f - 1f /* data length. */
+ /* NT_GNU_PROPERTY_TYPE_0 */
+ .long 5 /* note type. */
+0:
+ .asciz "GNU" /* vendor name. */
+1:
+ .p2align 2
+ /* GNU_PROPERTY_STACK_SIZE */
+ .long 1 /* pr_type. */
+ .long 5f - 4f /* pr_datasz. */
+4:
+ .dc.a 0x800000 /* Stack size. */
+5:
+ .p2align 2
+3:
diff --git a/ld/testsuite/ld-i386/property-unsorted-2.S b/ld/testsuite/ld-i386/property-unsorted-2.S
new file mode 100644
index 0000000..0289399
--- /dev/null
+++ b/ld/testsuite/ld-i386/property-unsorted-2.S
@@ -0,0 +1,22 @@
+ .section ".note.gnu.property", "a"
+ .p2align 2
+ .long 1f - 0f /* name length. */
+ .long 3f - 1f /* data length. */
+ /* NT_GNU_PROPERTY_TYPE_0 */
+ .long 5 /* note type. */
+0:
+ .asciz "GNU" /* vendor name. */
+1:
+ .p2align 2
+ /* GNU_PROPERTY_NO_COPY_ON_PROTECTED */
+ .long 2 /* pr_type. */
+ .long 0 /* pr_datasz. */
+ .p2align 2
+ /* GNU_PROPERTY_STACK_SIZE */
+ .long 1 /* pr_type. */
+ .long 5f - 4f /* pr_datasz. */
+4:
+ .dc.a 0x800000 /* Stack size. */
+5:
+ .p2align 2
+3:
diff --git a/ld/testsuite/ld-i386/property-x86-1.S b/ld/testsuite/ld-i386/property-x86-1.S
new file mode 100644
index 0000000..953ca87
--- /dev/null
+++ b/ld/testsuite/ld-i386/property-x86-1.S
@@ -0,0 +1,32 @@
+ .section ".note.gnu.property", "a"
+ .p2align 2
+ .long 1f - 0f /* name length. */
+ .long 3f - 1f /* data length. */
+ /* NT_GNU_PROPERTY_TYPE_0 */
+ .long 5 /* note type. */
+0:
+ .asciz "GNU" /* vendor name. */
+1:
+ .p2align 2
+ /* GNU_PROPERTY_STACK_SIZE */
+ .long 1 /* pr_type. */
+ .long 5f - 4f /* pr_datasz. */
+4:
+ .dc.a 0x600000 /* Stack size. */
+5:
+ .p2align 2
+ /* GNU_PROPERTY_X86_ISA_1_USED */
+ .long 0xc0000000 /* pr_type. */
+ .long 5f - 4f /* pr_datasz. */
+4:
+ .long 0xa
+5:
+ .p2align 2
+ /* GNU_PROPERTY_X86_ISA_1_NEEDED */
+ .long 0xc0000001 /* pr_type. */
+ .long 5f - 4f /* pr_datasz. */
+4:
+ .long 0x3
+5:
+ .p2align 2
+3:
diff --git a/ld/testsuite/ld-i386/property-x86-2.S b/ld/testsuite/ld-i386/property-x86-2.S
new file mode 100644
index 0000000..f11e1fe
--- /dev/null
+++ b/ld/testsuite/ld-i386/property-x86-2.S
@@ -0,0 +1,25 @@
+ .section ".note.gnu.property", "a"
+ .p2align 2
+ .long 1f - 0f /* name length. */
+ .long 3f - 1f /* data length. */
+ /* NT_GNU_PROPERTY_TYPE_0 */
+ .long 5 /* note type. */
+0:
+ .asciz "GNU" /* vendor name. */
+1:
+ .p2align 2
+ /* GNU_PROPERTY_X86_ISA_1_USED */
+ .long 0xc0000000 /* pr_type. */
+ .long 5f - 4f /* pr_datasz. */
+4:
+ .long 0x3
+5:
+ .p2align 2
+ /* GNU_PROPERTY_X86_ISA_1_NEEDED */
+ .long 0xc0000001 /* pr_type. */
+ .long 5f - 4f /* pr_datasz. */
+4:
+ .long 0xa
+5:
+ .p2align 2
+3: