1 //===--- ARMAttributeParser.cpp - ARM Attribute Information Printer -------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "ARMAttributeParser.h"
11 #include "StreamWriter.h"
12 #include "llvm/ADT/STLExtras.h"
13 #include "llvm/ADT/StringExtras.h"
14 #include "llvm/Support/LEB128.h"
17 using namespace llvm::ARMBuildAttrs;
20 static const EnumEntry<unsigned> TagNames[] = {
21 { "Tag_File", ARMBuildAttrs::File },
22 { "Tag_Section", ARMBuildAttrs::Section },
23 { "Tag_Symbol", ARMBuildAttrs::Symbol },
27 #define ATTRIBUTE_HANDLER(Attr_) \
28 { ARMBuildAttrs::Attr_, &ARMAttributeParser::Attr_ }
30 const ARMAttributeParser::DisplayHandler
31 ARMAttributeParser::DisplayRoutines[] = {
32 { ARMBuildAttrs::CPU_raw_name, &ARMAttributeParser::StringAttribute, },
33 { ARMBuildAttrs::CPU_name, &ARMAttributeParser::StringAttribute },
34 ATTRIBUTE_HANDLER(CPU_arch),
35 ATTRIBUTE_HANDLER(CPU_arch_profile),
36 ATTRIBUTE_HANDLER(ARM_ISA_use),
37 ATTRIBUTE_HANDLER(THUMB_ISA_use),
38 ATTRIBUTE_HANDLER(FP_arch),
39 ATTRIBUTE_HANDLER(WMMX_arch),
40 ATTRIBUTE_HANDLER(Advanced_SIMD_arch),
41 ATTRIBUTE_HANDLER(PCS_config),
42 ATTRIBUTE_HANDLER(ABI_PCS_R9_use),
43 ATTRIBUTE_HANDLER(ABI_PCS_RW_data),
44 ATTRIBUTE_HANDLER(ABI_PCS_RO_data),
45 ATTRIBUTE_HANDLER(ABI_PCS_GOT_use),
46 ATTRIBUTE_HANDLER(ABI_PCS_wchar_t),
47 ATTRIBUTE_HANDLER(ABI_FP_rounding),
48 ATTRIBUTE_HANDLER(ABI_FP_denormal),
49 ATTRIBUTE_HANDLER(ABI_FP_exceptions),
50 ATTRIBUTE_HANDLER(ABI_FP_user_exceptions),
51 ATTRIBUTE_HANDLER(ABI_FP_number_model),
52 ATTRIBUTE_HANDLER(ABI_align_needed),
53 ATTRIBUTE_HANDLER(ABI_align_preserved),
54 ATTRIBUTE_HANDLER(ABI_enum_size),
55 ATTRIBUTE_HANDLER(ABI_HardFP_use),
56 ATTRIBUTE_HANDLER(ABI_VFP_args),
57 ATTRIBUTE_HANDLER(ABI_WMMX_args),
58 ATTRIBUTE_HANDLER(ABI_optimization_goals),
59 ATTRIBUTE_HANDLER(ABI_FP_optimization_goals),
60 ATTRIBUTE_HANDLER(compatibility),
61 ATTRIBUTE_HANDLER(CPU_unaligned_access),
62 ATTRIBUTE_HANDLER(FP_HP_extension),
63 ATTRIBUTE_HANDLER(ABI_FP_16bit_format),
64 ATTRIBUTE_HANDLER(MPextension_use),
65 ATTRIBUTE_HANDLER(DIV_use),
66 ATTRIBUTE_HANDLER(T2EE_use),
67 ATTRIBUTE_HANDLER(Virtualization_use),
68 ATTRIBUTE_HANDLER(nodefaults)
71 #undef ATTRIBUTE_HANDLER
73 uint64_t ARMAttributeParser::ParseInteger(const uint8_t *Data,
76 uint64_t Value = decodeULEB128(Data + Offset, &Length);
77 Offset = Offset + Length;
81 StringRef ARMAttributeParser::ParseString(const uint8_t *Data,
83 const char *String = reinterpret_cast<const char*>(Data + Offset);
84 size_t Length = std::strlen(String);
85 Offset = Offset + Length + 1;
86 return StringRef(String, Length);
89 void ARMAttributeParser::IntegerAttribute(AttrType Tag, const uint8_t *Data,
91 SW.printNumber(ARMBuildAttrs::AttrTypeAsString(Tag),
92 ParseInteger(Data, Offset));
95 void ARMAttributeParser::StringAttribute(AttrType Tag, const uint8_t *Data,
97 StringRef TagName = ARMBuildAttrs::AttrTypeAsString(Tag, /*TagPrefix*/false);
99 DictScope AS(SW, "Attribute");
100 SW.printNumber("Tag", Tag);
101 if (!TagName.empty())
102 SW.printString("TagName", TagName);
103 SW.printString("Value", ParseString(Data, Offset));
106 void ARMAttributeParser::PrintAttribute(unsigned Tag, unsigned Value,
107 StringRef ValueDesc) {
108 StringRef TagName = ARMBuildAttrs::AttrTypeAsString(Tag, /*TagPrefix*/false);
110 DictScope AS(SW, "Attribute");
111 SW.printNumber("Tag", Tag);
112 SW.printNumber("Value", Value);
113 if (!TagName.empty())
114 SW.printString("TagName", TagName);
115 if (!ValueDesc.empty())
116 SW.printString("Description", ValueDesc);
119 void ARMAttributeParser::CPU_arch(AttrType Tag, const uint8_t *Data,
121 static const char *Strings[] = {
122 "Pre-v4", "ARM v4", "ARM v4T", "ARM v5T", "ARM v5TE", "ARM v5TEJ", "ARM v6",
123 "ARM v6KZ", "ARM v6T2", "ARM v6K", "ARM v7", "ARM v6-M", "ARM v6S-M",
124 "ARM v7E-M", "ARM v8"
127 uint64_t Value = ParseInteger(Data, Offset);
128 StringRef ValueDesc =
129 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
130 PrintAttribute(Tag, Value, ValueDesc);
133 void ARMAttributeParser::CPU_arch_profile(AttrType Tag, const uint8_t *Data,
135 uint64_t Encoded = ParseInteger(Data, Offset);
139 default: Profile = "Unknown"; break;
140 case 'A': Profile = "Application"; break;
141 case 'R': Profile = "Real-time"; break;
142 case 'M': Profile = "Microcontroller"; break;
143 case 'S': Profile = "Classic"; break;
144 case '0': Profile = "None"; break;
147 PrintAttribute(Tag, Encoded, Profile);
150 void ARMAttributeParser::ARM_ISA_use(AttrType Tag, const uint8_t *Data,
152 static const char *Strings[] = { "Not Permitted", "Permitted" };
154 uint64_t Value = ParseInteger(Data, Offset);
155 StringRef ValueDesc =
156 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
157 PrintAttribute(Tag, Value, ValueDesc);
160 void ARMAttributeParser::THUMB_ISA_use(AttrType Tag, const uint8_t *Data,
162 static const char *Strings[] = { "Not Permitted", "Thumb-1", "Thumb-2" };
164 uint64_t Value = ParseInteger(Data, Offset);
165 StringRef ValueDesc =
166 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
167 PrintAttribute(Tag, Value, ValueDesc);
170 void ARMAttributeParser::FP_arch(AttrType Tag, const uint8_t *Data,
172 static const char *Strings[] = {
173 "Not Permitted", "VFPv1", "VFPv2", "VFPv3", "VFPv3-D16", "VFPv4",
174 "VFPv4-D16", "ARMv8-a FP", "ARMv8-a FP-D16"
177 uint64_t Value = ParseInteger(Data, Offset);
178 StringRef ValueDesc =
179 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
180 PrintAttribute(Tag, Value, ValueDesc);
183 void ARMAttributeParser::WMMX_arch(AttrType Tag, const uint8_t *Data,
185 static const char *Strings[] = { "Not Permitted", "WMMXv1", "WMMXv2" };
187 uint64_t Value = ParseInteger(Data, Offset);
188 StringRef ValueDesc =
189 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
190 PrintAttribute(Tag, Value, ValueDesc);
193 void ARMAttributeParser::Advanced_SIMD_arch(AttrType Tag, const uint8_t *Data,
195 static const char *Strings[] = {
196 "Not Permitted", "NEONv1", "NEONv2+FMA", "ARMv8-a NEON"
199 uint64_t Value = ParseInteger(Data, Offset);
200 StringRef ValueDesc =
201 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
202 PrintAttribute(Tag, Value, ValueDesc);
205 void ARMAttributeParser::PCS_config(AttrType Tag, const uint8_t *Data,
207 static const char *Strings[] = {
208 "None", "Bare Platform", "Linux Application", "Linux DSO", "Palm OS 2004",
209 "Reserved (Palm OS)", "Symbian OS 2004", "Reserved (Symbian OS)"
212 uint64_t Value = ParseInteger(Data, Offset);
213 StringRef ValueDesc =
214 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
215 PrintAttribute(Tag, Value, ValueDesc);
218 void ARMAttributeParser::ABI_PCS_R9_use(AttrType Tag, const uint8_t *Data,
220 static const char *Strings[] = { "v6", "Static Base", "TLS", "Unused" };
222 uint64_t Value = ParseInteger(Data, Offset);
223 StringRef ValueDesc =
224 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
225 PrintAttribute(Tag, Value, ValueDesc);
228 void ARMAttributeParser::ABI_PCS_RW_data(AttrType Tag, const uint8_t *Data,
230 static const char *Strings[] = {
231 "Absolute", "PC-relative", "SB-relative", "Not Permitted"
234 uint64_t Value = ParseInteger(Data, Offset);
235 StringRef ValueDesc =
236 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
237 PrintAttribute(Tag, Value, ValueDesc);
240 void ARMAttributeParser::ABI_PCS_RO_data(AttrType Tag, const uint8_t *Data,
242 static const char *Strings[] = { "Absolute", "PC-relative", "Not Permitted" };
244 uint64_t Value = ParseInteger(Data, Offset);
245 StringRef ValueDesc =
246 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
247 PrintAttribute(Tag, Value, ValueDesc);
250 void ARMAttributeParser::ABI_PCS_GOT_use(AttrType Tag, const uint8_t *Data,
252 static const char *Strings[] = { "Not Permitted", "Direct", "GOT-Indirect" };
254 uint64_t Value = ParseInteger(Data, Offset);
255 StringRef ValueDesc =
256 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
257 PrintAttribute(Tag, Value, ValueDesc);
260 void ARMAttributeParser::ABI_PCS_wchar_t(AttrType Tag, const uint8_t *Data,
262 static const char *Strings[] = {
263 "Not Permitted", "Unknown", "2-byte", "Unknown", "4-byte"
266 uint64_t Value = ParseInteger(Data, Offset);
267 StringRef ValueDesc =
268 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
269 PrintAttribute(Tag, Value, ValueDesc);
272 void ARMAttributeParser::ABI_FP_rounding(AttrType Tag, const uint8_t *Data,
274 static const char *Strings[] = { "IEEE-754", "Runtime" };
276 uint64_t Value = ParseInteger(Data, Offset);
277 StringRef ValueDesc =
278 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
279 PrintAttribute(Tag, Value, ValueDesc);
282 void ARMAttributeParser::ABI_FP_denormal(AttrType Tag, const uint8_t *Data,
284 static const char *Strings[] = { "Unsupported", "IEEE-754", "Sign Only" };
286 uint64_t Value = ParseInteger(Data, Offset);
287 StringRef ValueDesc =
288 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
289 PrintAttribute(Tag, Value, ValueDesc);
292 void ARMAttributeParser::ABI_FP_exceptions(AttrType Tag, const uint8_t *Data,
294 static const char *Strings[] = { "Not Permitted", "IEEE-754" };
296 uint64_t Value = ParseInteger(Data, Offset);
297 StringRef ValueDesc =
298 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
299 PrintAttribute(Tag, Value, ValueDesc);
302 void ARMAttributeParser::ABI_FP_user_exceptions(AttrType Tag,
305 static const char *Strings[] = { "Not Permitted", "IEEE-754" };
307 uint64_t Value = ParseInteger(Data, Offset);
308 StringRef ValueDesc =
309 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
310 PrintAttribute(Tag, Value, ValueDesc);
313 void ARMAttributeParser::ABI_FP_number_model(AttrType Tag, const uint8_t *Data,
315 static const char *Strings[] = {
316 "Not Permitted", "Finite Only", "RTABI", "IEEE-754"
319 uint64_t Value = ParseInteger(Data, Offset);
320 StringRef ValueDesc =
321 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
322 PrintAttribute(Tag, Value, ValueDesc);
325 void ARMAttributeParser::ABI_align_needed(AttrType Tag, const uint8_t *Data,
327 static const char *Strings[] = {
328 "Not Permitted", "8-byte alignment", "4-byte alignment", "Reserved"
331 uint64_t Value = ParseInteger(Data, Offset);
333 std::string Description;
334 if (Value < array_lengthof(Strings))
335 Description = std::string(Strings[Value]);
336 else if (Value <= 12)
337 Description = std::string("8-byte alignment, ") + utostr(1 << Value)
338 + std::string("-byte extended alignment");
340 Description = "Invalid";
342 PrintAttribute(Tag, Value, Description);
345 void ARMAttributeParser::ABI_align_preserved(AttrType Tag, const uint8_t *Data,
347 static const char *Strings[] = {
348 "Not Required", "8-byte data alignment", "8-byte data and code alignment",
352 uint64_t Value = ParseInteger(Data, Offset);
354 std::string Description;
355 if (Value < array_lengthof(Strings))
356 Description = std::string(Strings[Value]);
357 else if (Value <= 12)
358 Description = std::string("8-byte stack alignment, ") + utostr(1 << Value)
359 + std::string("-byte data alignment");
361 Description = "Invalid";
363 PrintAttribute(Tag, Value, Description);
366 void ARMAttributeParser::ABI_enum_size(AttrType Tag, const uint8_t *Data,
368 static const char *Strings[] = {
369 "Not Permitted", "Packed", "Int32", "External Int32"
372 uint64_t Value = ParseInteger(Data, Offset);
373 StringRef ValueDesc =
374 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
375 PrintAttribute(Tag, Value, ValueDesc);
378 void ARMAttributeParser::ABI_HardFP_use(AttrType Tag, const uint8_t *Data,
380 static const char *Strings[] = {
381 "Tag_FP_arch", "Single-Precision", "Reserved", "Tag_FP_arch (deprecated)"
384 uint64_t Value = ParseInteger(Data, Offset);
385 StringRef ValueDesc =
386 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
387 PrintAttribute(Tag, Value, ValueDesc);
390 void ARMAttributeParser::ABI_VFP_args(AttrType Tag, const uint8_t *Data,
392 static const char *Strings[] = {
393 "AAPCS", "AAPCS VFP", "Custom", "Not Permitted"
396 uint64_t Value = ParseInteger(Data, Offset);
397 StringRef ValueDesc =
398 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
399 PrintAttribute(Tag, Value, ValueDesc);
402 void ARMAttributeParser::ABI_WMMX_args(AttrType Tag, const uint8_t *Data,
404 static const char *Strings[] = { "AAPCS", "iWMMX", "Custom" };
406 uint64_t Value = ParseInteger(Data, Offset);
407 StringRef ValueDesc =
408 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
409 PrintAttribute(Tag, Value, ValueDesc);
412 void ARMAttributeParser::ABI_optimization_goals(AttrType Tag,
415 static const char *Strings[] = {
416 "None", "Speed", "Aggressive Speed", "Size", "Aggressive Size", "Debugging",
420 uint64_t Value = ParseInteger(Data, Offset);
421 StringRef ValueDesc =
422 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
423 PrintAttribute(Tag, Value, ValueDesc);
426 void ARMAttributeParser::ABI_FP_optimization_goals(AttrType Tag,
429 static const char *Strings[] = {
430 "None", "Speed", "Aggressive Speed", "Size", "Aggressive Size", "Accuracy",
434 uint64_t Value = ParseInteger(Data, Offset);
435 StringRef ValueDesc =
436 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
437 PrintAttribute(Tag, Value, ValueDesc);
440 void ARMAttributeParser::compatibility(AttrType Tag, const uint8_t *Data,
442 uint64_t Integer = ParseInteger(Data, Offset);
443 StringRef String = ParseString(Data, Offset);
445 DictScope AS(SW, "Attribute");
446 SW.printNumber("Tag", Tag);
447 SW.startLine() << "Value: " << Integer << ", " << String << '\n';
448 SW.printString("TagName", AttrTypeAsString(Tag, /*TagPrefix*/false));
451 SW.printString("Description", StringRef("No Specific Requirements"));
454 SW.printString("Description", StringRef("AEABI Conformant"));
457 SW.printString("Description", StringRef("AEABI Non-Conformant"));
462 void ARMAttributeParser::CPU_unaligned_access(AttrType Tag, const uint8_t *Data,
464 static const char *Strings[] = { "Not Permitted", "v6-style" };
466 uint64_t Value = ParseInteger(Data, Offset);
467 StringRef ValueDesc =
468 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
469 PrintAttribute(Tag, Value, ValueDesc);
472 void ARMAttributeParser::FP_HP_extension(AttrType Tag, const uint8_t *Data,
474 static const char *Strings[] = { "If Available", "Permitted" };
476 uint64_t Value = ParseInteger(Data, Offset);
477 StringRef ValueDesc =
478 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
479 PrintAttribute(Tag, Value, ValueDesc);
482 void ARMAttributeParser::ABI_FP_16bit_format(AttrType Tag, const uint8_t *Data,
484 static const char *Strings[] = { "Not Permitted", "IEEE-754", "VFPv3" };
486 uint64_t Value = ParseInteger(Data, Offset);
487 StringRef ValueDesc =
488 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
489 PrintAttribute(Tag, Value, ValueDesc);
492 void ARMAttributeParser::MPextension_use(AttrType Tag, const uint8_t *Data,
494 static const char *Strings[] = { "Not Permitted", "Permitted" };
496 uint64_t Value = ParseInteger(Data, Offset);
497 StringRef ValueDesc =
498 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
499 PrintAttribute(Tag, Value, ValueDesc);
502 void ARMAttributeParser::DIV_use(AttrType Tag, const uint8_t *Data,
504 static const char *Strings[] = {
505 "If Available", "Not Permitted", "Permitted"
508 uint64_t Value = ParseInteger(Data, Offset);
509 StringRef ValueDesc =
510 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
511 PrintAttribute(Tag, Value, ValueDesc);
514 void ARMAttributeParser::T2EE_use(AttrType Tag, const uint8_t *Data,
516 static const char *Strings[] = { "Not Permitted", "Permitted" };
518 uint64_t Value = ParseInteger(Data, Offset);
519 StringRef ValueDesc =
520 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
521 PrintAttribute(Tag, Value, ValueDesc);
524 void ARMAttributeParser::Virtualization_use(AttrType Tag, const uint8_t *Data,
526 static const char *Strings[] = {
527 "Not Permitted", "TrustZone", "Virtualization Extensions",
528 "TrustZone + Virtualization Extensions"
531 uint64_t Value = ParseInteger(Data, Offset);
532 StringRef ValueDesc =
533 (Value < array_lengthof(Strings)) ? Strings[Value] : NULL;
534 PrintAttribute(Tag, Value, ValueDesc);
537 void ARMAttributeParser::nodefaults(AttrType Tag, const uint8_t *Data,
539 uint64_t Value = ParseInteger(Data, Offset);
540 PrintAttribute(Tag, Value, "Unspecified Tags UNDEFINED");
543 void ARMAttributeParser::ParseIndexList(const uint8_t *Data, uint32_t &Offset,
544 SmallVectorImpl<uint8_t> &IndexList) {
547 uint64_t Value = decodeULEB128(Data + Offset, &Length);
548 Offset = Offset + Length;
551 IndexList.push_back(Value);
555 void ARMAttributeParser::ParseAttributeList(const uint8_t *Data,
556 uint32_t &Offset, uint32_t Length) {
557 while (Offset < Length) {
559 uint64_t Tag = decodeULEB128(Data + Offset, &Length);
562 bool Handled = false;
563 for (unsigned AHI = 0, AHE = array_lengthof(DisplayRoutines);
564 AHI != AHE && !Handled; ++AHI) {
565 if (DisplayRoutines[AHI].Attribute == Tag) {
566 (this->*DisplayRoutines[AHI].Routine)(ARMBuildAttrs::AttrType(Tag),
574 errs() << "unhandled AEABI Tag " << Tag
575 << " (" << ARMBuildAttrs::AttrTypeAsString(Tag) << ")\n";
580 IntegerAttribute(ARMBuildAttrs::AttrType(Tag), Data, Offset);
582 StringAttribute(ARMBuildAttrs::AttrType(Tag), Data, Offset);
587 void ARMAttributeParser::ParseSubsection(const uint8_t *Data, uint32_t Length) {
588 uint32_t Offset = sizeof(uint32_t); /* SectionLength */
590 SW.printNumber("SectionLength", Length);
592 const char *VendorName = reinterpret_cast<const char*>(Data + Offset);
593 size_t VendorNameLength = std::strlen(VendorName);
594 SW.printString("Vendor", StringRef(VendorName, VendorNameLength));
595 Offset = Offset + VendorNameLength + 1;
597 if (StringRef(VendorName, VendorNameLength).lower() != "aeabi")
600 while (Offset < Length) {
601 /// Tag_File | Tag_Section | Tag_Symbol uleb128:byte-size
602 uint8_t Tag = Data[Offset];
603 SW.printEnum("Tag", Tag, makeArrayRef(TagNames));
604 Offset = Offset + sizeof(Tag);
607 *reinterpret_cast<const support::ulittle32_t*>(Data + Offset);
608 SW.printNumber("Size", Size);
609 Offset = Offset + sizeof(Size);
612 errs() << "subsection length greater than section length\n";
616 StringRef ScopeName, IndexName;
617 SmallVector<uint8_t, 8> Indicies;
619 case ARMBuildAttrs::File:
620 ScopeName = "FileAttributes";
622 case ARMBuildAttrs::Section:
623 ScopeName = "SectionAttributes";
624 IndexName = "Sections";
625 ParseIndexList(Data, Offset, Indicies);
627 case ARMBuildAttrs::Symbol:
628 ScopeName = "SymbolAttributes";
629 IndexName = "Symbols";
630 ParseIndexList(Data, Offset, Indicies);
633 errs() << "unrecognised tag: 0x" << utohexstr(Tag) << '\n';
637 DictScope ASS(SW, ScopeName);
639 if (!Indicies.empty())
640 SW.printList(IndexName, Indicies);
642 ParseAttributeList(Data, Offset, Length);
646 void ARMAttributeParser::Parse(ArrayRef<uint8_t> Section) {
648 unsigned SectionNumber = 0;
650 while (Offset < Section.size()) {
651 uint32_t SectionLength =
652 *reinterpret_cast<const support::ulittle32_t*>(Section.data() + Offset);
654 SW.startLine() << "Section " << ++SectionNumber << " {\n";
657 ParseSubsection(Section.data() + Offset, SectionLength);
658 Offset = Offset + SectionLength;
661 SW.startLine() << "}\n";