[PATCH] D57822: [yaml2obj]Allow number for ELF symbol type
James Henderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 6 09:16:45 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL353315: [yaml2obj]Allow number for ELF symbol type (authored by jhenderson, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D57822?vs=185561&id=185574#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57822/new/
https://reviews.llvm.org/D57822
Files:
llvm/trunk/lib/ObjectYAML/ELFYAML.cpp
llvm/trunk/test/tools/obj2yaml/symbol-type.yaml
llvm/trunk/test/tools/yaml2obj/symbol-type.yaml
Index: llvm/trunk/lib/ObjectYAML/ELFYAML.cpp
===================================================================
--- llvm/trunk/lib/ObjectYAML/ELFYAML.cpp
+++ llvm/trunk/lib/ObjectYAML/ELFYAML.cpp
@@ -572,6 +572,7 @@
ECase(STT_TLS);
ECase(STT_GNU_IFUNC);
#undef ECase
+ IO.enumFallback<Hex8>(Value);
}
void ScalarEnumerationTraits<ELFYAML::ELF_STV>::enumeration(
Index: llvm/trunk/test/tools/yaml2obj/symbol-type.yaml
===================================================================
--- llvm/trunk/test/tools/yaml2obj/symbol-type.yaml
+++ llvm/trunk/test/tools/yaml2obj/symbol-type.yaml
@@ -0,0 +1,43 @@
+# RUN: yaml2obj %s > %t
+# RUN: llvm-readobj --symbols %t | FileCheck %s
+
+# CHECK: Name: notype
+# CHECK: Type: None
+# CHECK: Name: normal_type
+# CHECK: Type: Object
+# CHECK: Name: .text
+# CHECK: Type: Section
+# CHECK: Name: known_hex
+# CHECK: Type: Object
+# CHECK: Name: unknown_hex
+# CHECK: Type: 0xB
+# CHECK: Name: known_int
+# CHECK: Type: Object
+# CHECK: Name: unknown_int
+# CHECK: Type: 0xB
+
+!ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_X86_64
+Sections:
+ - Name: .text
+ Type: SHT_PROGBITS
+Symbols:
+ Global:
+ - Name: notype
+ Type: STT_NOTYPE
+ - Name: normal_type
+ Type: STT_OBJECT
+ - Name: .text
+ Type: STT_SECTION
+ - Name: known_hex
+ Type: 0x1
+ - Name: unknown_hex
+ Type: 0xb
+ - Name: known_int
+ Type: 1
+ - Name: unknown_int
+ Type: 11
Index: llvm/trunk/test/tools/obj2yaml/symbol-type.yaml
===================================================================
--- llvm/trunk/test/tools/obj2yaml/symbol-type.yaml
+++ llvm/trunk/test/tools/obj2yaml/symbol-type.yaml
@@ -0,0 +1,22 @@
+# RUN: yaml2obj %s > %t
+# RUN: obj2yaml %t | FileCheck %s
+
+# CHECK: Symbols:
+# CHECK-NEXT: Global:
+# CHECK-NEXT: - Name: a_known_type
+# CHECK-NEXT: Type: STT_OBJECT
+# CHECK-NEXT: - Name: an_unknown_type
+# CHECK-NEXT: Type: 0x07
+
+!ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_X86_64
+Symbols:
+ Global:
+ - Name: a_known_type
+ Type: STT_OBJECT
+ - Name: an_unknown_type
+ Type: 0x7
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57822.185574.patch
Type: text/x-patch
Size: 2308 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190206/03eb2351/attachment.bin>
More information about the llvm-commits
mailing list