binutils/testsuite: Verify the handling of invalid `r_sym' in relocation
[deliverable/binutils-gdb.git] / binutils / testsuite / binutils-all / objcopy.exp
index 0639fe5bf98297302b8342fc9872bca9c37dbcbf..532bdc6ac76bf891b9a4c2c6ba1a01a6c9c5adfa 100644 (file)
@@ -1107,6 +1107,22 @@ if [is_elf_format] {
        set reloc_format rela
     }
     run_dump_test "strip-13" [list [list source strip-13${reloc_format}.s]]
+    # Select a relocation number that corresponds to one actually
+    # supported by the target and ABI being tested.
+    if { [istarget "aarch64*-*"] } {
+       set reloc 259
+    } elseif { [istarget "ia64*-*"] \
+              || [istarget "m32r*-*"] \
+              || [istarget "v850*-*"] } {
+       set reloc 50
+    } else {
+       set reloc 1
+    }
+    run_dump_test "strip-14" [list \
+                               [list source strip-14${reloc_format}.s] \
+                               [list as "--defsym RELOC=${reloc}"] \
+                               [list as [expr {[is_elf64 tmpdir/bintest.o] \
+                                   ? "--defsym ELF64=1" : ""}]]]
 
     # This requires STB_GNU_UNIQUE support with OSABI set to GNU.
     if { [supports_gnu_unique] } {
This page took 0.025681 seconds and 4 git commands to generate.