aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-scripts
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-scripts')
-rw-r--r--ld/testsuite/ld-scripts/align.exp3
-rw-r--r--ld/testsuite/ld-scripts/align3.d3
-rw-r--r--ld/testsuite/ld-scripts/align3.t10
-rw-r--r--ld/testsuite/ld-scripts/align4.d3
-rw-r--r--ld/testsuite/ld-scripts/align4.t10
-rw-r--r--ld/testsuite/ld-scripts/align5.d7
-rw-r--r--ld/testsuite/ld-scripts/align5.t12
-rw-r--r--ld/testsuite/ld-scripts/exclude-file-5.d5
-rw-r--r--ld/testsuite/ld-scripts/exclude-file-5.map8
-rw-r--r--ld/testsuite/ld-scripts/exclude-file-5.t11
-rw-r--r--ld/testsuite/ld-scripts/exclude-file-6.d5
-rw-r--r--ld/testsuite/ld-scripts/exclude-file-6.map8
-rw-r--r--ld/testsuite/ld-scripts/exclude-file-6.t11
-rw-r--r--ld/testsuite/ld-scripts/exclude-file-7.d5
-rw-r--r--ld/testsuite/ld-scripts/exclude-file-7.map8
-rw-r--r--ld/testsuite/ld-scripts/exclude-file-7.t11
16 files changed, 120 insertions, 0 deletions
diff --git a/ld/testsuite/ld-scripts/align.exp b/ld/testsuite/ld-scripts/align.exp
index a41db72..ba229af 100644
--- a/ld/testsuite/ld-scripts/align.exp
+++ b/ld/testsuite/ld-scripts/align.exp
@@ -47,6 +47,9 @@ if ![ld_link $ld tmpdir/align "$LDFLAGS -T $srcdir/$subdir/align.t tmpdir/align.
if ![is_aout_format] {
run_dump_test align2a
run_dump_test align2b
+ run_dump_test align3
+ run_dump_test align4
+ run_dump_test align5
}
run_dump_test align2c
set LDFLAGS "$saved_LDFLAGS"
diff --git a/ld/testsuite/ld-scripts/align3.d b/ld/testsuite/ld-scripts/align3.d
new file mode 100644
index 0000000..384d91a
--- /dev/null
+++ b/ld/testsuite/ld-scripts/align3.d
@@ -0,0 +1,3 @@
+# source: align2a.s
+# ld: -T align3.t
+# error: .*:4: syntax error
diff --git a/ld/testsuite/ld-scripts/align3.t b/ld/testsuite/ld-scripts/align3.t
new file mode 100644
index 0000000..5c9e5bf
--- /dev/null
+++ b/ld/testsuite/ld-scripts/align3.t
@@ -0,0 +1,10 @@
+SECTIONS
+{
+ .text : {
+ SORT_BY_ALIGNMENT (*) (.text .text.*)
+ }
+
+ .data : {
+ SORT_BY_ALIGNMENT (*) (.data .data.*)
+ }
+} \ No newline at end of file
diff --git a/ld/testsuite/ld-scripts/align4.d b/ld/testsuite/ld-scripts/align4.d
new file mode 100644
index 0000000..661738a
--- /dev/null
+++ b/ld/testsuite/ld-scripts/align4.d
@@ -0,0 +1,3 @@
+# source: align2a.s
+# ld: -T align4.t
+# error: .*:4: syntax error
diff --git a/ld/testsuite/ld-scripts/align4.t b/ld/testsuite/ld-scripts/align4.t
new file mode 100644
index 0000000..fc80905
--- /dev/null
+++ b/ld/testsuite/ld-scripts/align4.t
@@ -0,0 +1,10 @@
+SECTIONS
+{
+ .text : {
+ SORT_BY_INIT_PRIORITY (*) (.text .text.*)
+ }
+
+ .data : {
+ SORT_BY_INIT_PRIORITY (*) (.data .data.*)
+ }
+} \ No newline at end of file
diff --git a/ld/testsuite/ld-scripts/align5.d b/ld/testsuite/ld-scripts/align5.d
new file mode 100644
index 0000000..880b6fb
--- /dev/null
+++ b/ld/testsuite/ld-scripts/align5.d
@@ -0,0 +1,7 @@
+# source: align2a.s
+# ld: -T align5.t
+# nm: -n
+
+#...
+.*foo
+#... \ No newline at end of file
diff --git a/ld/testsuite/ld-scripts/align5.t b/ld/testsuite/ld-scripts/align5.t
new file mode 100644
index 0000000..a0b33e5
--- /dev/null
+++ b/ld/testsuite/ld-scripts/align5.t
@@ -0,0 +1,12 @@
+SECTIONS
+{
+ .text : {
+ SORT_NONE (*) (.text .text.*)
+ }
+
+ .data : {
+ SORT_NONE (*) (.data .data.*)
+ foo = .;
+ }
+ /DISCARD/ : {*(*)}
+}
diff --git a/ld/testsuite/ld-scripts/exclude-file-5.d b/ld/testsuite/ld-scripts/exclude-file-5.d
new file mode 100644
index 0000000..dc7040b
--- /dev/null
+++ b/ld/testsuite/ld-scripts/exclude-file-5.d
@@ -0,0 +1,5 @@
+#source: exclude-file-a.s
+#source: exclude-file-b.s
+#ld: -T exclude-file-5.t
+#map: exclude-file-5.map
+
diff --git a/ld/testsuite/ld-scripts/exclude-file-5.map b/ld/testsuite/ld-scripts/exclude-file-5.map
new file mode 100644
index 0000000..9148fd6
--- /dev/null
+++ b/ld/testsuite/ld-scripts/exclude-file-5.map
@@ -0,0 +1,8 @@
+#...
+\.data +0x[0-9a-f]+ +0x[0-9a-f]+
+ \*\(SORT_BY_NAME\(EXCLUDE_FILE\(\*-b\.o\) \.data\)\)
+ \.data +0x[0-9a-f]+ +0x[0-9a-f]+ tmpdir/exclude-file-a\.o
+ \*\(SORT_BY_NAME\(EXCLUDE_FILE\(\*-a\.o\) \.data\.\*\)\)
+ \.data\.1 +0x[0-9a-f]+ +0x[0-9a-f]+ tmpdir/exclude-file-b\.o
+
+#... \ No newline at end of file
diff --git a/ld/testsuite/ld-scripts/exclude-file-5.t b/ld/testsuite/ld-scripts/exclude-file-5.t
new file mode 100644
index 0000000..e20f5ae
--- /dev/null
+++ b/ld/testsuite/ld-scripts/exclude-file-5.t
@@ -0,0 +1,11 @@
+SECTIONS
+{
+ .data : {
+ * (SORT_BY_NAME (EXCLUDE_FILE (*-b.o) .data))
+ * (SORT_BY_NAME (SORT_BY_NAME (EXCLUDE_FILE (*-a.o) .data.*)))
+ }
+
+ /DISCARD/ : {
+ * (*)
+ }
+}
diff --git a/ld/testsuite/ld-scripts/exclude-file-6.d b/ld/testsuite/ld-scripts/exclude-file-6.d
new file mode 100644
index 0000000..7bc9d65
--- /dev/null
+++ b/ld/testsuite/ld-scripts/exclude-file-6.d
@@ -0,0 +1,5 @@
+#source: exclude-file-a.s
+#source: exclude-file-b.s
+#ld: -T exclude-file-6.t
+#map: exclude-file-6.map
+
diff --git a/ld/testsuite/ld-scripts/exclude-file-6.map b/ld/testsuite/ld-scripts/exclude-file-6.map
new file mode 100644
index 0000000..42e1b38
--- /dev/null
+++ b/ld/testsuite/ld-scripts/exclude-file-6.map
@@ -0,0 +1,8 @@
+#...
+\.data +0x[0-9a-f]+ +0x[0-9a-f]+
+ \*\(SORT_BY_ALIGNMENT\(SORT_BY_NAME\(EXCLUDE_FILE\(\*-b\.o\) \.data\)\)\)
+ \.data +0x[0-9a-f]+ +0x[0-9a-f]+ tmpdir/exclude-file-a\.o
+ \*\(SORT_BY_NAME\(SORT_BY_ALIGNMENT\(EXCLUDE_FILE\(\*-a\.o\) \.data\.\*\)\)\)
+ \.data\.1 +0x[0-9a-f]+ +0x[0-9a-f]+ tmpdir/exclude-file-b\.o
+
+#... \ No newline at end of file
diff --git a/ld/testsuite/ld-scripts/exclude-file-6.t b/ld/testsuite/ld-scripts/exclude-file-6.t
new file mode 100644
index 0000000..437e240
--- /dev/null
+++ b/ld/testsuite/ld-scripts/exclude-file-6.t
@@ -0,0 +1,11 @@
+SECTIONS
+{
+ .data : {
+ * (SORT_BY_ALIGNMENT (SORT_BY_NAME (EXCLUDE_FILE (*-b.o) .data)))
+ * (SORT_BY_NAME (SORT_BY_ALIGNMENT (EXCLUDE_FILE (*-a.o) .data.*)))
+ }
+
+ /DISCARD/ : {
+ * (*)
+ }
+}
diff --git a/ld/testsuite/ld-scripts/exclude-file-7.d b/ld/testsuite/ld-scripts/exclude-file-7.d
new file mode 100644
index 0000000..8970415
--- /dev/null
+++ b/ld/testsuite/ld-scripts/exclude-file-7.d
@@ -0,0 +1,5 @@
+#source: exclude-file-a.s
+#source: exclude-file-b.s
+#ld: -T exclude-file-7.t
+#map: exclude-file-7.map
+
diff --git a/ld/testsuite/ld-scripts/exclude-file-7.map b/ld/testsuite/ld-scripts/exclude-file-7.map
new file mode 100644
index 0000000..eb1d0a8
--- /dev/null
+++ b/ld/testsuite/ld-scripts/exclude-file-7.map
@@ -0,0 +1,8 @@
+#...
+\.data +0x[0-9a-f]+ +0x[0-9a-f]+
+ \*\(SORT_BY_INIT_PRIORITY\(EXCLUDE_FILE\(\*-b\.o\) \.data\)\)
+ \.data +0x[0-9a-f]+ +0x[0-9a-f]+ tmpdir/exclude-file-a\.o
+ \*\(SORT_BY_ALIGNMENT\(EXCLUDE_FILE\(\*-a\.o\) \.data\.\*\)\)
+ \.data\.1 +0x[0-9a-f]+ +0x[0-9a-f]+ tmpdir/exclude-file-b\.o
+
+#... \ No newline at end of file
diff --git a/ld/testsuite/ld-scripts/exclude-file-7.t b/ld/testsuite/ld-scripts/exclude-file-7.t
new file mode 100644
index 0000000..200096e
--- /dev/null
+++ b/ld/testsuite/ld-scripts/exclude-file-7.t
@@ -0,0 +1,11 @@
+SECTIONS
+{
+ .data : {
+ * (SORT_BY_INIT_PRIORITY (EXCLUDE_FILE (*-b.o) .data))
+ * (SORT_BY_ALIGNMENT (SORT_BY_ALIGNMENT (EXCLUDE_FILE (*-a.o) .data.*)))
+ }
+
+ /DISCARD/ : {
+ * (*)
+ }
+}