[PATCH] D34893: [ELF] - Remove use of precomipled binary for invalid-relocation-x64.test

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 30 09:22:47 PDT 2017


grimar created this revision.
Herald added a subscriber: emaste.

Since yaml2obj is now able to parse integer values as relocation types,
there is no need to keep hex edited elf object for this test,
we can produce it on fly, just like this patch do.


https://reviews.llvm.org/D34893

Files:
  test/ELF/invalid/Inputs/invalid-relocation-x64.elf
  test/ELF/invalid/invalid-relocation-x64.test


Index: test/ELF/invalid/invalid-relocation-x64.test
===================================================================
--- test/ELF/invalid/invalid-relocation-x64.test
+++ test/ELF/invalid/invalid-relocation-x64.test
@@ -1,7 +1,8 @@
-## invalid-relocation-x64.elf contains relocations with invalid relocation number.
-## Next yaml code was used to create initial binary. After that it
-## was modified with hex-editor to replace known relocations with fake ones,
-## that have 0x98 and 0x98 numbers.
+# RUN: yaml2obj %s -o %t.o
+# RUN: not ld.lld %t.o -o /dev/null 2>&1 | FileCheck %s
+# CHECK: {{.*}}.o: unknown relocation type: Unknown (152)
+# CHECK: {{.*}}.o: unknown relocation type: Unknown (153)
+
 !ELF
 FileHeader:
   Class:           ELFCLASS64
@@ -20,11 +21,7 @@
     Relocations:
       - Offset:          0x0000000000000000
         Symbol:          ''
-        Type:            R_X86_64_NONE
+        Type:            0x98
       - Offset:          0x0000000000000000
         Symbol:          ''
-        Type:            R_X86_64_NONE
-
-# RUN: not ld.lld %p/Inputs/invalid-relocation-x64.elf -o %t2 2>&1 | FileCheck %s
-# CHECK: {{.*}}invalid-relocation-x64.elf: unknown relocation type: Unknown (152)
-# CHECK: {{.*}}invalid-relocation-x64.elf: unknown relocation type: Unknown (153)
+        Type:            0x99


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34893.104876.patch
Type: text/x-patch
Size: 1334 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170630/2c05bb8c/attachment.bin>


More information about the llvm-commits mailing list