summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ObjectYAML/ELFYAML.cpp
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2019-09-02 09:47:17 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2019-09-02 09:47:17 +0000
commit86cc736df1fccfe804a6fe3f4a7f8c65f17ae50a (patch)
treed23b0bd24a71be880be64d844243ae547db5ad84 /llvm/lib/ObjectYAML/ELFYAML.cpp
parent5c6b82a7567cd16072a0424fb564c9d3ede11716 (diff)
downloadbcm5719-llvm-86cc736df1fccfe804a6fe3f4a7f8c65f17ae50a.tar.gz
bcm5719-llvm-86cc736df1fccfe804a6fe3f4a7f8c65f17ae50a.zip
[yaml2obj] - Allow overriding sh_name fields of the sections.
This is in line with the previous changes which allowed to override the sh_offset/sh_size and useful for writing test cases. Differential revision: https://reviews.llvm.org/D66998 llvm-svn: 370633
Diffstat (limited to 'llvm/lib/ObjectYAML/ELFYAML.cpp')
-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 04084e990c0..6f05d7ddc1a 100644
--- a/llvm/lib/ObjectYAML/ELFYAML.cpp
+++ b/llvm/lib/ObjectYAML/ELFYAML.cpp
@@ -986,10 +986,11 @@ static void commonSectionMapping(IO &IO, ELFYAML::Section &Section) {
IO.mapOptional("EntSize", Section.EntSize);
// obj2yaml does not dump these fields. They are expected to be empty when we
- // are producing YAML, because yaml2obj sets appropriate values for sh_offset
- // and sh_size automatically when they are not explicitly defined.
+ // are producing YAML, because yaml2obj sets appropriate values for them
+ // automatically when they are not explicitly defined.
assert(!IO.outputting() ||
(!Section.ShOffset.hasValue() && !Section.ShSize.hasValue()));
+ IO.mapOptional("ShName", Section.ShName);
IO.mapOptional("ShOffset", Section.ShOffset);
IO.mapOptional("ShSize", Section.ShSize);
}
OpenPOWER on IntegriCloud