| Rui Ueyama | 0ca149f | 2013-08-06 22:31:59 +0000 | [diff] [blame] | 1 | //===- lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp -------------------===// | 
| Rui Ueyama | 9e56839 | 2013-05-28 18:13:31 +0000 | [diff] [blame] | 2 | // | 
|  | 3 | //                             The LLVM Linker | 
|  | 4 | // | 
|  | 5 | // This file is distributed under the University of Illinois Open Source | 
|  | 6 | // License. See LICENSE.TXT for details. | 
|  | 7 | // | 
|  | 8 | //===----------------------------------------------------------------------===// | 
|  | 9 |  | 
| Rui Ueyama | fd50283 | 2013-07-24 22:53:23 +0000 | [diff] [blame] | 10 | #include "Atoms.h" | 
| Rui Ueyama | c91c24e3 | 2013-12-13 06:58:27 +0000 | [diff] [blame] | 11 | #include "EdataPass.h" | 
| Rui Ueyama | 991f42c | 2013-06-19 17:46:57 +0000 | [diff] [blame] | 12 | #include "GroupedSectionsPass.h" | 
| Rui Ueyama | c8a5379 | 2013-07-11 08:46:21 +0000 | [diff] [blame] | 13 | #include "IdataPass.h" | 
| Rui Ueyama | 908606d | 2013-08-09 04:44:15 +0000 | [diff] [blame] | 14 | #include "LinkerGeneratedSymbolFile.h" | 
| Rui Ueyama | 1a11b3b | 2013-11-25 02:00:00 +0000 | [diff] [blame] | 15 | #include "SetSubsystemPass.h" | 
| Rui Ueyama | 9e56839 | 2013-05-28 18:13:31 +0000 | [diff] [blame] | 16 |  | 
| Rui Ueyama | d95a155 | 2013-06-17 16:59:54 +0000 | [diff] [blame] | 17 | #include "lld/Core/PassManager.h" | 
|  | 18 | #include "lld/Passes/LayoutPass.h" | 
| Rui Ueyama | c9752fa | 2013-11-01 19:52:37 +0000 | [diff] [blame] | 19 | #include "lld/Passes/RoundTripNativePass.h" | 
|  | 20 | #include "lld/Passes/RoundTripYAMLPass.h" | 
| Rui Ueyama | 0ca149f | 2013-08-06 22:31:59 +0000 | [diff] [blame] | 21 | #include "lld/ReaderWriter/PECOFFLinkingContext.h" | 
| Rui Ueyama | 9e56839 | 2013-05-28 18:13:31 +0000 | [diff] [blame] | 22 | #include "lld/ReaderWriter/Reader.h" | 
| Rui Ueyama | fd50283 | 2013-07-24 22:53:23 +0000 | [diff] [blame] | 23 | #include "lld/ReaderWriter/Simple.h" | 
| Rui Ueyama | 9e56839 | 2013-05-28 18:13:31 +0000 | [diff] [blame] | 24 | #include "lld/ReaderWriter/Writer.h" | 
| Rui Ueyama | c9752fa | 2013-11-01 19:52:37 +0000 | [diff] [blame] | 25 | #include "llvm/ADT/SmallString.h" | 
|  | 26 | #include "llvm/Support/Allocator.h" | 
|  | 27 | #include "llvm/Support/Path.h" | 
| Rui Ueyama | 9e56839 | 2013-05-28 18:13:31 +0000 | [diff] [blame] | 28 |  | 
| Rui Ueyama | 9149181 | 2013-09-23 19:52:35 +0000 | [diff] [blame] | 29 | #include <bitset> | 
| Rui Ueyama | 4af032d | 2013-12-20 10:02:59 +0000 | [diff] [blame] | 30 | #include <climits> | 
| Rui Ueyama | 863931c | 2013-10-26 00:46:57 +0000 | [diff] [blame] | 31 | #include <set> | 
| Rui Ueyama | 9149181 | 2013-09-23 19:52:35 +0000 | [diff] [blame] | 32 |  | 
| Rui Ueyama | 9e56839 | 2013-05-28 18:13:31 +0000 | [diff] [blame] | 33 | namespace lld { | 
|  | 34 |  | 
| Rui Ueyama | 0ca149f | 2013-08-06 22:31:59 +0000 | [diff] [blame] | 35 | bool PECOFFLinkingContext::validateImpl(raw_ostream &diagnostics) { | 
| Rui Ueyama | eb0cc96 | 2013-06-08 03:59:00 +0000 | [diff] [blame] | 36 | if (_stackReserve < _stackCommit) { | 
|  | 37 | diagnostics << "Invalid stack size: reserve size must be equal to or " | 
| Rui Ueyama | 0ca149f | 2013-08-06 22:31:59 +0000 | [diff] [blame] | 38 | << "greater than commit size, but got " << _stackCommit | 
|  | 39 | << " and " << _stackReserve << ".\n"; | 
| Rui Ueyama | 8db1edd | 2013-09-24 23:26:34 +0000 | [diff] [blame] | 40 | return false; | 
| Rui Ueyama | eb0cc96 | 2013-06-08 03:59:00 +0000 | [diff] [blame] | 41 | } | 
|  | 42 |  | 
| Rui Ueyama | 9dd08d9 | 2013-06-08 22:59:10 +0000 | [diff] [blame] | 43 | if (_heapReserve < _heapCommit) { | 
|  | 44 | diagnostics << "Invalid heap size: reserve size must be equal to or " | 
| Rui Ueyama | 0ca149f | 2013-08-06 22:31:59 +0000 | [diff] [blame] | 45 | << "greater than commit size, but got " << _heapCommit | 
|  | 46 | << " and " << _heapReserve << ".\n"; | 
| Rui Ueyama | 8db1edd | 2013-09-24 23:26:34 +0000 | [diff] [blame] | 47 | return false; | 
| Rui Ueyama | 9dd08d9 | 2013-06-08 22:59:10 +0000 | [diff] [blame] | 48 | } | 
|  | 49 |  | 
| Rui Ueyama | 530488c | 2013-09-03 22:57:00 +0000 | [diff] [blame] | 50 | // It's an error if the base address is not multiple of 64K. | 
|  | 51 | if (_baseAddress & 0xffff) { | 
|  | 52 | diagnostics << "Base address have to be multiple of 64K, but got " | 
|  | 53 | << _baseAddress << "\n"; | 
| Rui Ueyama | 8db1edd | 2013-09-24 23:26:34 +0000 | [diff] [blame] | 54 | return false; | 
| Rui Ueyama | 530488c | 2013-09-03 22:57:00 +0000 | [diff] [blame] | 55 | } | 
|  | 56 |  | 
| Rui Ueyama | a6fddab | 2013-12-16 09:15:58 +0000 | [diff] [blame] | 57 | // Check for duplicate export ordinals. | 
|  | 58 | std::set<int> exports; | 
|  | 59 | for (const PECOFFLinkingContext::ExportDesc &desc : getDllExports()) { | 
|  | 60 | if (desc.ordinal == -1) | 
|  | 61 | continue; | 
|  | 62 | if (exports.count(desc.ordinal) == 1) { | 
|  | 63 | diagnostics << "Duplicate export ordinals: " << desc.ordinal << "\n"; | 
|  | 64 | return false; | 
|  | 65 | } | 
|  | 66 | exports.insert(desc.ordinal); | 
|  | 67 | } | 
|  | 68 |  | 
| Rui Ueyama | 41b99dc | 2013-11-06 19:30:14 +0000 | [diff] [blame] | 69 | std::bitset<64> alignment(_sectionDefaultAlignment); | 
| Rui Ueyama | 9149181 | 2013-09-23 19:52:35 +0000 | [diff] [blame] | 70 | if (alignment.count() != 1) { | 
|  | 71 | diagnostics << "Section alignment must be a power of 2, but got " | 
| Rui Ueyama | 41b99dc | 2013-11-06 19:30:14 +0000 | [diff] [blame] | 72 | << _sectionDefaultAlignment << "\n"; | 
| Rui Ueyama | 8db1edd | 2013-09-24 23:26:34 +0000 | [diff] [blame] | 73 | return false; | 
| Rui Ueyama | 9149181 | 2013-09-23 19:52:35 +0000 | [diff] [blame] | 74 | } | 
|  | 75 |  | 
| Rui Ueyama | 98896ed | 2013-09-12 19:46:53 +0000 | [diff] [blame] | 76 | // Architectures other than i386 is not supported yet. | 
|  | 77 | if (_machineType != llvm::COFF::IMAGE_FILE_MACHINE_I386) { | 
|  | 78 | diagnostics << "Machine type other than x86 is not supported.\n"; | 
| Rui Ueyama | 8db1edd | 2013-09-24 23:26:34 +0000 | [diff] [blame] | 79 | return false; | 
| Rui Ueyama | 98896ed | 2013-09-12 19:46:53 +0000 | [diff] [blame] | 80 | } | 
|  | 81 |  | 
| Rui Ueyama | 9e56839 | 2013-05-28 18:13:31 +0000 | [diff] [blame] | 82 | _writer = createWriterPECOFF(*this); | 
| Rui Ueyama | 8db1edd | 2013-09-24 23:26:34 +0000 | [diff] [blame] | 83 | return true; | 
| Rui Ueyama | 9e56839 | 2013-05-28 18:13:31 +0000 | [diff] [blame] | 84 | } | 
|  | 85 |  | 
| Shankar Easwaran | a96f3a3 | 2013-10-07 02:47:09 +0000 | [diff] [blame] | 86 | std::unique_ptr<File> PECOFFLinkingContext::createEntrySymbolFile() const { | 
| Rui Ueyama | 61b851a | 2013-12-26 06:35:35 +0000 | [diff] [blame] | 87 | return LinkingContext::createEntrySymbolFile("command line option /entry"); | 
| Shankar Easwaran | d26c8e3 | 2013-08-31 05:27:38 +0000 | [diff] [blame] | 88 | } | 
| Rui Ueyama | 908606d | 2013-08-09 04:44:15 +0000 | [diff] [blame] | 89 |  | 
| Shankar Easwaran | a96f3a3 | 2013-10-07 02:47:09 +0000 | [diff] [blame] | 90 | std::unique_ptr<File> PECOFFLinkingContext::createUndefinedSymbolFile() const { | 
| Rui Ueyama | 61b851a | 2013-12-26 06:35:35 +0000 | [diff] [blame] | 91 | return LinkingContext::createUndefinedSymbolFile("command line option /include"); | 
| Shankar Easwaran | d26c8e3 | 2013-08-31 05:27:38 +0000 | [diff] [blame] | 92 | } | 
|  | 93 |  | 
| Shankar Easwaran | a96f3a3 | 2013-10-07 02:47:09 +0000 | [diff] [blame] | 94 | bool PECOFFLinkingContext::createImplicitFiles( | 
|  | 95 | std::vector<std::unique_ptr<File> > &) const { | 
|  | 96 | std::unique_ptr<SimpleFileNode> fileNode( | 
|  | 97 | new SimpleFileNode("Implicit Files")); | 
|  | 98 | std::unique_ptr<File> linkerGeneratedSymFile( | 
| Rui Ueyama | 091071f | 2013-12-13 02:58:27 +0000 | [diff] [blame] | 99 | new pecoff::LinkerGeneratedSymbolFile(*this)); | 
| Shankar Easwaran | a96f3a3 | 2013-10-07 02:47:09 +0000 | [diff] [blame] | 100 | fileNode->appendInputFile(std::move(linkerGeneratedSymFile)); | 
|  | 101 | inputGraph().insertOneElementAt(std::move(fileNode), | 
|  | 102 | InputGraph::Position::END); | 
|  | 103 | return true; | 
| Rui Ueyama | fd50283 | 2013-07-24 22:53:23 +0000 | [diff] [blame] | 104 | } | 
|  | 105 |  | 
| Rui Ueyama | 863931c | 2013-10-26 00:46:57 +0000 | [diff] [blame] | 106 | /// Returns the section name in the resulting executable. | 
|  | 107 | /// | 
|  | 108 | /// Sections in object files are usually output to the executable with the same | 
|  | 109 | /// name, but you can rename by command line option. /merge:from=to makes the | 
|  | 110 | /// linker to combine "from" section contents to "to" section in the | 
|  | 111 | /// executable. We have a mapping for the renaming. This method looks up the | 
|  | 112 | /// table and returns a new section name if renamed. | 
|  | 113 | StringRef | 
| Rui Ueyama | 951dd1d | 2013-11-27 18:03:31 +0000 | [diff] [blame] | 114 | PECOFFLinkingContext::getOutputSectionName(StringRef sectionName) const { | 
| Rui Ueyama | 863931c | 2013-10-26 00:46:57 +0000 | [diff] [blame] | 115 | auto it = _renamedSections.find(sectionName); | 
|  | 116 | if (it == _renamedSections.end()) | 
|  | 117 | return sectionName; | 
| Rui Ueyama | 951dd1d | 2013-11-27 18:03:31 +0000 | [diff] [blame] | 118 | return getOutputSectionName(it->second); | 
| Rui Ueyama | 863931c | 2013-10-26 00:46:57 +0000 | [diff] [blame] | 119 | } | 
|  | 120 |  | 
|  | 121 | /// Adds a mapping to the section renaming table. This method will be used for | 
|  | 122 | /// /merge command line option. | 
|  | 123 | bool PECOFFLinkingContext::addSectionRenaming(raw_ostream &diagnostics, | 
|  | 124 | StringRef from, StringRef to) { | 
|  | 125 | auto it = _renamedSections.find(from); | 
|  | 126 | if (it != _renamedSections.end()) { | 
|  | 127 | if (it->second == to) | 
|  | 128 | // There's already the same mapping. | 
|  | 129 | return true; | 
|  | 130 | diagnostics << "Section \"" << from << "\" is already mapped to \"" | 
|  | 131 | << it->second << ", so it cannot be mapped to \"" << to << "\"."; | 
|  | 132 | return true; | 
|  | 133 | } | 
|  | 134 |  | 
|  | 135 | // Add a mapping, and check if there's no cycle in the renaming mapping. The | 
|  | 136 | // cycle detection algorithm we use here is naive, but that's OK because the | 
|  | 137 | // number of mapping is usually less than 10. | 
|  | 138 | _renamedSections[from] = to; | 
|  | 139 | for (auto elem : _renamedSections) { | 
|  | 140 | StringRef sectionName = elem.first; | 
|  | 141 | std::set<StringRef> visited; | 
|  | 142 | visited.insert(sectionName); | 
|  | 143 | for (;;) { | 
| Nick Kledzik | 3df8104 | 2013-11-06 21:30:15 +0000 | [diff] [blame] | 144 | auto pos = _renamedSections.find(sectionName); | 
|  | 145 | if (pos == _renamedSections.end()) | 
| Rui Ueyama | 863931c | 2013-10-26 00:46:57 +0000 | [diff] [blame] | 146 | break; | 
| Nick Kledzik | 3df8104 | 2013-11-06 21:30:15 +0000 | [diff] [blame] | 147 | if (visited.count(pos->second)) { | 
| Rui Ueyama | 863931c | 2013-10-26 00:46:57 +0000 | [diff] [blame] | 148 | diagnostics << "/merge:" << from << "=" << to << " makes a cycle"; | 
|  | 149 | return false; | 
|  | 150 | } | 
| Nick Kledzik | 3df8104 | 2013-11-06 21:30:15 +0000 | [diff] [blame] | 151 | sectionName = pos->second; | 
| Rui Ueyama | 863931c | 2013-10-26 00:46:57 +0000 | [diff] [blame] | 152 | visited.insert(sectionName); | 
|  | 153 | } | 
|  | 154 | } | 
|  | 155 | return true; | 
|  | 156 | } | 
|  | 157 |  | 
| Rui Ueyama | 34d6e9b | 2013-12-09 01:47:32 +0000 | [diff] [blame] | 158 | StringRef PECOFFLinkingContext::getAlternateName(StringRef def) const { | 
|  | 159 | auto it = _alternateNames.find(def); | 
|  | 160 | if (it == _alternateNames.end()) | 
|  | 161 | return ""; | 
|  | 162 | return it->second; | 
|  | 163 | } | 
|  | 164 |  | 
|  | 165 | void PECOFFLinkingContext::setAlternateName(StringRef weak, StringRef def) { | 
|  | 166 | _alternateNames[def] = weak; | 
|  | 167 | } | 
|  | 168 |  | 
| Rui Ueyama | 2897feb | 2013-07-19 02:18:25 +0000 | [diff] [blame] | 169 | /// Try to find the input library file from the search paths and append it to | 
|  | 170 | /// the input file list. Returns true if the library file is found. | 
| Shankar Easwaran | e44104b | 2013-08-21 22:57:10 +0000 | [diff] [blame] | 171 | StringRef PECOFFLinkingContext::searchLibraryFile(StringRef filename) const { | 
| Rui Ueyama | 2897feb | 2013-07-19 02:18:25 +0000 | [diff] [blame] | 172 | // Current directory always takes precedence over the search paths. | 
| Shankar Easwaran | e44104b | 2013-08-21 22:57:10 +0000 | [diff] [blame] | 173 | if (llvm::sys::path::is_absolute(filename) || llvm::sys::fs::exists(filename)) | 
|  | 174 | return filename; | 
| Rui Ueyama | 2897feb | 2013-07-19 02:18:25 +0000 | [diff] [blame] | 175 | // Iterate over the search paths. | 
|  | 176 | for (StringRef dir : _inputSearchPaths) { | 
|  | 177 | SmallString<128> path = dir; | 
|  | 178 | llvm::sys::path::append(path, filename); | 
| Shankar Easwaran | e44104b | 2013-08-21 22:57:10 +0000 | [diff] [blame] | 179 | if (llvm::sys::fs::exists(path.str())) | 
| Rui Ueyama | 90bcd11 | 2013-11-21 00:17:31 +0000 | [diff] [blame] | 180 | return allocate(path.str()); | 
| Rui Ueyama | 2897feb | 2013-07-19 02:18:25 +0000 | [diff] [blame] | 181 | } | 
| Shankar Easwaran | e44104b | 2013-08-21 22:57:10 +0000 | [diff] [blame] | 182 | return filename; | 
| Rui Ueyama | 2897feb | 2013-07-19 02:18:25 +0000 | [diff] [blame] | 183 | } | 
|  | 184 |  | 
| Rui Ueyama | abc227b | 2013-12-14 04:32:29 +0000 | [diff] [blame] | 185 | /// Returns the decorated name of the given symbol name. On 32-bit x86, it | 
|  | 186 | /// adds "_" at the beginning of the string. On other architectures, the | 
|  | 187 | /// return value is the same as the argument. | 
|  | 188 | StringRef PECOFFLinkingContext::decorateSymbol(StringRef name) const { | 
|  | 189 | if (_machineType != llvm::COFF::IMAGE_FILE_MACHINE_I386) | 
|  | 190 | return name; | 
|  | 191 | std::string str = "_"; | 
|  | 192 | str.append(name); | 
|  | 193 | return allocate(str); | 
|  | 194 | } | 
|  | 195 |  | 
| Rui Ueyama | 090a7cd | 2013-12-24 09:15:57 +0000 | [diff] [blame] | 196 | StringRef PECOFFLinkingContext::undecorateSymbol(StringRef name) const { | 
|  | 197 | if (_machineType != llvm::COFF::IMAGE_FILE_MACHINE_I386) | 
|  | 198 | return name; | 
|  | 199 | assert(name.startswith("_")); | 
|  | 200 | return name.substr(1); | 
|  | 201 | } | 
|  | 202 |  | 
| Rui Ueyama | 0ca149f | 2013-08-06 22:31:59 +0000 | [diff] [blame] | 203 | Writer &PECOFFLinkingContext::writer() const { return *_writer; } | 
| Rui Ueyama | 9e56839 | 2013-05-28 18:13:31 +0000 | [diff] [blame] | 204 |  | 
| Rui Ueyama | 9e56839 | 2013-05-28 18:13:31 +0000 | [diff] [blame] | 205 |  | 
| Rui Ueyama | 615b200 | 2013-11-27 21:34:16 +0000 | [diff] [blame] | 206 | void PECOFFLinkingContext::setSectionSetMask(StringRef sectionName, | 
|  | 207 | uint32_t newFlags) { | 
|  | 208 | _sectionSetMask[sectionName] |= newFlags; | 
|  | 209 | _sectionClearMask[sectionName] &= ~newFlags; | 
|  | 210 | const uint32_t rwx = (llvm::COFF::IMAGE_SCN_MEM_READ | | 
|  | 211 | llvm::COFF::IMAGE_SCN_MEM_WRITE | | 
|  | 212 | llvm::COFF::IMAGE_SCN_MEM_EXECUTE); | 
|  | 213 | if (newFlags & rwx) | 
|  | 214 | _sectionClearMask[sectionName] |= ~_sectionSetMask[sectionName] & rwx; | 
|  | 215 | assert((_sectionSetMask[sectionName] & _sectionClearMask[sectionName]) == 0); | 
|  | 216 | } | 
|  | 217 |  | 
|  | 218 | void PECOFFLinkingContext::setSectionClearMask(StringRef sectionName, | 
|  | 219 | uint32_t newFlags) { | 
|  | 220 | _sectionClearMask[sectionName] |= newFlags; | 
|  | 221 | _sectionSetMask[sectionName] &= ~newFlags; | 
|  | 222 | assert((_sectionSetMask[sectionName] & _sectionClearMask[sectionName]) == 0); | 
|  | 223 | } | 
|  | 224 |  | 
|  | 225 | uint32_t PECOFFLinkingContext::getSectionAttributes(StringRef sectionName, | 
|  | 226 | uint32_t flags) const { | 
|  | 227 | auto si = _sectionSetMask.find(sectionName); | 
|  | 228 | uint32_t setMask = (si == _sectionSetMask.end()) ? 0 : si->second; | 
|  | 229 | auto ci = _sectionClearMask.find(sectionName); | 
|  | 230 | uint32_t clearMask = (ci == _sectionClearMask.end()) ? 0 : ci->second; | 
|  | 231 | return (flags | setMask) & ~clearMask; | 
|  | 232 | } | 
| Rui Ueyama | 170a1a8 | 2013-12-20 07:48:29 +0000 | [diff] [blame] | 233 |  | 
| Rui Ueyama | ffd8105 | 2013-12-28 08:40:37 +0000 | [diff] [blame] | 234 | // Returns true if two export descriptors have conflicting contents, | 
|  | 235 | // e.g. different export ordinals. | 
|  | 236 | static bool exportConflicts(const PECOFFLinkingContext::ExportDesc &a, | 
|  | 237 | const PECOFFLinkingContext::ExportDesc &b) { | 
| Rui Ueyama | 93f7604 | 2013-12-28 10:09:21 +0000 | [diff] [blame^] | 238 | return (a.ordinal > 0 && b.ordinal > 0 && a.ordinal != b.ordinal) || | 
|  | 239 | a.noname != b.noname || a.isData != b.isData; | 
| Rui Ueyama | ffd8105 | 2013-12-28 08:40:37 +0000 | [diff] [blame] | 240 | } | 
|  | 241 |  | 
| Rui Ueyama | cf46161 | 2013-12-25 06:46:45 +0000 | [diff] [blame] | 242 | void PECOFFLinkingContext::addDllExport(ExportDesc &desc) { | 
| Rui Ueyama | ffd8105 | 2013-12-28 08:40:37 +0000 | [diff] [blame] | 243 | auto existing = _dllExports.insert(desc); | 
|  | 244 | if (existing.second) | 
|  | 245 | return; | 
|  | 246 | if (!exportConflicts(*existing.first, desc)) { | 
|  | 247 | _dllExports.erase(existing.first); | 
|  | 248 | _dllExports.insert(desc); | 
| Rui Ueyama | cf46161 | 2013-12-25 06:46:45 +0000 | [diff] [blame] | 249 | return; | 
|  | 250 | } | 
| Rui Ueyama | ffd8105 | 2013-12-28 08:40:37 +0000 | [diff] [blame] | 251 | llvm::errs() << "Export symbol '" << desc.name | 
|  | 252 | << "' specified more than once.\n"; | 
| Rui Ueyama | cf46161 | 2013-12-25 06:46:45 +0000 | [diff] [blame] | 253 | } | 
|  | 254 |  | 
| Shankar Easwaran | 2bc2492 | 2013-10-29 05:12:14 +0000 | [diff] [blame] | 255 | void PECOFFLinkingContext::addPasses(PassManager &pm) { | 
| Rui Ueyama | 1a11b3b | 2013-11-25 02:00:00 +0000 | [diff] [blame] | 256 | pm.add(std::unique_ptr<Pass>(new pecoff::SetSubsystemPass(*this))); | 
| Rui Ueyama | c91c24e3 | 2013-12-13 06:58:27 +0000 | [diff] [blame] | 257 | pm.add(std::unique_ptr<Pass>(new pecoff::EdataPass(*this))); | 
| Rui Ueyama | 3ee2bf6 | 2013-09-15 22:33:15 +0000 | [diff] [blame] | 258 | pm.add(std::unique_ptr<Pass>(new pecoff::IdataPass(*this))); | 
| Rui Ueyama | d95a155 | 2013-06-17 16:59:54 +0000 | [diff] [blame] | 259 | pm.add(std::unique_ptr<Pass>(new LayoutPass())); | 
| Rui Ueyama | 32c3f17 | 2013-12-07 00:27:17 +0000 | [diff] [blame] | 260 | pm.add(std::unique_ptr<Pass>(new pecoff::GroupedSectionsPass())); | 
| Rui Ueyama | d95a155 | 2013-06-17 16:59:54 +0000 | [diff] [blame] | 261 | } | 
| Rui Ueyama | 091071f | 2013-12-13 02:58:27 +0000 | [diff] [blame] | 262 |  | 
| Rui Ueyama | 9e56839 | 2013-05-28 18:13:31 +0000 | [diff] [blame] | 263 | } // end namespace lld |