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.exp6
-rw-r--r--ld/testsuite/ld-i386/pr27491-1.s14
-rw-r--r--ld/testsuite/ld-i386/pr27491-1a.d14
-rw-r--r--ld/testsuite/ld-i386/pr27491-1b.d11
-rw-r--r--ld/testsuite/ld-i386/pr27491-1c.d14
-rw-r--r--ld/testsuite/ld-i386/pr27491-2.d22
-rw-r--r--ld/testsuite/ld-i386/pr27491-2.s16
-rw-r--r--ld/testsuite/ld-i386/pr27491-3.d21
-rw-r--r--ld/testsuite/ld-i386/pr27491-3.s14
-rw-r--r--ld/testsuite/ld-i386/pr27491-4.d23
-rw-r--r--ld/testsuite/ld-i386/pr27491-4a.s11
-rw-r--r--ld/testsuite/ld-i386/pr27491-4b.s2
12 files changed, 168 insertions, 0 deletions
diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
index ceb6000..23ab854 100644
--- a/ld/testsuite/ld-i386/i386.exp
+++ b/ld/testsuite/ld-i386/i386.exp
@@ -493,6 +493,12 @@ run_dump_test "property-x86-isa3"
run_dump_test "property-x86-isa4"
run_dump_test "pr26869"
run_dump_test "code16"
+run_dump_test "pr27491-1a"
+run_dump_test "pr27491-1b"
+run_dump_test "pr27491-1c"
+run_dump_test "pr27491-2"
+run_dump_test "pr27491-3"
+run_dump_test "pr27491-4"
if { !([istarget "i?86-*-linux*"]
|| [istarget "i?86-*-gnu*"]
diff --git a/ld/testsuite/ld-i386/pr27491-1.s b/ld/testsuite/ld-i386/pr27491-1.s
new file mode 100644
index 0000000..89155ae
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr27491-1.s
@@ -0,0 +1,14 @@
+ .weak __start_xx
+ .weak __stop_xx
+
+ .text
+ .global foo
+foo:
+ movl __start_xx@got(%ebx), %eax
+ movl __stop_xx@got(%ebx), %eax
+
+ .section xx,"a",unique,0
+ .byte 0
+
+ .section xx,"a",unique,1
+ .byte 1
diff --git a/ld/testsuite/ld-i386/pr27491-1a.d b/ld/testsuite/ld-i386/pr27491-1a.d
new file mode 100644
index 0000000..006c176
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr27491-1a.d
@@ -0,0 +1,14 @@
+#source: pr27491-1.s
+#as: --32
+#ld: --gc-sections -melf_i386 -z start-stop-gc -shared
+#objdump: -dw
+
+.*: +file format elf32-i386
+
+
+Disassembly of section .text:
+
+[a-f0-9]+ <foo>:
+ +[a-f0-9]+: 8b 83 ([0-9a-f]{2} ){4}[ \t]+mov +-0x[a-f0-9]+\(%ebx\),%eax
+ +[a-f0-9]+: 8b 83 ([0-9a-f]{2} ){4}[ \t]+mov +-0x[a-f0-9]+\(%ebx\),%eax
+#pass
diff --git a/ld/testsuite/ld-i386/pr27491-1b.d b/ld/testsuite/ld-i386/pr27491-1b.d
new file mode 100644
index 0000000..69b9ac3
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr27491-1b.d
@@ -0,0 +1,11 @@
+#source: pr27491-1.s
+#as: --32
+#ld: --gc-sections -melf_i386 -z start-stop-gc -shared
+#nm: -n
+
+#failif
+#...
+[a-f0-9]+ R __start_xx
+#...
+[a-f0-9]+ R __stop_xx
+#...
diff --git a/ld/testsuite/ld-i386/pr27491-1c.d b/ld/testsuite/ld-i386/pr27491-1c.d
new file mode 100644
index 0000000..730e975
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr27491-1c.d
@@ -0,0 +1,14 @@
+#source: pr27491-1.s
+#as: --32
+#ld: --gc-sections -melf_i386 -shared
+#objdump: -dw
+
+.*: +file format elf32-i386
+
+
+Disassembly of section .text:
+
+[a-f0-9]+ <foo>:
+ +[a-f0-9]+: 8d 83 ([0-9a-f]{2} ){4}[ \t]+lea +-0x[a-f0-9]+\(%ebx\),%eax
+ +[a-f0-9]+: 8d 83 ([0-9a-f]{2} ){4}[ \t]+lea +-0x[a-f0-9]+\(%ebx\),%eax
+#pass
diff --git a/ld/testsuite/ld-i386/pr27491-2.d b/ld/testsuite/ld-i386/pr27491-2.d
new file mode 100644
index 0000000..02b310a
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr27491-2.d
@@ -0,0 +1,22 @@
+#as: --32
+#ld: --gc-sections -melf_i386 -z start-stop-gc -shared
+#objdump: --syms -dw
+
+.*: +file format elf32-i386
+
+
+SYMBOL TABLE:
+#...
+[a-f0-9]+ g xx [a-f0-9]+ \.protected __stop_xx
+#...
+[a-f0-9]+ g xx [a-f0-9]+ \.protected __start_xx
+#...
+
+
+Disassembly of section .text:
+
+[a-f0-9]+ <foo>:
+ +[a-f0-9]+: 8d 83 ([0-9a-f]{2} ){4}[ \t]+lea +-0x[a-f0-9]+\(%ebx\),%eax
+ +[a-f0-9]+: 8d 83 ([0-9a-f]{2} ){4}[ \t]+lea +-0x[a-f0-9]+\(%ebx\),%eax
+ +[a-f0-9]+: 8d 83 ([0-9a-f]{2} ){4}[ \t]+lea +-0x[a-f0-9]+\(%ebx\),%eax
+#pass
diff --git a/ld/testsuite/ld-i386/pr27491-2.s b/ld/testsuite/ld-i386/pr27491-2.s
new file mode 100644
index 0000000..17871dd
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr27491-2.s
@@ -0,0 +1,16 @@
+ .weak __start_xx
+ .weak __stop_xx
+
+ .text
+ .global foo
+foo:
+ movl __start_xx@got(%ebx), %eax
+ movl __stop_xx@got(%ebx), %eax
+ leal bar1@got(%ebx), %eax
+
+ .section xx,"a",unique,0
+bar1:
+ .byte 0
+
+ .section xx,"a",unique,1
+ .byte 1
diff --git a/ld/testsuite/ld-i386/pr27491-3.d b/ld/testsuite/ld-i386/pr27491-3.d
new file mode 100644
index 0000000..7749570
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr27491-3.d
@@ -0,0 +1,21 @@
+#as: --32
+#ld: --gc-sections -melf_i386 -z start-stop-gc -shared
+#objdump: --syms -dw
+
+.*: +file format elf32-i386
+
+
+SYMBOL TABLE:
+#...
+[a-f0-9]+ g xx [a-f0-9]+ \.protected __stop_xx
+#...
+[a-f0-9]+ g xx [a-f0-9]+ \.protected __start_xx
+#...
+
+
+Disassembly of section .text:
+
+[a-f0-9]+ <foo>:
+ +[a-f0-9]+: 8d 83 ([0-9a-f]{2} ){4}[ \t]+lea +-0x[a-f0-9]+\(%ebx\),%eax
+ +[a-f0-9]+: 8d 83 ([0-9a-f]{2} ){4}[ \t]+lea +-0x[a-f0-9]+\(%ebx\),%eax
+#pass
diff --git a/ld/testsuite/ld-i386/pr27491-3.s b/ld/testsuite/ld-i386/pr27491-3.s
new file mode 100644
index 0000000..85fc3dd
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr27491-3.s
@@ -0,0 +1,14 @@
+ .weak __start_xx
+ .weak __stop_xx
+
+ .text
+ .global foo
+foo:
+ movl __start_xx@got(%ebx), %eax
+ movl __stop_xx@got(%ebx), %eax
+
+ .section xx,"a",unique,0
+ .byte 0
+
+ .section xx,"aR",unique,1
+ .byte 1
diff --git a/ld/testsuite/ld-i386/pr27491-4.d b/ld/testsuite/ld-i386/pr27491-4.d
new file mode 100644
index 0000000..4a305da
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr27491-4.d
@@ -0,0 +1,23 @@
+#source: pr27491-4a.s
+#source: pr27491-4b.s
+#as: --32
+#ld: --gc-sections -melf_i386 -z start-stop-gc -shared
+#objdump: --syms -dw
+
+.*: +file format elf32-i386
+
+
+SYMBOL TABLE:
+#...
+[a-f0-9]+ g xx [a-f0-9]+ \.protected __stop_xx
+#...
+[a-f0-9]+ g xx [a-f0-9]+ \.protected __start_xx
+#...
+
+
+Disassembly of section .text:
+
+[a-f0-9]+ <foo>:
+ +[a-f0-9]+: 8d 83 ([0-9a-f]{2} ){4}[ \t]+lea +-0x[a-f0-9]+\(%ebx\),%eax
+ +[a-f0-9]+: 8d 83 ([0-9a-f]{2} ){4}[ \t]+lea +-0x[a-f0-9]+\(%ebx\),%eax
+#pass
diff --git a/ld/testsuite/ld-i386/pr27491-4a.s b/ld/testsuite/ld-i386/pr27491-4a.s
new file mode 100644
index 0000000..a183b2f
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr27491-4a.s
@@ -0,0 +1,11 @@
+ .weak __start_xx
+ .weak __stop_xx
+
+ .text
+ .global foo
+foo:
+ movl __start_xx@got(%ebx), %eax
+ movl __stop_xx@got(%ebx), %eax
+
+ .section xx,"a",unique,0
+ .byte 0
diff --git a/ld/testsuite/ld-i386/pr27491-4b.s b/ld/testsuite/ld-i386/pr27491-4b.s
new file mode 100644
index 0000000..d0b83e9
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr27491-4b.s
@@ -0,0 +1,2 @@
+ .section xx,"aR",unique,1
+ .byte 1