From 5918b7a03d4d6a52e18f7c102250c9cfd6ae52dd Mon Sep 17 00:00:00 2001 From: Sean Silva Date: Mon, 10 Jun 2013 23:44:15 +0000 Subject: [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 --- tools/yaml2obj/yaml2obj.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tools/yaml2obj/yaml2obj.cpp') diff --git a/tools/yaml2obj/yaml2obj.cpp b/tools/yaml2obj/yaml2obj.cpp index a9ac78bce4..6d1107c858 100644 --- a/tools/yaml2obj/yaml2obj.cpp +++ b/tools/yaml2obj/yaml2obj.cpp @@ -38,7 +38,8 @@ static cl::opt // them appropriately requires some work in the YAML parser and the YAMLIO // library. enum YAMLObjectFormat { - YOF_COFF + YOF_COFF, + YOF_ELF }; cl::opt Format( @@ -46,6 +47,7 @@ cl::opt 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; -- cgit v1.2.3