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 testcase for "ld -d"


"ld -d" assigns space to common symbols even if a relocatable output
file is specified (with '-r').

	PR ld/21904
	* testsuite/ld-elf/pr21904.d: New file.
	* testsuite/ld-elf/pr21904.s: Likewise.
---
 ld/ChangeLog                  | 6 ++++++
 ld/testsuite/ld-elf/pr21904.d | 6 ++++++
 ld/testsuite/ld-elf/pr21904.s | 5 +++++
 3 files changed, 17 insertions(+)
 create mode 100644 ld/testsuite/ld-elf/pr21904.d
 create mode 100644 ld/testsuite/ld-elf/pr21904.s

diff --git a/ld/ChangeLog b/ld/ChangeLog
index 99c1455438..2cf0d4994b 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-04  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR ld/21904
+	* testsuite/ld-elf/pr21904.d: New file.
+	* testsuite/ld-elf/pr21904.s: Likewise.
+
 2017-08-03  Nick Clifton  <nickc@redhat.com>
 
 	PR ld/21884
diff --git a/ld/testsuite/ld-elf/pr21904.d b/ld/testsuite/ld-elf/pr21904.d
new file mode 100644
index 0000000000..1d464fc7c4
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr21904.d
@@ -0,0 +1,6 @@
+#ld: -d -r
+#readelf: -s
+
+#...
+.*: [0-9a-f]+ +4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ foo
+#pass
diff --git a/ld/testsuite/ld-elf/pr21904.s b/ld/testsuite/ld-elf/pr21904.s
new file mode 100644
index 0000000000..587a226fcf
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr21904.s
@@ -0,0 +1,5 @@
+	.ifdef	HPUX
+foo	.comm	4
+	.else
+	.comm	foo, 4, 4
+	.endif
-- 
2.13.3


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