Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 1 | //===- OutputSections.cpp -------------------------------------------------===// |
| 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 | |
| 10 | #include "OutputSections.h" |
| 11 | |
| 12 | #include "Config.h" |
Sam Clegg | 5fa274b | 2018-01-10 01:13:34 +0000 | [diff] [blame^] | 13 | #include "InputChunks.h" |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 14 | #include "InputFiles.h" |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 15 | #include "OutputSegment.h" |
| 16 | #include "SymbolTable.h" |
| 17 | #include "lld/Common/ErrorHandler.h" |
Rui Ueyama | 2017d52 | 2017-11-28 20:39:17 +0000 | [diff] [blame] | 18 | #include "lld/Common/Memory.h" |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 19 | #include "lld/Common/Threads.h" |
| 20 | #include "llvm/ADT/Twine.h" |
| 21 | #include "llvm/Support/LEB128.h" |
| 22 | |
| 23 | #define DEBUG_TYPE "lld" |
| 24 | |
| 25 | using namespace llvm; |
| 26 | using namespace llvm::wasm; |
| 27 | using namespace lld; |
| 28 | using namespace lld::wasm; |
| 29 | |
| 30 | enum class RelocEncoding { |
| 31 | Uleb128, |
| 32 | Sleb128, |
| 33 | I32, |
| 34 | }; |
| 35 | |
| 36 | static StringRef sectionTypeToString(uint32_t SectionType) { |
| 37 | switch (SectionType) { |
| 38 | case WASM_SEC_CUSTOM: |
| 39 | return "CUSTOM"; |
| 40 | case WASM_SEC_TYPE: |
| 41 | return "TYPE"; |
| 42 | case WASM_SEC_IMPORT: |
| 43 | return "IMPORT"; |
| 44 | case WASM_SEC_FUNCTION: |
| 45 | return "FUNCTION"; |
| 46 | case WASM_SEC_TABLE: |
| 47 | return "TABLE"; |
| 48 | case WASM_SEC_MEMORY: |
| 49 | return "MEMORY"; |
| 50 | case WASM_SEC_GLOBAL: |
| 51 | return "GLOBAL"; |
| 52 | case WASM_SEC_EXPORT: |
| 53 | return "EXPORT"; |
| 54 | case WASM_SEC_START: |
| 55 | return "START"; |
| 56 | case WASM_SEC_ELEM: |
| 57 | return "ELEM"; |
| 58 | case WASM_SEC_CODE: |
| 59 | return "CODE"; |
| 60 | case WASM_SEC_DATA: |
| 61 | return "DATA"; |
| 62 | default: |
| 63 | fatal("invalid section type"); |
| 64 | } |
| 65 | } |
| 66 | |
Sam Clegg | ab2ac29 | 2017-12-20 05:14:48 +0000 | [diff] [blame] | 67 | std::string lld::toString(const OutputSection &Section) { |
| 68 | std::string rtn = Section.getSectionName(); |
| 69 | if (!Section.Name.empty()) |
| 70 | rtn += "(" + Section.Name + ")"; |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 71 | return rtn; |
| 72 | } |
| 73 | |
| 74 | static void applyRelocation(uint8_t *Buf, const OutputRelocation &Reloc) { |
| 75 | DEBUG(dbgs() << "write reloc: type=" << Reloc.Reloc.Type |
Sam Clegg | 74fe0ba | 2017-12-07 01:51:24 +0000 | [diff] [blame] | 76 | << " index=" << Reloc.Reloc.Index << " value=" << Reloc.Value |
| 77 | << " offset=" << Reloc.Reloc.Offset << "\n"); |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 78 | Buf += Reloc.Reloc.Offset; |
| 79 | int64_t ExistingValue; |
| 80 | switch (Reloc.Reloc.Type) { |
| 81 | case R_WEBASSEMBLY_TYPE_INDEX_LEB: |
| 82 | case R_WEBASSEMBLY_FUNCTION_INDEX_LEB: |
| 83 | ExistingValue = decodeULEB128(Buf); |
| 84 | if (ExistingValue != Reloc.Reloc.Index) { |
| 85 | DEBUG(dbgs() << "existing value: " << decodeULEB128(Buf) << "\n"); |
| 86 | assert(decodeULEB128(Buf) == Reloc.Reloc.Index); |
| 87 | } |
| 88 | LLVM_FALLTHROUGH; |
| 89 | case R_WEBASSEMBLY_MEMORY_ADDR_LEB: |
| 90 | case R_WEBASSEMBLY_GLOBAL_INDEX_LEB: |
| 91 | encodeULEB128(Reloc.Value, Buf, 5); |
| 92 | break; |
| 93 | case R_WEBASSEMBLY_TABLE_INDEX_SLEB: |
| 94 | ExistingValue = decodeSLEB128(Buf); |
| 95 | if (ExistingValue != Reloc.Reloc.Index) { |
| 96 | DEBUG(dbgs() << "existing value: " << decodeSLEB128(Buf) << "\n"); |
| 97 | assert(decodeSLEB128(Buf) == Reloc.Reloc.Index); |
| 98 | } |
| 99 | LLVM_FALLTHROUGH; |
| 100 | case R_WEBASSEMBLY_MEMORY_ADDR_SLEB: |
| 101 | encodeSLEB128(static_cast<int32_t>(Reloc.Value), Buf, 5); |
| 102 | break; |
| 103 | case R_WEBASSEMBLY_TABLE_INDEX_I32: |
| 104 | case R_WEBASSEMBLY_MEMORY_ADDR_I32: |
| 105 | support::endian::write32<support::little>(Buf, Reloc.Value); |
| 106 | break; |
| 107 | default: |
| 108 | llvm_unreachable("unknown relocation type"); |
| 109 | } |
| 110 | } |
| 111 | |
Sam Clegg | ca16b73 | 2017-12-18 20:20:24 +0000 | [diff] [blame] | 112 | static void applyRelocations(uint8_t *Buf, ArrayRef<OutputRelocation> Relocs) { |
Sam Clegg | 5e8cba9 | 2017-12-19 20:45:15 +0000 | [diff] [blame] | 113 | if (!Relocs.size()) |
| 114 | return; |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 115 | log("applyRelocations: count=" + Twine(Relocs.size())); |
Sam Clegg | 5e8cba9 | 2017-12-19 20:45:15 +0000 | [diff] [blame] | 116 | for (const OutputRelocation &Reloc : Relocs) |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 117 | applyRelocation(Buf, Reloc); |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 118 | } |
| 119 | |
| 120 | // Relocations contain an index into the function, global or table index |
| 121 | // space of the input file. This function takes a relocation and returns the |
| 122 | // relocated index (i.e. translates from the input index space to the output |
| 123 | // index space). |
| 124 | static uint32_t calcNewIndex(const ObjFile &File, const WasmRelocation &Reloc) { |
| 125 | switch (Reloc.Type) { |
| 126 | case R_WEBASSEMBLY_TYPE_INDEX_LEB: |
| 127 | return File.relocateTypeIndex(Reloc.Index); |
| 128 | case R_WEBASSEMBLY_FUNCTION_INDEX_LEB: |
| 129 | return File.relocateFunctionIndex(Reloc.Index); |
| 130 | case R_WEBASSEMBLY_TABLE_INDEX_I32: |
| 131 | case R_WEBASSEMBLY_TABLE_INDEX_SLEB: |
| 132 | return File.relocateTableIndex(Reloc.Index); |
| 133 | case R_WEBASSEMBLY_GLOBAL_INDEX_LEB: |
| 134 | case R_WEBASSEMBLY_MEMORY_ADDR_LEB: |
| 135 | case R_WEBASSEMBLY_MEMORY_ADDR_SLEB: |
| 136 | case R_WEBASSEMBLY_MEMORY_ADDR_I32: |
| 137 | return File.relocateGlobalIndex(Reloc.Index); |
| 138 | default: |
| 139 | llvm_unreachable("unknown relocation type"); |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | // Take a vector of relocations from an input file and create output |
| 144 | // relocations based on them. Calculates the updated index and offset for |
| 145 | // each relocation as well as the value to write out in the final binary. |
| 146 | static void calcRelocations(const ObjFile &File, |
| 147 | ArrayRef<WasmRelocation> Relocs, |
| 148 | std::vector<OutputRelocation> &OutputRelocs, |
| 149 | int32_t OutputOffset) { |
| 150 | log("calcRelocations: " + File.getName() + " offset=" + Twine(OutputOffset)); |
| 151 | for (const WasmRelocation &Reloc : Relocs) { |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 152 | OutputRelocation NewReloc; |
| 153 | NewReloc.Reloc = Reloc; |
Sam Clegg | 8d146bb | 2018-01-09 23:56:44 +0000 | [diff] [blame] | 154 | assert(Reloc.Offset + OutputOffset > 0); |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 155 | NewReloc.Reloc.Offset += OutputOffset; |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 156 | DEBUG(dbgs() << "reloc: type=" << Reloc.Type << " index=" << Reloc.Index |
Sam Clegg | 74fe0ba | 2017-12-07 01:51:24 +0000 | [diff] [blame] | 157 | << " offset=" << Reloc.Offset |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 158 | << " newOffset=" << NewReloc.Reloc.Offset << "\n"); |
| 159 | |
Sam Clegg | 74fe0ba | 2017-12-07 01:51:24 +0000 | [diff] [blame] | 160 | if (Config->EmitRelocs) |
| 161 | NewReloc.NewIndex = calcNewIndex(File, Reloc); |
Sam Clegg | 74fe0ba | 2017-12-07 01:51:24 +0000 | [diff] [blame] | 162 | |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 163 | switch (Reloc.Type) { |
| 164 | case R_WEBASSEMBLY_MEMORY_ADDR_SLEB: |
| 165 | case R_WEBASSEMBLY_MEMORY_ADDR_I32: |
| 166 | case R_WEBASSEMBLY_MEMORY_ADDR_LEB: |
Sam Clegg | 87e6192 | 2018-01-08 23:39:11 +0000 | [diff] [blame] | 167 | NewReloc.Value = File.getRelocatedAddress(Reloc.Index) + Reloc.Addend; |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 168 | break; |
| 169 | default: |
Sam Clegg | 74fe0ba | 2017-12-07 01:51:24 +0000 | [diff] [blame] | 170 | NewReloc.Value = calcNewIndex(File, Reloc); |
| 171 | break; |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 172 | } |
| 173 | |
| 174 | OutputRelocs.emplace_back(NewReloc); |
| 175 | } |
| 176 | } |
| 177 | |
Sam Clegg | ab2ac29 | 2017-12-20 05:14:48 +0000 | [diff] [blame] | 178 | std::string OutputSection::getSectionName() const { |
Sam Clegg | 0d0dd39 | 2017-12-19 17:09:45 +0000 | [diff] [blame] | 179 | return sectionTypeToString(Type); |
| 180 | } |
| 181 | |
Sam Clegg | ab2ac29 | 2017-12-20 05:14:48 +0000 | [diff] [blame] | 182 | std::string SubSection::getSectionName() const { |
Sam Clegg | 0d0dd39 | 2017-12-19 17:09:45 +0000 | [diff] [blame] | 183 | return std::string("subsection <type=") + std::to_string(Type) + ">"; |
| 184 | } |
| 185 | |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 186 | void OutputSection::createHeader(size_t BodySize) { |
| 187 | raw_string_ostream OS(Header); |
Sam Clegg | 0d0dd39 | 2017-12-19 17:09:45 +0000 | [diff] [blame] | 188 | debugWrite(OS.tell(), "section type [" + Twine(getSectionName()) + "]"); |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 189 | writeUleb128(OS, Type, nullptr); |
| 190 | writeUleb128(OS, BodySize, "section size"); |
| 191 | OS.flush(); |
Sam Clegg | ab2ac29 | 2017-12-20 05:14:48 +0000 | [diff] [blame] | 192 | log("createHeader: " + toString(*this) + " body=" + Twine(BodySize) + |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 193 | " total=" + Twine(getSize())); |
| 194 | } |
| 195 | |
Sam Clegg | 8d146bb | 2018-01-09 23:56:44 +0000 | [diff] [blame] | 196 | CodeSection::CodeSection(ArrayRef<InputFunction *> Functions) |
| 197 | : OutputSection(WASM_SEC_CODE), Functions(Functions) { |
| 198 | assert(Functions.size() > 0); |
| 199 | |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 200 | raw_string_ostream OS(CodeSectionHeader); |
Sam Clegg | 8d146bb | 2018-01-09 23:56:44 +0000 | [diff] [blame] | 201 | writeUleb128(OS, Functions.size(), "function count"); |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 202 | OS.flush(); |
| 203 | BodySize = CodeSectionHeader.size(); |
| 204 | |
Sam Clegg | 5fa274b | 2018-01-10 01:13:34 +0000 | [diff] [blame^] | 205 | for (InputChunk *Func : Functions) { |
Sam Clegg | 8d146bb | 2018-01-09 23:56:44 +0000 | [diff] [blame] | 206 | Func->OutputOffset = BodySize; |
| 207 | calcRelocations(Func->File, Func->Relocations, Func->OutRelocations, |
Sam Clegg | 5fa274b | 2018-01-10 01:13:34 +0000 | [diff] [blame^] | 208 | Func->OutputOffset - Func->getInputSectionOffset()); |
| 209 | BodySize += Func->getSize(); |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 210 | } |
| 211 | |
| 212 | createHeader(BodySize); |
| 213 | } |
| 214 | |
| 215 | void CodeSection::writeTo(uint8_t *Buf) { |
Sam Clegg | ab2ac29 | 2017-12-20 05:14:48 +0000 | [diff] [blame] | 216 | log("writing " + toString(*this)); |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 217 | log(" size=" + Twine(getSize())); |
Sam Clegg | 8d146bb | 2018-01-09 23:56:44 +0000 | [diff] [blame] | 218 | log(" headersize=" + Twine(Header.size())); |
| 219 | log(" codeheadersize=" + Twine(CodeSectionHeader.size())); |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 220 | Buf += Offset; |
| 221 | |
| 222 | // Write section header |
| 223 | memcpy(Buf, Header.data(), Header.size()); |
| 224 | Buf += Header.size(); |
| 225 | |
| 226 | uint8_t *ContentsStart = Buf; |
| 227 | |
| 228 | // Write code section headers |
| 229 | memcpy(Buf, CodeSectionHeader.data(), CodeSectionHeader.size()); |
| 230 | Buf += CodeSectionHeader.size(); |
| 231 | |
| 232 | // Write code section bodies |
Sam Clegg | 5fa274b | 2018-01-10 01:13:34 +0000 | [diff] [blame^] | 233 | parallelForEach(Functions, [ContentsStart](InputChunk *Func) { |
| 234 | memcpy(ContentsStart + Func->OutputOffset, Func->getData(), |
| 235 | Func->getSize()); |
Sam Clegg | 8d146bb | 2018-01-09 23:56:44 +0000 | [diff] [blame] | 236 | applyRelocations(ContentsStart, Func->OutRelocations); |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 237 | }); |
| 238 | } |
| 239 | |
| 240 | uint32_t CodeSection::numRelocations() const { |
| 241 | uint32_t Count = 0; |
Sam Clegg | 5fa274b | 2018-01-10 01:13:34 +0000 | [diff] [blame^] | 242 | for (const InputChunk *Func : Functions) |
Sam Clegg | 8d146bb | 2018-01-09 23:56:44 +0000 | [diff] [blame] | 243 | Count += Func->OutRelocations.size(); |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 244 | return Count; |
| 245 | } |
| 246 | |
| 247 | void CodeSection::writeRelocations(raw_ostream &OS) const { |
Sam Clegg | 5fa274b | 2018-01-10 01:13:34 +0000 | [diff] [blame^] | 248 | for (const InputChunk *Func : Functions) |
Sam Clegg | 8d146bb | 2018-01-09 23:56:44 +0000 | [diff] [blame] | 249 | for (const OutputRelocation &Reloc : Func->OutRelocations) |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 250 | writeReloc(OS, Reloc); |
| 251 | } |
| 252 | |
Sam Clegg | 0fb6faa | 2017-12-08 01:09:21 +0000 | [diff] [blame] | 253 | DataSection::DataSection(ArrayRef<OutputSegment *> Segments) |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 254 | : OutputSection(WASM_SEC_DATA), Segments(Segments) { |
| 255 | raw_string_ostream OS(DataSectionHeader); |
| 256 | |
| 257 | writeUleb128(OS, Segments.size(), "data segment count"); |
| 258 | OS.flush(); |
| 259 | BodySize = DataSectionHeader.size(); |
| 260 | |
| 261 | for (OutputSegment *Segment : Segments) { |
| 262 | raw_string_ostream OS(Segment->Header); |
| 263 | writeUleb128(OS, 0, "memory index"); |
| 264 | writeUleb128(OS, WASM_OPCODE_I32_CONST, "opcode:i32const"); |
| 265 | writeSleb128(OS, Segment->StartVA, "memory offset"); |
| 266 | writeUleb128(OS, WASM_OPCODE_END, "opcode:end"); |
| 267 | writeUleb128(OS, Segment->Size, "segment size"); |
| 268 | OS.flush(); |
| 269 | Segment->setSectionOffset(BodySize); |
| 270 | BodySize += Segment->Header.size(); |
| 271 | log("Data segment: size=" + Twine(Segment->Size)); |
Sam Clegg | 5fa274b | 2018-01-10 01:13:34 +0000 | [diff] [blame^] | 272 | for (InputChunk *InputSeg : Segment->InputSegments) { |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 273 | uint32_t OutputOffset = Segment->getSectionOffset() + |
Sam Clegg | 5fa274b | 2018-01-10 01:13:34 +0000 | [diff] [blame^] | 274 | Segment->Header.size() + InputSeg->OutputOffset; |
Sam Clegg | 8d146bb | 2018-01-09 23:56:44 +0000 | [diff] [blame] | 275 | calcRelocations(InputSeg->File, InputSeg->Relocations, |
Sam Clegg | 5fa274b | 2018-01-10 01:13:34 +0000 | [diff] [blame^] | 276 | InputSeg->OutRelocations, |
| 277 | OutputOffset - InputSeg->getInputSectionOffset()); |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 278 | } |
| 279 | BodySize += Segment->Size; |
| 280 | } |
| 281 | |
| 282 | createHeader(BodySize); |
| 283 | } |
| 284 | |
| 285 | void DataSection::writeTo(uint8_t *Buf) { |
Sam Clegg | ab2ac29 | 2017-12-20 05:14:48 +0000 | [diff] [blame] | 286 | log("writing " + toString(*this) + " size=" + Twine(getSize()) + |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 287 | " body=" + Twine(BodySize)); |
| 288 | Buf += Offset; |
| 289 | |
| 290 | // Write section header |
| 291 | memcpy(Buf, Header.data(), Header.size()); |
| 292 | Buf += Header.size(); |
| 293 | |
| 294 | uint8_t *ContentsStart = Buf; |
| 295 | |
| 296 | // Write data section headers |
| 297 | memcpy(Buf, DataSectionHeader.data(), DataSectionHeader.size()); |
| 298 | |
| 299 | parallelForEach(Segments, [ContentsStart](const OutputSegment *Segment) { |
| 300 | // Write data segment header |
| 301 | uint8_t *SegStart = ContentsStart + Segment->getSectionOffset(); |
| 302 | memcpy(SegStart, Segment->Header.data(), Segment->Header.size()); |
| 303 | |
| 304 | // Write segment data payload |
Sam Clegg | 5fa274b | 2018-01-10 01:13:34 +0000 | [diff] [blame^] | 305 | for (const InputChunk *Input : Segment->InputSegments) { |
| 306 | memcpy(SegStart + Segment->Header.size() + Input->OutputOffset, |
| 307 | Input->getData(), Input->getSize()); |
Sam Clegg | 5e8cba9 | 2017-12-19 20:45:15 +0000 | [diff] [blame] | 308 | applyRelocations(ContentsStart, Input->OutRelocations); |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 309 | } |
| 310 | }); |
Sam Clegg | 5e8cba9 | 2017-12-19 20:45:15 +0000 | [diff] [blame] | 311 | } |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 312 | |
Sam Clegg | 5e8cba9 | 2017-12-19 20:45:15 +0000 | [diff] [blame] | 313 | uint32_t DataSection::numRelocations() const { |
| 314 | uint32_t Count = 0; |
| 315 | for (const OutputSegment *Seg : Segments) |
Sam Clegg | 5fa274b | 2018-01-10 01:13:34 +0000 | [diff] [blame^] | 316 | for (const InputChunk *InputSeg : Seg->InputSegments) |
Sam Clegg | 5e8cba9 | 2017-12-19 20:45:15 +0000 | [diff] [blame] | 317 | Count += InputSeg->OutRelocations.size(); |
| 318 | return Count; |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 319 | } |
| 320 | |
| 321 | void DataSection::writeRelocations(raw_ostream &OS) const { |
Sam Clegg | 5e8cba9 | 2017-12-19 20:45:15 +0000 | [diff] [blame] | 322 | for (const OutputSegment *Seg : Segments) |
Sam Clegg | 5fa274b | 2018-01-10 01:13:34 +0000 | [diff] [blame^] | 323 | for (const InputChunk *InputSeg : Seg->InputSegments) |
Sam Clegg | 5e8cba9 | 2017-12-19 20:45:15 +0000 | [diff] [blame] | 324 | for (const OutputRelocation &Reloc : InputSeg->OutRelocations) |
| 325 | writeReloc(OS, Reloc); |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 326 | } |