aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ld-elf/pr22649-1.s4
-rw-r--r--ld/testsuite/ld-elf/pr22649-2a.s8
-rw-r--r--ld/testsuite/ld-elf/pr22649-2b.s7
-rw-r--r--ld/testsuite/ld-elf/pr22649.msg1
-rw-r--r--ld/testsuite/ld-elf/shared.exp45
5 files changed, 65 insertions, 0 deletions
diff --git a/ld/testsuite/ld-elf/pr22649-1.s b/ld/testsuite/ld-elf/pr22649-1.s
new file mode 100644
index 0000000..9a7da7e
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr22649-1.s
@@ -0,0 +1,4 @@
+ .data
+ .globl foo
+foo:
+ .dc.a bar
diff --git a/ld/testsuite/ld-elf/pr22649-2a.s b/ld/testsuite/ld-elf/pr22649-2a.s
new file mode 100644
index 0000000..b5908b0
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr22649-2a.s
@@ -0,0 +1,8 @@
+ .data
+ .hidden foo
+ .hidden bar
+ .globl foo
+ .globl bar
+foo:
+bar:
+ .dc.a foo
diff --git a/ld/testsuite/ld-elf/pr22649-2b.s b/ld/testsuite/ld-elf/pr22649-2b.s
new file mode 100644
index 0000000..999686c
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr22649-2b.s
@@ -0,0 +1,7 @@
+ .data
+ .hidden foo
+ .globl foo
+ .globl bar
+foo:
+bar:
+ .dc.a foo
diff --git a/ld/testsuite/ld-elf/pr22649.msg b/ld/testsuite/ld-elf/pr22649.msg
new file mode 100644
index 0000000..b4e45bd
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr22649.msg
@@ -0,0 +1 @@
+.*: Removing unused section '\.data' in file 'tmpdir/pr22649-2.*\.o'
diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp
index 0c54568..95bac37 100644
--- a/ld/testsuite/ld-elf/shared.exp
+++ b/ld/testsuite/ld-elf/shared.exp
@@ -81,6 +81,51 @@ run_ld_link_tests [list \
{} \
"pr22471" \
] \
+ [list \
+ "Build pr22649-1.so" \
+ "$LFLAGS -shared" \
+ "" \
+ "$AFLAGS_PIC" \
+ {pr22649-1.s} \
+ {} \
+ "pr22649-1.so" \
+ ] \
+ [list \
+ "Build pr22649-2a.so" \
+ "$LFLAGS -shared -gc-sections -print-gc-sections" \
+ "" \
+ "$AFLAGS_PIC" \
+ {pr22649-2a.s} \
+ {{ld pr22649.msg}} \
+ "pr22649-2a.so" \
+ ] \
+ [list \
+ "Build pr22649-2b.so" \
+ "$LFLAGS -shared -gc-sections -print-gc-sections" \
+ "tmpdir/pr22649-1.so" \
+ "$AFLAGS_PIC" \
+ {pr22649-2a.s} \
+ {{ld pr22649.msg}} \
+ "pr22649-2b.so" \
+ ] \
+ [list \
+ "Build pr22649-2c.so" \
+ "$LFLAGS -shared -gc-sections -print-gc-sections" \
+ "" \
+ "$AFLAGS_PIC" \
+ {pr22649-2b.s} \
+ {} \
+ "pr22649-2b.so" \
+ ] \
+ [list \
+ "Build pr22649-2d.so" \
+ "$LFLAGS -shared -gc-sections -print-gc-sections" \
+ "tmpdir/pr22649-1.so" \
+ "$AFLAGS_PIC" \
+ {pr22649-2b.s} \
+ {} \
+ "pr22649-2b.so" \
+ ] \
]
run_ld_link_tests [list \