aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-elf
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-elf')
-rw-r--r--ld/testsuite/ld-elf/elf.exp14
-rw-r--r--ld/testsuite/ld-elf/pr20995.r5
-rw-r--r--ld/testsuite/ld-elf/pr20995a.s11
-rw-r--r--ld/testsuite/ld-elf/pr20995b.s13
4 files changed, 43 insertions, 0 deletions
diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp
index f93ad46..9b1fbeb 100644
--- a/ld/testsuite/ld-elf/elf.exp
+++ b/ld/testsuite/ld-elf/elf.exp
@@ -127,6 +127,20 @@ if { [check_shared_lib_support] } then {
{symbolic-func.s} {{readelf {-r --wide} symbolic-func.r}}
"symbolic-func.so"}
}
+ # xfail on tic6x due to non-PIC/non-PID warnings
+ setup_xfail "tic6x-*-*"
+ run_ld_link_tests {
+ {"Build pr20995.so"
+ "-shared" "" ""
+ {pr20995b.s} {} "pr20995.so"}
+ }
+ # These targets don't copy dynamic variables into .bss.
+ setup_xfail "alpha-*-*" "bfin-*-*" "ia64-*-*" "xtensa-*-*"
+ run_ld_link_tests {
+ {"pr20995"
+ "" "tmpdir/pr20995.so" ""
+ {pr20995a.s} {{readelf {-S --wide} pr20995.r}} "pr20995"}
+ }
}
set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
diff --git a/ld/testsuite/ld-elf/pr20995.r b/ld/testsuite/ld-elf/pr20995.r
new file mode 100644
index 0000000..7336de6
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr20995.r
@@ -0,0 +1,5 @@
+#...
+.* \.data\.rel\.ro +PROGBITS +[^ ]+ [^ ]+ [^ ]*[1-9a-f]0* .*
+#...
+.* \.bss +NOBITS +[^ ]+ [^ ]+ [^ ]*[1-9a-f]0* .*
+#...
diff --git a/ld/testsuite/ld-elf/pr20995a.s b/ld/testsuite/ld-elf/pr20995a.s
new file mode 100644
index 0000000..8da589c
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr20995a.s
@@ -0,0 +1,11 @@
+ .text
+ .global start
+start:
+ .global _start
+_start:
+ .global __start
+__start:
+ .global main
+main:
+ .dc.a rw
+ .dc.a ro
diff --git a/ld/testsuite/ld-elf/pr20995b.s b/ld/testsuite/ld-elf/pr20995b.s
new file mode 100644
index 0000000..7ff76ee
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr20995b.s
@@ -0,0 +1,13 @@
+ .data
+ .type rw,%object
+ .globl rw
+rw:
+ .dc.a 0
+ .size rw, . - rw
+
+ .text
+ .type ro,%object
+ .globl ro
+ro:
+ .dc.a 0
+ .size ro, . - ro