1 //===- UnwindInfoSection.cpp ----------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "UnwindInfoSection.h"
10 #include "Config.h"
11 #include "InputSection.h"
12 #include "MergedOutputSection.h"
13 #include "OutputSection.h"
14 #include "OutputSegment.h"
15 #include "SymbolTable.h"
16 #include "Symbols.h"
17 #include "SyntheticSections.h"
18 #include "Target.h"
19 
20 #include "lld/Common/ErrorHandler.h"
21 #include "lld/Common/Memory.h"
22 #include "llvm/ADT/SmallVector.h"
23 #include "llvm/ADT/STLExtras.h"
24 #include "llvm/BinaryFormat/MachO.h"
25 
26 using namespace llvm;
27 using namespace llvm::MachO;
28 using namespace lld;
29 using namespace lld::macho;
30 
31 #define COMMON_ENCODINGS_MAX 127
32 #define COMPACT_ENCODINGS_MAX 256
33 
34 #define SECOND_LEVEL_PAGE_BYTES 4096
35 #define SECOND_LEVEL_PAGE_WORDS (SECOND_LEVEL_PAGE_BYTES / sizeof(uint32_t))
36 #define REGULAR_SECOND_LEVEL_ENTRIES_MAX                                       \
37   ((SECOND_LEVEL_PAGE_BYTES -                                                  \
38     sizeof(unwind_info_regular_second_level_page_header)) /                    \
39    sizeof(unwind_info_regular_second_level_entry))
40 #define COMPRESSED_SECOND_LEVEL_ENTRIES_MAX                                    \
41   ((SECOND_LEVEL_PAGE_BYTES -                                                  \
42     sizeof(unwind_info_compressed_second_level_page_header)) /                 \
43    sizeof(uint32_t))
44 
45 #define COMPRESSED_ENTRY_FUNC_OFFSET_BITS 24
46 #define COMPRESSED_ENTRY_FUNC_OFFSET_MASK                                      \
47   UNWIND_INFO_COMPRESSED_ENTRY_FUNC_OFFSET(~0)
48 
49 // Compact Unwind format is a Mach-O evolution of DWARF Unwind that
50 // optimizes space and exception-time lookup.  Most DWARF unwind
51 // entries can be replaced with Compact Unwind entries, but the ones
52 // that cannot are retained in DWARF form.
53 //
54 // This comment will address macro-level organization of the pre-link
55 // and post-link compact unwind tables. For micro-level organization
56 // pertaining to the bitfield layout of the 32-bit compact unwind
57 // entries, see libunwind/include/mach-o/compact_unwind_encoding.h
58 //
59 // Important clarifying factoids:
60 //
61 // * __LD,__compact_unwind is the compact unwind format for compiler
62 // output and linker input. It is never a final output. It could be
63 // an intermediate output with the `-r` option which retains relocs.
64 //
65 // * __TEXT,__unwind_info is the compact unwind format for final
66 // linker output. It is never an input.
67 //
68 // * __TEXT,__eh_frame is the DWARF format for both linker input and output.
69 //
70 // * __TEXT,__unwind_info entries are divided into 4 KiB pages (2nd
71 // level) by ascending address, and the pages are referenced by an
72 // index (1st level) in the section header.
73 //
74 // * Following the headers in __TEXT,__unwind_info, the bulk of the
75 // section contains a vector of compact unwind entries
76 // `{functionOffset, encoding}` sorted by ascending `functionOffset`.
77 // Adjacent entries with the same encoding can be folded to great
78 // advantage, achieving a 3-order-of-magnitude reduction in the
79 // number of entries.
80 //
81 // * The __TEXT,__unwind_info format can accommodate up to 127 unique
82 // encodings for the space-efficient compressed format. In practice,
83 // fewer than a dozen unique encodings are used by C++ programs of
84 // all sizes. Therefore, we don't even bother implementing the regular
85 // non-compressed format. Time will tell if anyone in the field ever
86 // overflows the 127-encodings limit.
87 //
88 // Refer to the definition of unwind_info_section_header in
89 // compact_unwind_encoding.h for an overview of the format we are encoding
90 // here.
91 
92 // TODO(gkm): prune __eh_frame entries superseded by __unwind_info
93 // TODO(gkm): how do we align the 2nd-level pages?
94 
95 using EncodingMap = llvm::DenseMap<compact_unwind_encoding_t, size_t>;
96 
97 template <class Ptr> struct CompactUnwindEntry {
98   Ptr functionAddress;
99   uint32_t functionLength;
100   compact_unwind_encoding_t encoding;
101   Ptr personality;
102   Ptr lsda;
103 };
104 
105 struct SecondLevelPage {
106   uint32_t kind;
107   size_t entryIndex;
108   size_t entryCount;
109   size_t byteCount;
110   std::vector<compact_unwind_encoding_t> localEncodings;
111   EncodingMap localEncodingIndexes;
112 };
113 
114 template <class Ptr> class UnwindInfoSectionImpl : public UnwindInfoSection {
115 public:
116   void prepareRelocations(InputSection *) override;
117   void finalize() override;
118   void writeTo(uint8_t *buf) const override;
119 
120 private:
121   std::vector<std::pair<compact_unwind_encoding_t, size_t>> commonEncodings;
122   EncodingMap commonEncodingIndexes;
123   // Indices of personality functions within the GOT.
124   std::vector<uint32_t> personalities;
125   SmallDenseMap<std::pair<InputSection *, uint64_t /* addend */>, Symbol *>
126       personalityTable;
127   std::vector<unwind_info_section_header_lsda_index_entry> lsdaEntries;
128   // Map of function offset (from the image base) to an index within the LSDA
129   // array.
130   llvm::DenseMap<uint32_t, uint32_t> functionToLsdaIndex;
131   std::vector<CompactUnwindEntry<Ptr>> cuVector;
132   std::vector<CompactUnwindEntry<Ptr> *> cuPtrVector;
133   std::vector<SecondLevelPage> secondLevelPages;
134   uint64_t level2PagesOffset = 0;
135 };
136 
137 // Compact unwind relocations have different semantics, so we handle them in a
138 // separate code path from regular relocations. First, we do not wish to add
139 // rebase opcodes for __LD,__compact_unwind, because that section doesn't
140 // actually end up in the final binary. Second, personality pointers always
141 // reside in the GOT and must be treated specially.
142 template <class Ptr>
143 void UnwindInfoSectionImpl<Ptr>::prepareRelocations(InputSection *isec) {
144   assert(isec->segname == segment_names::ld &&
145          isec->name == section_names::compactUnwind);
146 
147   for (Reloc &r : isec->relocs) {
148     assert(target->hasAttr(r.type, RelocAttrBits::UNSIGNED));
149     if (r.offset % sizeof(CompactUnwindEntry<Ptr>) !=
150         offsetof(CompactUnwindEntry<Ptr>, personality))
151       continue;
152 
153     if (auto *s = r.referent.dyn_cast<Symbol *>()) {
154       if (auto *undefined = dyn_cast<Undefined>(s)) {
155         treatUndefinedSymbol(*undefined);
156         // treatUndefinedSymbol() can replace s with a DylibSymbol; re-check.
157         if (isa<Undefined>(s))
158           continue;
159       }
160       if (auto *defined = dyn_cast<Defined>(s)) {
161         // Check if we have created a synthetic symbol at the same address.
162         Symbol *&personality =
163             personalityTable[{defined->isec, defined->value}];
164         if (personality == nullptr) {
165           personality = defined;
166           in.got->addEntry(defined);
167         } else if (personality != defined) {
168           r.referent = personality;
169         }
170         continue;
171       }
172       assert(isa<DylibSymbol>(s));
173       in.got->addEntry(s);
174       continue;
175     }
176 
177     if (auto *referentIsec = r.referent.dyn_cast<InputSection *>()) {
178       // Personality functions can be referenced via section relocations
179       // if they live in the same object file. Create placeholder synthetic
180       // symbols for them in the GOT.
181       Symbol *&s = personalityTable[{referentIsec, r.addend}];
182       if (s == nullptr) {
183         s = make<Defined>("<internal>", /*file=*/nullptr, referentIsec,
184                           r.addend, /*size=*/0, /*isWeakDef=*/false,
185                           /*isExternal=*/false, /*isPrivateExtern=*/false);
186         in.got->addEntry(s);
187       }
188       r.referent = s;
189       r.addend = 0;
190     }
191   }
192 }
193 
194 // Unwind info lives in __DATA, and finalization of __TEXT will occur before
195 // finalization of __DATA. Moreover, the finalization of unwind info depends on
196 // the exact addresses that it references. So it is safe for compact unwind to
197 // reference addresses in __TEXT, but not addresses in any other segment.
198 static void checkTextSegment(InputSection *isec) {
199   if (isec->segname != segment_names::text)
200     error("compact unwind references address in " + toString(isec) +
201           " which is not in segment __TEXT");
202 }
203 
204 // We need to apply the relocations to the pre-link compact unwind section
205 // before converting it to post-link form. There should only be absolute
206 // relocations here: since we are not emitting the pre-link CU section, there
207 // is no source address to make a relative location meaningful.
208 template <class Ptr>
209 static void
210 relocateCompactUnwind(MergedOutputSection *compactUnwindSection,
211                       std::vector<CompactUnwindEntry<Ptr>> &cuVector) {
212   for (const InputSection *isec : compactUnwindSection->inputs) {
213     uint8_t *buf =
214         reinterpret_cast<uint8_t *>(cuVector.data()) + isec->outSecFileOff;
215     memcpy(buf, isec->data.data(), isec->data.size());
216 
217     for (const Reloc &r : isec->relocs) {
218       uint64_t referentVA = 0;
219       if (auto *referentSym = r.referent.dyn_cast<Symbol *>()) {
220         if (!isa<Undefined>(referentSym)) {
221           assert(referentSym->isInGot());
222           if (auto *defined = dyn_cast<Defined>(referentSym))
223             checkTextSegment(defined->isec);
224           // At this point in the link, we may not yet know the final address of
225           // the GOT, so we just encode the index. We make it a 1-based index so
226           // that we can distinguish the null pointer case.
227           referentVA = referentSym->gotIndex + 1;
228         }
229       } else if (auto *referentIsec = r.referent.dyn_cast<InputSection *>()) {
230         checkTextSegment(referentIsec);
231         referentVA = referentIsec->getVA() + r.addend;
232       }
233 
234       writeAddress(buf + r.offset, referentVA, r.length);
235     }
236   }
237 }
238 
239 // There should only be a handful of unique personality pointers, so we can
240 // encode them as 2-bit indices into a small array.
241 template <class Ptr>
242 void encodePersonalities(
243     const std::vector<CompactUnwindEntry<Ptr> *> &cuPtrVector,
244     std::vector<uint32_t> &personalities) {
245   for (CompactUnwindEntry<Ptr> *cu : cuPtrVector) {
246     if (cu->personality == 0)
247       continue;
248     // Linear search is fast enough for a small array.
249     auto it = find(personalities, cu->personality);
250     uint32_t personalityIndex; // 1-based index
251     if (it != personalities.end()) {
252       personalityIndex = std::distance(personalities.begin(), it) + 1;
253     } else {
254       personalities.push_back(cu->personality);
255       personalityIndex = personalities.size();
256     }
257     cu->encoding |=
258         personalityIndex << countTrailingZeros(
259             static_cast<compact_unwind_encoding_t>(UNWIND_PERSONALITY_MASK));
260   }
261   if (personalities.size() > 3)
262     error("too many personalities (" + std::to_string(personalities.size()) +
263           ") for compact unwind to encode");
264 }
265 
266 // Scan the __LD,__compact_unwind entries and compute the space needs of
267 // __TEXT,__unwind_info and __TEXT,__eh_frame
268 template <class Ptr> void UnwindInfoSectionImpl<Ptr>::finalize() {
269   if (compactUnwindSection == nullptr)
270     return;
271 
272   // At this point, the address space for __TEXT,__text has been
273   // assigned, so we can relocate the __LD,__compact_unwind entries
274   // into a temporary buffer. Relocation is necessary in order to sort
275   // the CU entries by function address. Sorting is necessary so that
276   // we can fold adjacent CU entries with identical
277   // encoding+personality+lsda. Folding is necessary because it reduces
278   // the number of CU entries by as much as 3 orders of magnitude!
279   compactUnwindSection->finalize();
280   assert(compactUnwindSection->getSize() % sizeof(CompactUnwindEntry<Ptr>) ==
281          0);
282   size_t cuCount =
283       compactUnwindSection->getSize() / sizeof(CompactUnwindEntry<Ptr>);
284   cuVector.resize(cuCount);
285   relocateCompactUnwind(compactUnwindSection, cuVector);
286 
287   // Rather than sort & fold the 32-byte entries directly, we create a
288   // vector of pointers to entries and sort & fold that instead.
289   cuPtrVector.reserve(cuCount);
290   for (CompactUnwindEntry<Ptr> &cuEntry : cuVector)
291     cuPtrVector.emplace_back(&cuEntry);
292   llvm::sort(cuPtrVector, [](const CompactUnwindEntry<Ptr> *a,
293                              const CompactUnwindEntry<Ptr> *b) {
294     return a->functionAddress < b->functionAddress;
295   });
296 
297   // Fold adjacent entries with matching encoding+personality+lsda
298   // We use three iterators on the same cuPtrVector to fold in-situ:
299   // (1) `foldBegin` is the first of a potential sequence of matching entries
300   // (2) `foldEnd` is the first non-matching entry after `foldBegin`.
301   // The semi-open interval [ foldBegin .. foldEnd ) contains a range
302   // entries that can be folded into a single entry and written to ...
303   // (3) `foldWrite`
304   auto foldWrite = cuPtrVector.begin();
305   for (auto foldBegin = cuPtrVector.begin(); foldBegin < cuPtrVector.end();) {
306     auto foldEnd = foldBegin;
307     while (++foldEnd < cuPtrVector.end() &&
308            (*foldBegin)->encoding == (*foldEnd)->encoding &&
309            (*foldBegin)->personality == (*foldEnd)->personality &&
310            (*foldBegin)->lsda == (*foldEnd)->lsda)
311       ;
312     *foldWrite++ = *foldBegin;
313     foldBegin = foldEnd;
314   }
315   cuPtrVector.erase(foldWrite, cuPtrVector.end());
316 
317   encodePersonalities(cuPtrVector, personalities);
318 
319   // Count frequencies of the folded encodings
320   EncodingMap encodingFrequencies;
321   for (const CompactUnwindEntry<Ptr> *cuPtrEntry : cuPtrVector)
322     encodingFrequencies[cuPtrEntry->encoding]++;
323 
324   // Make a vector of encodings, sorted by descending frequency
325   for (const auto &frequency : encodingFrequencies)
326     commonEncodings.emplace_back(frequency);
327   llvm::sort(commonEncodings,
328              [](const std::pair<compact_unwind_encoding_t, size_t> &a,
329                 const std::pair<compact_unwind_encoding_t, size_t> &b) {
330                if (a.second == b.second)
331                  // When frequencies match, secondarily sort on encoding
332                  // to maintain parity with validate-unwind-info.py
333                  return a.first > b.first;
334                return a.second > b.second;
335              });
336 
337   // Truncate the vector to 127 elements.
338   // Common encoding indexes are limited to 0..126, while encoding
339   // indexes 127..255 are local to each second-level page
340   if (commonEncodings.size() > COMMON_ENCODINGS_MAX)
341     commonEncodings.resize(COMMON_ENCODINGS_MAX);
342 
343   // Create a map from encoding to common-encoding-table index
344   for (size_t i = 0; i < commonEncodings.size(); i++)
345     commonEncodingIndexes[commonEncodings[i].first] = i;
346 
347   // Split folded encodings into pages, where each page is limited by ...
348   // (a) 4 KiB capacity
349   // (b) 24-bit difference between first & final function address
350   // (c) 8-bit compact-encoding-table index,
351   //     for which 0..126 references the global common-encodings table,
352   //     and 127..255 references a local per-second-level-page table.
353   // First we try the compact format and determine how many entries fit.
354   // If more entries fit in the regular format, we use that.
355   for (size_t i = 0; i < cuPtrVector.size();) {
356     secondLevelPages.emplace_back();
357     SecondLevelPage &page = secondLevelPages.back();
358     page.entryIndex = i;
359     uintptr_t functionAddressMax =
360         cuPtrVector[i]->functionAddress + COMPRESSED_ENTRY_FUNC_OFFSET_MASK;
361     size_t n = commonEncodings.size();
362     size_t wordsRemaining =
363         SECOND_LEVEL_PAGE_WORDS -
364         sizeof(unwind_info_compressed_second_level_page_header) /
365             sizeof(uint32_t);
366     while (wordsRemaining >= 1 && i < cuPtrVector.size()) {
367       const CompactUnwindEntry<Ptr> *cuPtr = cuPtrVector[i];
368       if (cuPtr->functionAddress >= functionAddressMax) {
369         break;
370       } else if (commonEncodingIndexes.count(cuPtr->encoding) ||
371                  page.localEncodingIndexes.count(cuPtr->encoding)) {
372         i++;
373         wordsRemaining--;
374       } else if (wordsRemaining >= 2 && n < COMPACT_ENCODINGS_MAX) {
375         page.localEncodings.emplace_back(cuPtr->encoding);
376         page.localEncodingIndexes[cuPtr->encoding] = n++;
377         i++;
378         wordsRemaining -= 2;
379       } else {
380         break;
381       }
382     }
383     page.entryCount = i - page.entryIndex;
384 
385     // If this is not the final page, see if it's possible to fit more
386     // entries by using the regular format. This can happen when there
387     // are many unique encodings, and we we saturated the local
388     // encoding table early.
389     if (i < cuPtrVector.size() &&
390         page.entryCount < REGULAR_SECOND_LEVEL_ENTRIES_MAX) {
391       page.kind = UNWIND_SECOND_LEVEL_REGULAR;
392       page.entryCount = std::min(REGULAR_SECOND_LEVEL_ENTRIES_MAX,
393                                  cuPtrVector.size() - page.entryIndex);
394       i = page.entryIndex + page.entryCount;
395     } else {
396       page.kind = UNWIND_SECOND_LEVEL_COMPRESSED;
397     }
398   }
399 
400   for (const CompactUnwindEntry<Ptr> *cu : cuPtrVector) {
401     uint32_t functionOffset = cu->functionAddress - in.header->addr;
402     functionToLsdaIndex[functionOffset] = lsdaEntries.size();
403     if (cu->lsda != 0)
404       lsdaEntries.push_back(
405           {functionOffset, static_cast<uint32_t>(cu->lsda - in.header->addr)});
406   }
407 
408   // compute size of __TEXT,__unwind_info section
409   level2PagesOffset =
410       sizeof(unwind_info_section_header) +
411       commonEncodings.size() * sizeof(uint32_t) +
412       personalities.size() * sizeof(uint32_t) +
413       // The extra second-level-page entry is for the sentinel
414       (secondLevelPages.size() + 1) *
415           sizeof(unwind_info_section_header_index_entry) +
416       lsdaEntries.size() * sizeof(unwind_info_section_header_lsda_index_entry);
417   unwindInfoSize =
418       level2PagesOffset + secondLevelPages.size() * SECOND_LEVEL_PAGE_BYTES;
419 }
420 
421 // All inputs are relocated and output addresses are known, so write!
422 
423 template <class Ptr>
424 void UnwindInfoSectionImpl<Ptr>::writeTo(uint8_t *buf) const {
425   // section header
426   auto *uip = reinterpret_cast<unwind_info_section_header *>(buf);
427   uip->version = 1;
428   uip->commonEncodingsArraySectionOffset = sizeof(unwind_info_section_header);
429   uip->commonEncodingsArrayCount = commonEncodings.size();
430   uip->personalityArraySectionOffset =
431       uip->commonEncodingsArraySectionOffset +
432       (uip->commonEncodingsArrayCount * sizeof(uint32_t));
433   uip->personalityArrayCount = personalities.size();
434   uip->indexSectionOffset = uip->personalityArraySectionOffset +
435                             (uip->personalityArrayCount * sizeof(uint32_t));
436   uip->indexCount = secondLevelPages.size() + 1;
437 
438   // Common encodings
439   auto *i32p = reinterpret_cast<uint32_t *>(&uip[1]);
440   for (const auto &encoding : commonEncodings)
441     *i32p++ = encoding.first;
442 
443   // Personalities
444   for (const uint32_t &personality : personalities)
445     *i32p++ =
446         in.got->addr + (personality - 1) * target->wordSize - in.header->addr;
447 
448   // Level-1 index
449   uint32_t lsdaOffset =
450       uip->indexSectionOffset +
451       uip->indexCount * sizeof(unwind_info_section_header_index_entry);
452   uint64_t l2PagesOffset = level2PagesOffset;
453   auto *iep = reinterpret_cast<unwind_info_section_header_index_entry *>(i32p);
454   for (const SecondLevelPage &page : secondLevelPages) {
455     iep->functionOffset =
456         cuPtrVector[page.entryIndex]->functionAddress - in.header->addr;
457     iep->secondLevelPagesSectionOffset = l2PagesOffset;
458     iep->lsdaIndexArraySectionOffset =
459         lsdaOffset + functionToLsdaIndex.lookup(iep->functionOffset) *
460                          sizeof(unwind_info_section_header_lsda_index_entry);
461     iep++;
462     l2PagesOffset += SECOND_LEVEL_PAGE_BYTES;
463   }
464   // Level-1 sentinel
465   const CompactUnwindEntry<Ptr> &cuEnd = cuVector.back();
466   iep->functionOffset = cuEnd.functionAddress + cuEnd.functionLength;
467   iep->secondLevelPagesSectionOffset = 0;
468   iep->lsdaIndexArraySectionOffset =
469       lsdaOffset +
470       lsdaEntries.size() * sizeof(unwind_info_section_header_lsda_index_entry);
471   iep++;
472 
473   // LSDAs
474   size_t lsdaBytes =
475       lsdaEntries.size() * sizeof(unwind_info_section_header_lsda_index_entry);
476   if (lsdaBytes > 0)
477     memcpy(iep, lsdaEntries.data(), lsdaBytes);
478 
479   // Level-2 pages
480   auto *pp = reinterpret_cast<uint32_t *>(reinterpret_cast<uint8_t *>(iep) +
481                                           lsdaBytes);
482   for (const SecondLevelPage &page : secondLevelPages) {
483     if (page.kind == UNWIND_SECOND_LEVEL_COMPRESSED) {
484       uintptr_t functionAddressBase =
485           cuPtrVector[page.entryIndex]->functionAddress;
486       auto *p2p =
487           reinterpret_cast<unwind_info_compressed_second_level_page_header *>(
488               pp);
489       p2p->kind = page.kind;
490       p2p->entryPageOffset =
491           sizeof(unwind_info_compressed_second_level_page_header);
492       p2p->entryCount = page.entryCount;
493       p2p->encodingsPageOffset =
494           p2p->entryPageOffset + p2p->entryCount * sizeof(uint32_t);
495       p2p->encodingsCount = page.localEncodings.size();
496       auto *ep = reinterpret_cast<uint32_t *>(&p2p[1]);
497       for (size_t i = 0; i < page.entryCount; i++) {
498         const CompactUnwindEntry<Ptr> *cuep = cuPtrVector[page.entryIndex + i];
499         auto it = commonEncodingIndexes.find(cuep->encoding);
500         if (it == commonEncodingIndexes.end())
501           it = page.localEncodingIndexes.find(cuep->encoding);
502         *ep++ = (it->second << COMPRESSED_ENTRY_FUNC_OFFSET_BITS) |
503                 (cuep->functionAddress - functionAddressBase);
504       }
505       if (page.localEncodings.size() != 0)
506         memcpy(ep, page.localEncodings.data(),
507                page.localEncodings.size() * sizeof(uint32_t));
508     } else {
509       auto *p2p =
510           reinterpret_cast<unwind_info_regular_second_level_page_header *>(pp);
511       p2p->kind = page.kind;
512       p2p->entryPageOffset =
513           sizeof(unwind_info_regular_second_level_page_header);
514       p2p->entryCount = page.entryCount;
515       auto *ep = reinterpret_cast<uint32_t *>(&p2p[1]);
516       for (size_t i = 0; i < page.entryCount; i++) {
517         const CompactUnwindEntry<Ptr> *cuep = cuPtrVector[page.entryIndex + i];
518         *ep++ = cuep->functionAddress;
519         *ep++ = cuep->encoding;
520       }
521     }
522     pp += SECOND_LEVEL_PAGE_WORDS;
523   }
524 }
525 
526 UnwindInfoSection *macho::makeUnwindInfoSection() {
527   if (target->wordSize == 8)
528     return make<UnwindInfoSectionImpl<uint64_t>>();
529   else
530     return make<UnwindInfoSectionImpl<uint32_t>>();
531 }
532