This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed, PATCH] Add a test for PR ld/22150


	PR ld/22150
	* testsuite/ld-elf/pr22150.vd: New file.
	* testsuite/ld-elf/pr22150.ver: Likewise.
	* testsuite/ld-elf/pr22150a.s: Likewise.
	* testsuite/ld-elf/pr22150b.s: Likewise.
	* testsuite/ld-elf/shared.exp: Run PR ld/22150 tests.
---
 ld/testsuite/ld-elf/pr22150.vd  |  2 ++
 ld/testsuite/ld-elf/pr22150.ver |  6 ++++++
 ld/testsuite/ld-elf/pr22150a.s  |  6 ++++++
 ld/testsuite/ld-elf/pr22150b.s  | 13 +++++++++++++
 ld/testsuite/ld-elf/shared.exp  | 23 +++++++++++++++++++++++
 5 files changed, 50 insertions(+)
 create mode 100644 ld/testsuite/ld-elf/pr22150.vd
 create mode 100644 ld/testsuite/ld-elf/pr22150.ver
 create mode 100644 ld/testsuite/ld-elf/pr22150a.s
 create mode 100644 ld/testsuite/ld-elf/pr22150b.s

diff --git a/ld/testsuite/ld-elf/pr22150.vd b/ld/testsuite/ld-elf/pr22150.vd
new file mode 100644
index 0000000000..d43f7fec83
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr22150.vd
@@ -0,0 +1,2 @@
+
+No version information found in this file.
diff --git a/ld/testsuite/ld-elf/pr22150.ver b/ld/testsuite/ld-elf/pr22150.ver
new file mode 100644
index 0000000000..962d6d2867
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr22150.ver
@@ -0,0 +1,6 @@
+BAR {
+global:
+	bar;
+local:
+	*;
+};
diff --git a/ld/testsuite/ld-elf/pr22150a.s b/ld/testsuite/ld-elf/pr22150a.s
new file mode 100644
index 0000000000..051a965235
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr22150a.s
@@ -0,0 +1,6 @@
+	.text
+	.globl	bar
+	.type	bar, %function
+bar:
+	.byte 0
+	.size	bar, .-bar
diff --git a/ld/testsuite/ld-elf/pr22150b.s b/ld/testsuite/ld-elf/pr22150b.s
new file mode 100644
index 0000000000..dcdf509e5a
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr22150b.s
@@ -0,0 +1,13 @@
+	.section .text._start,"ax",%progbits
+	.globl	_start
+	.type	_start, %function
+_start:
+	.byte 0
+	.size	_start, .-_start
+
+	.section .text.bar,"ax",%progbits
+	.globl	foo
+	.type	foo, %function
+foo:
+	.dc.a bar
+	.size	foo, .-foo
diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp
index eee73778da..2bb0750ec1 100644
--- a/ld/testsuite/ld-elf/shared.exp
+++ b/ld/testsuite/ld-elf/shared.exp
@@ -170,6 +170,29 @@ if { [check_gc_sections_available] } {
 	    "pr21233-3"]]
 }
 
+if { [check_gc_sections_available] } {
+    run_ld_link_tests [list \
+	[list \
+	    "Build pr22150.so" \
+	    "$LFLAGS -shared --version-script pr22150.ver" \
+	    "" \
+	    "$AFLAGS_PIC" \
+	    {pr22150a.s} \
+	    {} \
+	    "pr22150.so" \
+	] \
+	[list \
+	    "Build pr22150" \
+	    "$LFLAGS -e _start --gc-sections" \
+	    "tmpdir/pr22150.so" \
+	    "" \
+	    {pr22150b.s} \
+	    {{readelf -V pr22150.vd}} \
+	    "pr22150" \
+	] \
+    ]
+}
+
 # Check to see if the C compiler works
 if { [which $CC] == 0 } {
     return
-- 
2.13.5


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]