gas: Add a testcase for PR gas/27228
authorH.J. Lu <hjl.tools@gmail.com>
Sun, 24 Jan 2021 12:14:30 +0000 (04:14 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Sun, 24 Jan 2021 12:14:30 +0000 (04:14 -0800)
PR gas/27228
* testsuite/gas/elf/elf.exp: Run pr27228.
* testsuite/gas/elf/pr27228.d: New file.
* testsuite/gas/elf/pr27228.s: Likewise.

gas/ChangeLog
gas/testsuite/gas/elf/elf.exp
gas/testsuite/gas/elf/pr27228.d [new file with mode: 0644]
gas/testsuite/gas/elf/pr27228.s [new file with mode: 0644]

index 4ac29870e630a139b42d54b71013374165c3d45b..8cdcbc5088fb4c1322883cc439cc7857a48282ff 100644 (file)
@@ -1,3 +1,10 @@
+2021-01-24  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR gas/27228
+       * testsuite/gas/elf/elf.exp: Run pr27228.
+       * testsuite/gas/elf/pr27228.d: New file.
+       * testsuite/gas/elf/pr27228.s: Likewise.
+
 2021-01-24  Alan Modra  <amodra@gmail.com>
 
        PR 27228
index 4f7ff6a2e01aeadb5f97f97a5ac16c358a758b2e..4a695dfbaed44a51886d38587f5e8ca27bb24d8c 100644 (file)
@@ -328,4 +328,5 @@ if { [is_elf_format] } then {
 
     run_dump_test "bignums"
     run_dump_test "section-symbol-redef"
+    run_dump_test "pr27228"
 }
diff --git a/gas/testsuite/gas/elf/pr27228.d b/gas/testsuite/gas/elf/pr27228.d
new file mode 100644 (file)
index 0000000..a44a61e
--- /dev/null
@@ -0,0 +1,8 @@
+#as:
+#name: .reloc against undefined local symbol (PR 27228)
+#readelf: -sW
+
+Symbol table '\.symtab' contains [0-9]+ entries:
+#...
+ +[a-f0-9]+: 0+ +0 NOTYPE +GLOBAL DEFAULT +UND .LTHUNK5.lto_priv.0
+#pass
diff --git a/gas/testsuite/gas/elf/pr27228.s b/gas/testsuite/gas/elf/pr27228.s
new file mode 100644 (file)
index 0000000..5ed301d
--- /dev/null
@@ -0,0 +1,5 @@
+       .text
+foo:
+       .reloc  1f,BFD_RELOC_NONE,.LTHUNK5.lto_priv.0
+1:
+       .nop