This is the mail archive of the binutils-cvs@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]

[binutils-gdb] ld: Add a testcase for PR ld/22471


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=08f650e6b657e59959d7db8af100720721bd10a2

commit 08f650e6b657e59959d7db8af100720721bd10a2
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Nov 29 04:20:48 2017 -0800

    ld: Add a testcase for PR ld/22471
    
    	PR ld/22471
    	* testsuite/ld-elf/pr22471.t: New file.
    	* testsuite/ld-elf/pr22471a.s: Likewise.
    	* testsuite/ld-elf/pr22471b.s: Likewise.
    	* testsuite/ld-elf/shared.exp (ASFLAGS): Define UNDERSCORE for
    	underscore targets.
    	Run PR ld/22471 tests.

Diff:
---
 ld/ChangeLog                   | 10 ++++++++++
 ld/testsuite/ld-elf/pr22471.t  |  1 +
 ld/testsuite/ld-elf/pr22471a.s |  1 +
 ld/testsuite/ld-elf/pr22471b.s | 17 +++++++++++++++++
 ld/testsuite/ld-elf/shared.exp | 34 ++++++++++++++++++++++++++++++++++
 5 files changed, 63 insertions(+)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index 9bf3c3e..a6de996 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,13 @@
+2017-11-29  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR ld/22471
+	* testsuite/ld-elf/pr22471.t: New file.
+	* testsuite/ld-elf/pr22471a.s: Likewise.
+	* testsuite/ld-elf/pr22471b.s: Likewise.
+	* testsuite/ld-elf/shared.exp (ASFLAGS): Define UNDERSCORE for
+	underscore targets.
+	Run PR ld/22471 tests.
+
 2017-11-29  Stefan Stroe  <stroestefan@gmail.com>
 
 	* po/Make-in (datadir): Define as @datadir@.
diff --git a/ld/testsuite/ld-elf/pr22471.t b/ld/testsuite/ld-elf/pr22471.t
new file mode 100644
index 0000000..8862dc2
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr22471.t
@@ -0,0 +1 @@
+{ local: *; };
diff --git a/ld/testsuite/ld-elf/pr22471a.s b/ld/testsuite/ld-elf/pr22471a.s
new file mode 100644
index 0000000..3bb6a92
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr22471a.s
@@ -0,0 +1 @@
+# Empty input.
diff --git a/ld/testsuite/ld-elf/pr22471b.s b/ld/testsuite/ld-elf/pr22471b.s
new file mode 100644
index 0000000..f4edad0
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr22471b.s
@@ -0,0 +1,17 @@
+	.type start,"function"
+	.global start
+start:
+	.type _start,"function"
+	.global _start
+_start:
+	.type __start,"function"
+	.global __start
+__start:
+	.type main,"function"
+	.global main
+main:
+  .ifdef UNDERSCORE
+	.dc.a ___bss_start
+  .else
+	.dc.a __bss_start
+  .endif
diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp
index a40f8e0..7514eb1 100644
--- a/ld/testsuite/ld-elf/shared.exp
+++ b/ld/testsuite/ld-elf/shared.exp
@@ -47,6 +47,40 @@ if [istarget "tic6x-*-*"] {
     append LFLAGS " -melf32_tic6x_le"
 }
 
+if [is_underscore_target] {
+    set ASFLAGS "$ASFLAGS --defsym UNDERSCORE=1"
+}
+
+run_ld_link_tests [list \
+    [list \
+	"Build pr22471a.so" \
+	"$LFLAGS -shared" \
+	"" \
+	"$AFLAGS_PIC" \
+	{pr22471a.s} \
+	{} \
+	"pr22471a.so" \
+    ] \
+    [list \
+	"Build pr22471b.so" \
+	"$LFLAGS -shared --version-script pr22471.t" \
+	"tmpdir/pr22471a.so" \
+	"$AFLAGS_PIC" \
+	{pr22471a.s} \
+	{} \
+	"pr22471b.so" \
+    ] \
+    [list \
+	"Build pr22471" \
+	"$LFLAGS -rpath-link ." \
+	"tmpdir/pr22471b.so" \
+	"" \
+	{pr22471b.s} \
+	{} \
+	"pr22471" \
+    ] \
+]
+
 # PR ld/20828 check for correct dynamic symbol table entries where:
 # - symbols have been defined with a linker script,
 # - the same symbols have been seen in shared library used in the link,


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