Set REQUIRES shell on the test cases for r186044
[oota-llvm.git] / tools / obj2yaml / coff2yaml.cpp
index d1c4d01b68d895668f006affea0af5cb493359c9..1e28c4e9d6ca2c4c672cfca1379c92108eda9159 100644 (file)
@@ -38,7 +38,7 @@ static void check(error_code ec) {
 
 COFFDumper::COFFDumper(const object::COFFObjectFile &Obj) : Obj(Obj) {
   const object::coff_file_header *Header;
-  check(Obj.getHeader(Header));
+  check(Obj.getCOFFHeader(Header));
   dumpHeader(Header);
   dumpSections(Header->NumberOfSections);
   dumpSymbols(Header->NumberOfSymbols);
@@ -64,15 +64,17 @@ void COFFDumper::dumpSections(unsigned NumSections) {
 
     ArrayRef<uint8_t> sectionData;
     Obj.getSectionContents(Sect, sectionData);
-    Sec.SectionData = COFFYAML::BinaryRef(sectionData);
+    Sec.SectionData = object::yaml::BinaryRef(sectionData);
 
-    std::vector<COFF::relocation> Relocations;
+    std::vector<COFFYAML::Relocation> Relocations;
     for (object::relocation_iterator rIter = iter->begin_relocations();
                        rIter != iter->end_relocations(); rIter.increment(ec)) {
       const object::coff_relocation *reloc = Obj.getCOFFRelocation(rIter);
-      COFF::relocation Rel;
+      COFFYAML::Relocation Rel;
+      object::symbol_iterator Sym = rIter->getSymbol();
+      StringRef Name;
+      Sym->getName(Rel.SymbolName);
       Rel.VirtualAddress = reloc->VirtualAddress;
-      Rel.SymbolTableIndex = reloc->SymbolTableIndex;
       Rel.Type = reloc->Type;
       Relocations.push_back(Rel);
     }
@@ -96,7 +98,7 @@ void COFFDumper::dumpSymbols(unsigned NumSymbols) {
     Sym.Header.Value = Symbol->Value;
     Sym.Header.SectionNumber = Symbol->SectionNumber;
     Sym.Header.NumberOfAuxSymbols = Symbol->NumberOfAuxSymbols;
-    Sym.AuxiliaryData = COFFYAML::BinaryRef(Obj.getSymbolAuxData(Symbol));
+    Sym.AuxiliaryData = object::yaml::BinaryRef(Obj.getSymbolAuxData(Symbol));
     Symbols.push_back(Sym);
   }
 }