]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
Vendor import of lld trunk r233088:
[FreeBSD/FreeBSD.git] / lib / ReaderWriter / MachO / MachONormalizedFileBinaryReader.cpp
1 //===- lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.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 ///
11 /// \file For mach-o object files, this implementation converts from
12 /// mach-o on-disk binary format to in-memory normalized mach-o.
13 ///
14 ///                 +---------------+
15 ///                 | binary mach-o |
16 ///                 +---------------+
17 ///                        |
18 ///                        |
19 ///                        v
20 ///                  +------------+
21 ///                  | normalized |
22 ///                  +------------+
23
24 #include "MachONormalizedFile.h"
25 #include "ArchHandler.h"
26 #include "MachONormalizedFileBinaryUtils.h"
27 #include "lld/Core/Error.h"
28 #include "lld/Core/LLVM.h"
29 #include "lld/Core/SharedLibraryFile.h"
30 #include "llvm/ADT/SmallString.h"
31 #include "llvm/ADT/StringRef.h"
32 #include "llvm/ADT/StringSwitch.h"
33 #include "llvm/ADT/Twine.h"
34 #include "llvm/Object/MachO.h"
35 #include "llvm/Support/Casting.h"
36 #include "llvm/Support/Errc.h"
37 #include "llvm/Support/ErrorHandling.h"
38 #include "llvm/Support/FileOutputBuffer.h"
39 #include "llvm/Support/Host.h"
40 #include "llvm/Support/MachO.h"
41 #include "llvm/Support/MemoryBuffer.h"
42 #include "llvm/Support/raw_ostream.h"
43 #include <functional>
44 #include <system_error>
45
46 using namespace llvm::MachO;
47 using llvm::object::ExportEntry;
48 using llvm::object::MachOObjectFile;
49
50 namespace lld {
51 namespace mach_o {
52 namespace normalized {
53
54 // Utility to call a lambda expression on each load command.
55 static std::error_code forEachLoadCommand(
56     StringRef lcRange, unsigned lcCount, bool isBig, bool is64,
57     std::function<bool(uint32_t cmd, uint32_t size, const char *lc)> func) {
58   const char* p = lcRange.begin();
59   for (unsigned i=0; i < lcCount; ++i) {
60     const load_command *lc = reinterpret_cast<const load_command*>(p);
61     load_command lcCopy;
62     const load_command *slc = lc;
63     if (isBig != llvm::sys::IsBigEndianHost) {
64       memcpy(&lcCopy, lc, sizeof(load_command));
65       swapStruct(lcCopy);
66       slc = &lcCopy;
67     }
68     if ( (p + slc->cmdsize) > lcRange.end() )
69       return make_error_code(llvm::errc::executable_format_error);
70
71     if (func(slc->cmd, slc->cmdsize, p))
72       return std::error_code();
73
74     p += slc->cmdsize;
75   }
76
77   return std::error_code();
78 }
79
80 static std::error_code appendRelocations(Relocations &relocs, StringRef buffer,
81                                          bool bigEndian,
82                                          uint32_t reloff, uint32_t nreloc) {
83   if ((reloff + nreloc*8) > buffer.size())
84     return make_error_code(llvm::errc::executable_format_error);
85   const any_relocation_info* relocsArray =
86             reinterpret_cast<const any_relocation_info*>(buffer.begin()+reloff);
87
88   for(uint32_t i=0; i < nreloc; ++i) {
89     relocs.push_back(unpackRelocation(relocsArray[i], bigEndian));
90   }
91   return std::error_code();
92 }
93
94 static std::error_code
95 appendIndirectSymbols(IndirectSymbols &isyms, StringRef buffer, bool isBig,
96                       uint32_t istOffset, uint32_t istCount,
97                       uint32_t startIndex, uint32_t count) {
98   if ((istOffset + istCount*4) > buffer.size())
99     return make_error_code(llvm::errc::executable_format_error);
100   if (startIndex+count  > istCount)
101     return make_error_code(llvm::errc::executable_format_error);
102   const uint8_t *indirectSymbolArray = (const uint8_t *)buffer.data();
103
104   for(uint32_t i=0; i < count; ++i) {
105     isyms.push_back(read32(
106         indirectSymbolArray + (startIndex + i) * sizeof(uint32_t), isBig));
107   }
108   return std::error_code();
109 }
110
111
112 template <typename T> static T readBigEndian(T t) {
113   if (llvm::sys::IsLittleEndianHost)
114     llvm::sys::swapByteOrder(t);
115   return t;
116 }
117
118
119 static bool isMachOHeader(const mach_header *mh, bool &is64, bool &isBig) {
120   switch (read32(&mh->magic, false)) {
121   case llvm::MachO::MH_MAGIC:
122     is64 = false;
123     isBig = false;
124     return true;
125   case llvm::MachO::MH_MAGIC_64:
126     is64 = true;
127     isBig = false;
128     return true;
129   case llvm::MachO::MH_CIGAM:
130     is64 = false;
131     isBig = true;
132     return true;
133   case llvm::MachO::MH_CIGAM_64:
134     is64 = true;
135     isBig = true;
136     return true;
137   default:
138     return false;
139   }
140 }
141
142
143 bool isThinObjectFile(StringRef path, MachOLinkingContext::Arch &arch) {
144   // Try opening and mapping file at path.
145   ErrorOr<std::unique_ptr<MemoryBuffer>> b = MemoryBuffer::getFileOrSTDIN(path);
146   if (b.getError())
147     return false;
148
149   // If file length < 32 it is too small to be mach-o object file.
150   StringRef fileBuffer = b->get()->getBuffer();
151   if (fileBuffer.size() < 32)
152     return false;
153
154   // If file buffer does not start with MH_MAGIC (and variants), not obj file.
155   const mach_header *mh = reinterpret_cast<const mach_header *>(
156                                                             fileBuffer.begin());
157   bool is64, isBig;
158   if (!isMachOHeader(mh, is64, isBig))
159     return false;
160
161   // If not MH_OBJECT, not object file.
162   if (read32(&mh->filetype, isBig) != MH_OBJECT)
163     return false;
164
165   // Lookup up arch from cpu/subtype pair.
166   arch = MachOLinkingContext::archFromCpuType(
167       read32(&mh->cputype, isBig),
168       read32(&mh->cpusubtype, isBig));
169   return true;
170 }
171
172
173 bool sliceFromFatFile(const MemoryBuffer &mb, MachOLinkingContext::Arch arch,
174                                              uint32_t &offset, uint32_t &size) {
175   const char *start = mb.getBufferStart();
176   const llvm::MachO::fat_header *fh =
177       reinterpret_cast<const llvm::MachO::fat_header *>(start);
178   if (readBigEndian(fh->magic) != llvm::MachO::FAT_MAGIC)
179     return false;
180   uint32_t nfat_arch = readBigEndian(fh->nfat_arch);
181   const fat_arch *fstart =
182       reinterpret_cast<const fat_arch *>(start + sizeof(fat_header));
183   const fat_arch *fend =
184       reinterpret_cast<const fat_arch *>(start + sizeof(fat_header) +
185                                          sizeof(fat_arch) * nfat_arch);
186   const uint32_t reqCpuType = MachOLinkingContext::cpuTypeFromArch(arch);
187   const uint32_t reqCpuSubtype = MachOLinkingContext::cpuSubtypeFromArch(arch);
188   for (const fat_arch *fa = fstart; fa < fend; ++fa) {
189     if ((readBigEndian(fa->cputype) == reqCpuType) &&
190         (readBigEndian(fa->cpusubtype) == reqCpuSubtype)) {
191       offset = readBigEndian(fa->offset);
192       size = readBigEndian(fa->size);
193       if ((offset + size) > mb.getBufferSize())
194         return false;
195       return true;
196     }
197   }
198   return false;
199 }
200
201 /// Reads a mach-o file and produces an in-memory normalized view.
202 ErrorOr<std::unique_ptr<NormalizedFile>>
203 readBinary(std::unique_ptr<MemoryBuffer> &mb,
204            const MachOLinkingContext::Arch arch) {
205   // Make empty NormalizedFile.
206   std::unique_ptr<NormalizedFile> f(new NormalizedFile());
207
208   const char *start = mb->getBufferStart();
209   size_t objSize = mb->getBufferSize();
210   const mach_header *mh = reinterpret_cast<const mach_header *>(start);
211
212   uint32_t sliceOffset;
213   uint32_t sliceSize;
214   if (sliceFromFatFile(*mb, arch, sliceOffset, sliceSize)) {
215     start = &start[sliceOffset];
216     objSize = sliceSize;
217     mh = reinterpret_cast<const mach_header *>(start);
218   }
219
220   // Determine endianness and pointer size for mach-o file.
221   bool is64, isBig;
222   if (!isMachOHeader(mh, is64, isBig))
223     return make_error_code(llvm::errc::executable_format_error);
224
225   // Endian swap header, if needed.
226   mach_header headerCopy;
227   const mach_header *smh = mh;
228   if (isBig != llvm::sys::IsBigEndianHost) {
229     memcpy(&headerCopy, mh, sizeof(mach_header));
230     swapStruct(headerCopy);
231     smh = &headerCopy;
232   }
233
234   // Validate head and load commands fit in buffer.
235   const uint32_t lcCount = smh->ncmds;
236   const char *lcStart =
237       start + (is64 ? sizeof(mach_header_64) : sizeof(mach_header));
238   StringRef lcRange(lcStart, smh->sizeofcmds);
239   if (lcRange.end() > (start + objSize))
240     return make_error_code(llvm::errc::executable_format_error);
241
242   // Get architecture from mach_header.
243   f->arch = MachOLinkingContext::archFromCpuType(smh->cputype, smh->cpusubtype);
244   if (f->arch != arch) {
245     return make_dynamic_error_code(Twine("file is wrong architecture. Expected "
246                                   "(" + MachOLinkingContext::nameFromArch(arch)
247                                   + ") found ("
248                                   + MachOLinkingContext::nameFromArch(f->arch)
249                                   + ")" ));
250   }
251   // Copy file type and flags
252   f->fileType = HeaderFileType(smh->filetype);
253   f->flags = smh->flags;
254
255
256   // Pre-scan load commands looking for indirect symbol table.
257   uint32_t indirectSymbolTableOffset = 0;
258   uint32_t indirectSymbolTableCount = 0;
259   std::error_code ec = forEachLoadCommand(lcRange, lcCount, isBig, is64,
260                                           [&](uint32_t cmd, uint32_t size,
261                                               const char *lc) -> bool {
262     if (cmd == LC_DYSYMTAB) {
263       const dysymtab_command *d = reinterpret_cast<const dysymtab_command*>(lc);
264       indirectSymbolTableOffset = read32(&d->indirectsymoff, isBig);
265       indirectSymbolTableCount = read32(&d->nindirectsyms, isBig);
266       return true;
267     }
268     return false;
269   });
270   if (ec)
271     return ec;
272
273   // Walk load commands looking for segments/sections and the symbol table.
274   const data_in_code_entry *dataInCode = nullptr;
275   const dyld_info_command *dyldInfo = nullptr;
276   uint32_t dataInCodeSize = 0;
277   ec = forEachLoadCommand(lcRange, lcCount, isBig, is64,
278                     [&] (uint32_t cmd, uint32_t size, const char* lc) -> bool {
279     switch(cmd) {
280     case LC_SEGMENT_64:
281       if (is64) {
282         const segment_command_64 *seg =
283                               reinterpret_cast<const segment_command_64*>(lc);
284         const unsigned sectionCount = read32(&seg->nsects, isBig);
285         const section_64 *sects = reinterpret_cast<const section_64*>
286                                   (lc + sizeof(segment_command_64));
287         const unsigned lcSize = sizeof(segment_command_64)
288                                               + sectionCount*sizeof(section_64);
289         // Verify sections don't extend beyond end of segment load command.
290         if (lcSize > size)
291           return true;
292         for (unsigned i=0; i < sectionCount; ++i) {
293           const section_64 *sect = &sects[i];
294           Section section;
295           section.segmentName = getString16(sect->segname);
296           section.sectionName = getString16(sect->sectname);
297           section.type = (SectionType)(read32(&sect->flags, isBig) &
298                                        SECTION_TYPE);
299           section.attributes  = read32(&sect->flags, isBig) & SECTION_ATTRIBUTES;
300           section.alignment   = read32(&sect->align, isBig);
301           section.address     = read64(&sect->addr, isBig);
302           const uint8_t *content =
303             (const uint8_t *)start + read32(&sect->offset, isBig);
304           size_t contentSize = read64(&sect->size, isBig);
305           // Note: this assign() is copying the content bytes.  Ideally,
306           // we can use a custom allocator for vector to avoid the copy.
307           section.content = llvm::makeArrayRef(content, contentSize);
308           appendRelocations(section.relocations, mb->getBuffer(), isBig,
309                             read32(&sect->reloff, isBig),
310                             read32(&sect->nreloc, isBig));
311           if (section.type == S_NON_LAZY_SYMBOL_POINTERS) {
312             appendIndirectSymbols(section.indirectSymbols, mb->getBuffer(),
313                                   isBig,
314                                   indirectSymbolTableOffset,
315                                   indirectSymbolTableCount,
316                                   read32(&sect->reserved1, isBig),
317                                   contentSize/4);
318           }
319           f->sections.push_back(section);
320         }
321       }
322       break;
323     case LC_SEGMENT:
324       if (!is64) {
325         const segment_command *seg =
326                               reinterpret_cast<const segment_command*>(lc);
327         const unsigned sectionCount = read32(&seg->nsects, isBig);
328         const section *sects = reinterpret_cast<const section*>
329                                   (lc + sizeof(segment_command));
330         const unsigned lcSize = sizeof(segment_command)
331                                               + sectionCount*sizeof(section);
332         // Verify sections don't extend beyond end of segment load command.
333         if (lcSize > size)
334           return true;
335         for (unsigned i=0; i < sectionCount; ++i) {
336           const section *sect = &sects[i];
337           Section section;
338           section.segmentName = getString16(sect->segname);
339           section.sectionName = getString16(sect->sectname);
340           section.type = (SectionType)(read32(&sect->flags, isBig) &
341                                        SECTION_TYPE);
342           section.attributes =
343               read32((const uint8_t *)&sect->flags, isBig) & SECTION_ATTRIBUTES;
344           section.alignment   = read32(&sect->align, isBig);
345           section.address     = read32(&sect->addr, isBig);
346           const uint8_t *content =
347             (const uint8_t *)start + read32(&sect->offset, isBig);
348           size_t contentSize = read32(&sect->size, isBig);
349           // Note: this assign() is copying the content bytes.  Ideally,
350           // we can use a custom allocator for vector to avoid the copy.
351           section.content = llvm::makeArrayRef(content, contentSize);
352           appendRelocations(section.relocations, mb->getBuffer(), isBig,
353                             read32(&sect->reloff, isBig),
354                             read32(&sect->nreloc, isBig));
355           if (section.type == S_NON_LAZY_SYMBOL_POINTERS) {
356             appendIndirectSymbols(
357                 section.indirectSymbols, mb->getBuffer(), isBig,
358                 indirectSymbolTableOffset, indirectSymbolTableCount,
359                 read32(&sect->reserved1, isBig), contentSize / 4);
360           }
361           f->sections.push_back(section);
362         }
363       }
364       break;
365     case LC_SYMTAB: {
366       const symtab_command *st = reinterpret_cast<const symtab_command*>(lc);
367       const char *strings = start + read32(&st->stroff, isBig);
368       const uint32_t strSize = read32(&st->strsize, isBig);
369       // Validate string pool and symbol table all in buffer.
370       if (read32((const uint8_t *)&st->stroff, isBig) +
371               read32((const uint8_t *)&st->strsize, isBig) >
372           objSize)
373         return true;
374       if (is64) {
375         const uint32_t symOffset = read32(&st->symoff, isBig);
376         const uint32_t symCount = read32(&st->nsyms, isBig);
377         if ( symOffset+(symCount*sizeof(nlist_64)) > objSize)
378           return true;
379         const nlist_64 *symbols =
380             reinterpret_cast<const nlist_64 *>(start + symOffset);
381         // Convert each nlist_64 to a lld::mach_o::normalized::Symbol.
382         for(uint32_t i=0; i < symCount; ++i) {
383           const nlist_64 *sin = &symbols[i];
384           nlist_64 tempSym;
385           if (isBig != llvm::sys::IsBigEndianHost) {
386             tempSym = *sin; swapStruct(tempSym); sin = &tempSym;
387           }
388           Symbol sout;
389           if (sin->n_strx > strSize)
390             return true;
391           sout.name  = &strings[sin->n_strx];
392           sout.type  = (NListType)(sin->n_type & N_TYPE);
393           sout.scope = (sin->n_type & (N_PEXT|N_EXT));
394           sout.sect  = sin->n_sect;
395           sout.desc  = sin->n_desc;
396           sout.value = sin->n_value;
397           if (sout.type == N_UNDF)
398             f->undefinedSymbols.push_back(sout);
399           else if (sin->n_type & N_EXT)
400             f->globalSymbols.push_back(sout);
401           else
402             f->localSymbols.push_back(sout);
403         }
404       } else {
405         const uint32_t symOffset = read32(&st->symoff, isBig);
406         const uint32_t symCount = read32(&st->nsyms, isBig);
407         if ( symOffset+(symCount*sizeof(nlist)) > objSize)
408           return true;
409         const nlist *symbols =
410             reinterpret_cast<const nlist *>(start + symOffset);
411         // Convert each nlist to a lld::mach_o::normalized::Symbol.
412         for(uint32_t i=0; i < symCount; ++i) {
413           const nlist *sin = &symbols[i];
414           nlist tempSym;
415           if (isBig != llvm::sys::IsBigEndianHost) {
416             tempSym = *sin; swapStruct(tempSym); sin = &tempSym;
417           }
418           Symbol sout;
419           if (sin->n_strx > strSize)
420             return true;
421           sout.name  = &strings[sin->n_strx];
422           sout.type  = (NListType)(sin->n_type & N_TYPE);
423           sout.scope = (sin->n_type & (N_PEXT|N_EXT));
424           sout.sect  = sin->n_sect;
425           sout.desc  = sin->n_desc;
426           sout.value = sin->n_value;
427           if (sout.type == N_UNDF)
428             f->undefinedSymbols.push_back(sout);
429           else if (sout.scope == (SymbolScope)N_EXT)
430             f->globalSymbols.push_back(sout);
431           else
432             f->localSymbols.push_back(sout);
433         }
434       }
435       }
436       break;
437     case LC_ID_DYLIB: {
438       const dylib_command *dl = reinterpret_cast<const dylib_command*>(lc);
439       f->installName = lc + read32(&dl->dylib.name, isBig);
440       f->currentVersion = read32(&dl->dylib.current_version, isBig);
441       f->compatVersion = read32(&dl->dylib.compatibility_version, isBig);
442       }
443       break;
444     case LC_DATA_IN_CODE: {
445       const linkedit_data_command *ldc =
446                             reinterpret_cast<const linkedit_data_command*>(lc);
447       dataInCode = reinterpret_cast<const data_in_code_entry *>(
448           start + read32(&ldc->dataoff, isBig));
449       dataInCodeSize = read32(&ldc->datasize, isBig);
450       }
451       break;
452     case LC_LOAD_DYLIB:
453     case LC_LOAD_WEAK_DYLIB:
454     case LC_REEXPORT_DYLIB:
455     case LC_LOAD_UPWARD_DYLIB: {
456       const dylib_command *dl = reinterpret_cast<const dylib_command*>(lc);
457       DependentDylib entry;
458       entry.path = lc + read32(&dl->dylib.name, isBig);
459       entry.kind = LoadCommandType(cmd);
460       entry.compatVersion = read32(&dl->dylib.compatibility_version, isBig);
461       entry.currentVersion = read32(&dl->dylib.current_version, isBig);
462       f->dependentDylibs.push_back(entry);
463      }
464       break;
465     case LC_RPATH: {
466       const rpath_command *rpc = reinterpret_cast<const rpath_command *>(lc);
467       f->rpaths.push_back(lc + read32(&rpc->path, isBig));
468      }
469       break;
470     case LC_DYLD_INFO:
471     case LC_DYLD_INFO_ONLY:
472       dyldInfo = reinterpret_cast<const dyld_info_command*>(lc);
473       break;
474     }
475     return false;
476   });
477   if (ec)
478     return ec;
479
480   if (dataInCode) {
481     // Convert on-disk data_in_code_entry array to DataInCode vector.
482     for (unsigned i=0; i < dataInCodeSize/sizeof(data_in_code_entry); ++i) {
483       DataInCode entry;
484       entry.offset = read32(&dataInCode[i].offset, isBig);
485       entry.length = read16(&dataInCode[i].length, isBig);
486       entry.kind =
487           (DataRegionType)read16((const uint8_t *)&dataInCode[i].kind, isBig);
488       f->dataInCode.push_back(entry);
489     }
490   }
491
492   if (dyldInfo) {
493     // If any exports, extract and add to normalized exportInfo vector.
494     if (dyldInfo->export_size) {
495       const uint8_t *trieStart = reinterpret_cast<const uint8_t*>(start +
496                                                           dyldInfo->export_off);
497       ArrayRef<uint8_t> trie(trieStart, dyldInfo->export_size);
498       for (const ExportEntry &trieExport : MachOObjectFile::exports(trie)) {
499         Export normExport;
500         normExport.name = trieExport.name().copy(f->ownedAllocations);
501         normExport.offset = trieExport.address();
502         normExport.kind = ExportSymbolKind(trieExport.flags() & EXPORT_SYMBOL_FLAGS_KIND_MASK);
503         normExport.flags = trieExport.flags() & ~EXPORT_SYMBOL_FLAGS_KIND_MASK;
504         normExport.otherOffset = trieExport.other();
505         if (!trieExport.otherName().empty())
506           normExport.otherName = trieExport.otherName().copy(f->ownedAllocations);
507         f->exportInfo.push_back(normExport);
508       }
509     }
510   }
511
512   return std::move(f);
513 }
514
515 class MachOObjectReader : public Reader {
516 public:
517   MachOObjectReader(MachOLinkingContext &ctx) : _ctx(ctx) {}
518
519   bool canParse(file_magic magic, StringRef ext,
520                 const MemoryBuffer &mb) const override {
521     switch (magic) {
522     case llvm::sys::fs::file_magic::macho_object:
523       return (mb.getBufferSize() > 32);
524     default:
525       return false;
526     }
527   }
528
529   std::error_code
530   loadFile(std::unique_ptr<MemoryBuffer> mb, const Registry &registry,
531            std::vector<std::unique_ptr<File>> &result) const override {
532     auto *file = new MachOFile(std::move(mb), &_ctx);
533     result.push_back(std::unique_ptr<MachOFile>(file));
534     return std::error_code();
535   }
536
537 private:
538   MachOLinkingContext &_ctx;
539 };
540
541 class MachODylibReader : public Reader {
542 public:
543   MachODylibReader(MachOLinkingContext &ctx) : _ctx(ctx) {}
544
545   bool canParse(file_magic magic, StringRef ext,
546                 const MemoryBuffer &mb) const override {
547     switch (magic) {
548     case llvm::sys::fs::file_magic::macho_dynamically_linked_shared_lib:
549     case llvm::sys::fs::file_magic::macho_dynamically_linked_shared_lib_stub:
550       return (mb.getBufferSize() > 32);
551     default:
552       return false;
553     }
554   }
555
556   std::error_code
557   loadFile(std::unique_ptr<MemoryBuffer> mb, const Registry &registry,
558            std::vector<std::unique_ptr<File>> &result) const override {
559     auto *file = new MachODylibFile(std::move(mb), &_ctx);
560     result.push_back(std::unique_ptr<MachODylibFile>(file));
561     return std::error_code();
562   }
563
564 private:
565   MachOLinkingContext &_ctx;
566 };
567
568 } // namespace normalized
569 } // namespace mach_o
570
571 void Registry::addSupportMachOObjects(MachOLinkingContext &ctx) {
572   MachOLinkingContext::Arch arch = ctx.arch();
573   add(std::unique_ptr<Reader>(new mach_o::normalized::MachOObjectReader(ctx)));
574   add(std::unique_ptr<Reader>(new mach_o::normalized::MachODylibReader(ctx)));
575   addKindTable(Reference::KindNamespace::mach_o, ctx.archHandler().kindArch(),
576                ctx.archHandler().kindStrings());
577   add(std::unique_ptr<YamlIOTaggedDocumentHandler>(
578                            new mach_o::MachOYamlIOTaggedDocumentHandler(arch)));
579 }
580
581
582 } // namespace lld