Add a testcase for "ld -d"
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 4 Aug 2017 12:39:56 +0000 (05:39 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 4 Aug 2017 12:39:56 +0000 (05:39 -0700)
"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
ld/testsuite/ld-elf/pr21904.d [new file with mode: 0644]
ld/testsuite/ld-elf/pr21904.s [new file with mode: 0644]

index 99c14554387f27838b2a3ff31365a7482c62391e..2cf0d4994b91346d7002825844c9b7d73d8ac8cc 100644 (file)
@@ -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 (file)
index 0000000..1d464fc
--- /dev/null
@@ -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 (file)
index 0000000..587a226
--- /dev/null
@@ -0,0 +1,5 @@
+       .ifdef  HPUX
+foo    .comm   4
+       .else
+       .comm   foo, 4, 4
+       .endif