summaryrefslogtreecommitdiffstats
path: root/llvm/tools/obj2yaml/coff2yaml.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/obj2yaml/coff2yaml.cpp')
-rw-r--r--llvm/tools/obj2yaml/coff2yaml.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/tools/obj2yaml/coff2yaml.cpp b/llvm/tools/obj2yaml/coff2yaml.cpp
index e22aff76071..05d30f3fb62 100644
--- a/llvm/tools/obj2yaml/coff2yaml.cpp
+++ b/llvm/tools/obj2yaml/coff2yaml.cpp
@@ -47,13 +47,13 @@ void COFFDumper::dumpSections(unsigned NumSections) {
for (const auto &Section : Obj.sections()) {
const object::coff_section *Sect = Obj.getCOFFSection(Section);
COFFYAML::Section Sec;
- Sec.Name = Sect->Name; // FIXME: check the null termination!
- uint32_t Characteristics = Sect->Characteristics;
- Sec.Header.Characteristics = Characteristics;
- Sec.Alignment = 1 << (((Characteristics >> 20) & 0xf) - 1);
+ Section.getName(Sec.Name);
+ Sec.Header.Characteristics = Sect->Characteristics;
+ Sec.Alignment = Section.getAlignment();
ArrayRef<uint8_t> sectionData;
- Obj.getSectionContents(Sect, sectionData);
+ if (!Section.isBSS())
+ Obj.getSectionContents(Sect, sectionData);
Sec.SectionData = yaml::BinaryRef(sectionData);
std::vector<COFFYAML::Relocation> Relocations;
OpenPOWER on IntegriCloud