diff --git a/PEFTools/MakePEF.cc b/PEFTools/MakePEF.cc index a7ac2edca7..503966ae83 100755 --- a/PEFTools/MakePEF.cc +++ b/PEFTools/MakePEF.cc @@ -130,35 +130,18 @@ void mkpef(const std::string& inFn, const std::string& outFn) in.read((char*)&aoutHeader, sizeof(aoutHeader)); in.seekg(get(xcoffHeader.f_opthdr) - sizeof(aoutHeader),std::ios_base::cur); - if(verboseFlag) - std::cerr << "flags: " << std::hex << get(xcoffHeader.f_flags) << std::dec << std::endl; if(verboseFlag) { + std::cerr << "flags: " << std::hex << get(xcoffHeader.f_flags) << std::dec << std::endl; std::cerr << "symptr: " << get(xcoffHeader.f_symptr) << std::endl; std::cerr << "nsyms: " << get(xcoffHeader.f_nsyms) << std::endl; } - int nSections = get(xcoffHeader.f_nscns); - PEFContainerHeader pefHeader; - - memset(&pefHeader,0,sizeof(pefHeader)); - - pefHeader.tag1 = kPEFTag1; - pefHeader.tag2 = kPEFTag2; - pefHeader.architecture = 'pwpc'; - pefHeader.formatVersion = kPEFVersion; - pefHeader.sectionCount = 3; // .text, .data, .loader - pefHeader.instSectionCount = 2; // .text, .data - std::map xcoffSections; std::map xcoffSectionNumbers; - std::map xcoffSectionNames; - std::map pefSectionNumbers; - - pefSectionNumbers[".text"] = 0; - pefSectionNumbers[".data"] = 1; - + + int nSections = get(xcoffHeader.f_nscns); for(int i=0;i importLibs; - std::vector relocInstructions; - std::map importSources; - std::map importedSymbolIndicesByName; - std::set importedSymbolSet; std::vector importedSymbolIndices; int totalImportedSyms = 0; + + std::vector relocInstructions; + { external_scnhdr xcoffLoaderSection = xcoffSections[".loader"]; external_ldhdr xcoffLoaderHeader; @@ -240,8 +212,6 @@ void mkpef(const std::string& inFn, const std::string& outFn) std::cerr << "... from file: " << get(sym.l_ifile) << std::endl; importLibs[get(sym.l_ifile)].imports.push_back(name); importLibs[get(sym.l_ifile)].xcoffImportIndices.push_back(i); - importSources[name] = totalImportedSyms; - importedSymbolSet.insert(name); totalImportedSyms++; } } @@ -250,9 +220,8 @@ void mkpef(const std::string& inFn, const std::string& outFn) int symbolIndex = 0; for(unsigned i=1;i loaderStringTable; int loaderStringTableSize = 0;