[PATCH] D34758: [YAML] - Teach yaml2obj/obj2yaml to work with numeric relocation values.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 29 08:34:18 PDT 2017
grimar updated this revision to Diff 104657.
grimar added a comment.
- Change implementation just to use IO.enumFallback​() instead all code.
https://reviews.llvm.org/D34758
Files:
lib/ObjectYAML/ELFYAML.cpp
test/Object/X86/yaml-elf-x86-rel-broken.yaml
Index: test/Object/X86/yaml-elf-x86-rel-broken.yaml
===================================================================
--- test/Object/X86/yaml-elf-x86-rel-broken.yaml
+++ test/Object/X86/yaml-elf-x86-rel-broken.yaml
@@ -0,0 +1,48 @@
+# RUN: yaml2obj %s > %t
+# RUN: obj2yaml %t | FileCheck %s
+
+# CHECK: --- !ELF
+# CHECK-NEXT: FileHeader:
+# CHECK-NEXT: Class: ELFCLASS32
+# CHECK-NEXT: Data: ELFDATA2LSB
+# CHECK-NEXT: Type: ET_REL
+# CHECK-NEXT: Machine: EM_386
+# CHECK-NEXT: Sections:
+# CHECK-NEXT: - Name: .text
+# CHECK-NEXT: Type: SHT_PROGBITS
+# CHECK-NEXT: Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
+# CHECK-NEXT: AddressAlign: 0x0000000000000004
+# CHECK-NEXT: Content: '0000000000000000'
+# CHECK-NEXT: - Name: .rel.text
+# CHECK-NEXT: Type: SHT_REL
+# CHECK-NEXT: Link: .symtab
+# CHECK-NEXT: AddressAlign: 0x0000000000000004
+# CHECK-NEXT: Info: .text
+# CHECK-NEXT: Relocations:
+# CHECK-NEXT: - Offset: 0x0000000000000000
+# CHECK-NEXT: Symbol: ''
+# CHECK-NEXT: Type: 0x000000FF
+# CHECK-NEXT: Symbols:
+# CHECK-NEXT: ...
+
+!ELF
+FileHeader:
+ Class: ELFCLASS32
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_386
+Sections:
+ - Type: SHT_PROGBITS
+ Name: .text
+ Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
+ AddressAlign: 0x04
+ Content: 0000000000000000
+ - Type: SHT_REL
+ Name: .rel.text
+ Link: .symtab
+ Info: .text
+ AddressAlign: 0x04
+ Relocations:
+ - Offset: 0
+ Symbol: main
+ Type: 0xFF
Index: lib/ObjectYAML/ELFYAML.cpp
===================================================================
--- lib/ObjectYAML/ELFYAML.cpp
+++ lib/ObjectYAML/ELFYAML.cpp
@@ -542,6 +542,7 @@
llvm_unreachable("Unsupported architecture");
}
#undef ELF_RELOC
+ IO.enumFallback<Hex32>(Value);
}
void ScalarEnumerationTraits<ELFYAML::MIPS_AFL_REG>::enumeration(
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34758.104657.patch
Type: text/x-patch
Size: 2219 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170629/d9a20b5a/attachment.bin>
More information about the llvm-commits
mailing list