summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2019-03-07 12:09:19 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2019-03-07 12:09:19 +0000
commita5a0a0f0493c981f568a9572c8adbb061dfcf829 (patch)
tree04b0844c07b947fd380618292cba7fed5d47e8de /llvm/lib
parentcfd32552513dbfdc88336659fc8c8e460d973cd2 (diff)
downloadbcm5719-llvm-a5a0a0f0493c981f568a9572c8adbb061dfcf829.tar.gz
bcm5719-llvm-a5a0a0f0493c981f568a9572c8adbb061dfcf829.zip
[yaml2obj] - Allow producing ELFDATANONE ELFs
I need this to remove a binary from LLD test suite. The patch also simplifies the code a bit. Differential revision: https://reviews.llvm.org/D59082 llvm-svn: 355591
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/ObjectYAML/ELFYAML.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/ObjectYAML/ELFYAML.cpp b/llvm/lib/ObjectYAML/ELFYAML.cpp
index c374cc2a9e1..c8585bd3b1e 100644
--- a/llvm/lib/ObjectYAML/ELFYAML.cpp
+++ b/llvm/lib/ObjectYAML/ELFYAML.cpp
@@ -232,8 +232,9 @@ void ScalarEnumerationTraits<ELFYAML::ELF_ELFCLASS>::enumeration(
void ScalarEnumerationTraits<ELFYAML::ELF_ELFDATA>::enumeration(
IO &IO, ELFYAML::ELF_ELFDATA &Value) {
#define ECase(X) IO.enumCase(Value, #X, ELF::X)
- // Since the semantics of ELFDATANONE is "invalid", just don't accept it
- // here.
+ // ELFDATANONE is an invalid data encoding, but we accept it because
+ // we want to be able to produce invalid binaries for the tests.
+ ECase(ELFDATANONE);
ECase(ELFDATA2LSB);
ECase(ELFDATA2MSB);
#undef ECase
OpenPOWER on IntegriCloud