aboutsummaryrefslogtreecommitdiffstats
path: root/tools/yaml2obj/yaml2obj.cpp
diff options
context:
space:
mode:
authorSean Silva <silvas@purdue.edu>2013-06-10 23:44:15 +0000
committerSean Silva <silvas@purdue.edu>2013-06-10 23:44:15 +0000
commit5918b7a03d4d6a52e18f7c102250c9cfd6ae52dd (patch)
tree0b504cae7496e7c519b6ac722286e70ffed66b3f /tools/yaml2obj/yaml2obj.cpp
parent9bdd78501484a1add2d8a757fd29960dd9fc9de7 (diff)
downloadexternal_llvm-5918b7a03d4d6a52e18f7c102250c9cfd6ae52dd.zip
external_llvm-5918b7a03d4d6a52e18f7c102250c9cfd6ae52dd.tar.gz
external_llvm-5918b7a03d4d6a52e18f7c102250c9cfd6ae52dd.tar.bz2
[yaml2obj] Initial ELF support.
Currently, only emitting the ELF header is supported (no sections or segments). The ELFYAML code organization is broadly similar to the COFFYAML code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183711 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/yaml2obj/yaml2obj.cpp')
-rw-r--r--tools/yaml2obj/yaml2obj.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/yaml2obj/yaml2obj.cpp b/tools/yaml2obj/yaml2obj.cpp
index a9ac78b..6d1107c 100644
--- a/tools/yaml2obj/yaml2obj.cpp
+++ b/tools/yaml2obj/yaml2obj.cpp
@@ -38,7 +38,8 @@ static cl::opt<std::string>
// them appropriately requires some work in the YAML parser and the YAMLIO
// library.
enum YAMLObjectFormat {
- YOF_COFF
+ YOF_COFF,
+ YOF_ELF
};
cl::opt<YAMLObjectFormat> Format(
@@ -46,6 +47,7 @@ cl::opt<YAMLObjectFormat> Format(
cl::desc("Interpret input as this type of object file"),
cl::values(
clEnumValN(YOF_COFF, "coff", "COFF object file format"),
+ clEnumValN(YOF_ELF, "elf", "ELF object file format"),
clEnumValEnd));
@@ -60,6 +62,8 @@ int main(int argc, char **argv) {
return 1;
if (Format == YOF_COFF) {
return yaml2coff(outs(), Buf.get());
+ } else if (Format == YOF_ELF) {
+ return yaml2elf(outs(), Buf.get());
} else {
errs() << "Not yet implemented\n";
return 1;