Add a test for PR ld/21384
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 2 May 2017 20:54:22 +0000 (13:54 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 2 May 2017 20:54:22 +0000 (13:54 -0700)
PR ld/21384
* testsuite/ld-elf/pr21384.d: New file.
* testsuite/ld-elf/pr21384.dl: Likewise.
* testsuite/ld-elf/pr21384.ld: Likewise.
* testsuite/ld-elf/pr21384.s: Likewise.

ld/ChangeLog
ld/testsuite/ld-elf/pr21384.d [new file with mode: 0644]
ld/testsuite/ld-elf/pr21384.dl [new file with mode: 0644]
ld/testsuite/ld-elf/pr21384.ld [new file with mode: 0644]
ld/testsuite/ld-elf/pr21384.s [new file with mode: 0644]

index 238404d..4fc4e1d 100644 (file)
@@ -1,3 +1,11 @@
+2017-05-02  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/21384
+       * testsuite/ld-elf/pr21384.d: New file.
+       * testsuite/ld-elf/pr21384.dl: Likewise.
+       * testsuite/ld-elf/pr21384.ld: Likewise.
+       * testsuite/ld-elf/pr21384.s: Likewise.
+
 2017-05-01  H.J. Lu  <hongjiu.lu@intel.com>
 
        * testsuite/ld-i386/tls.exp: Run GNU2 TLS tests only if there
diff --git a/ld/testsuite/ld-elf/pr21384.d b/ld/testsuite/ld-elf/pr21384.d
new file mode 100644 (file)
index 0000000..5a3aedc
--- /dev/null
@@ -0,0 +1,11 @@
+#ld: -T pr21384.ld --dynamic-list $srcdir/$subdir/pr21384.dl --no-dynamic-linker
+#readelf : --dyn-syms --wide
+#target: *-*-linux* *-*-gnu* *-*-solaris*
+
+Symbol table '\.dynsym' contains [0-9]+ entries:
+ +Num: +Value +Size Type +Bind +Vis +Ndx Name
+ +0: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND +
+#...
+ +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +GLOBAL +DEFAULT +[0-9]+ +edata
+ +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +GLOBAL +DEFAULT +[0-9]+ +fdata
+#pass
diff --git a/ld/testsuite/ld-elf/pr21384.dl b/ld/testsuite/ld-elf/pr21384.dl
new file mode 100644 (file)
index 0000000..b164dc0
--- /dev/null
@@ -0,0 +1,4 @@
+{
+  fdata;
+  edata;
+};
diff --git a/ld/testsuite/ld-elf/pr21384.ld b/ld/testsuite/ld-elf/pr21384.ld
new file mode 100644 (file)
index 0000000..034887d
--- /dev/null
@@ -0,0 +1,22 @@
+SECTIONS
+{
+  .data :
+  {
+    fdata = .;
+    *(.data)
+    edata = .;
+  }
+  .dynamic : { *(.dynamic) }
+  .hash : { *(.hash) }
+  .dynsym : { *(.dynsym) }
+  .dynstr : { *(.dynstr) }
+  .gnu.version : { *(.gnu.version) }
+  .gnu.version_d : { *(.gnu.version_d) }
+  .shstrtab : { *(.shstrtab) }
+  .symtab : { *(.symtab) }
+  .strtab : { *(.strtab) }
+  .plt : { *(.plt) }
+  .got.plt : { *(.got.plt) }
+  .got : { *(.got) }
+  /DISCARD/ : { *(*) }
+}
diff --git a/ld/testsuite/ld-elf/pr21384.s b/ld/testsuite/ld-elf/pr21384.s
new file mode 100644 (file)
index 0000000..ece49d5
--- /dev/null
@@ -0,0 +1,2 @@
+       .data
+       .byte   0