[DWARFYAML][debug_gnu_*] 'Descriptor' field should be 1-byte. NFC.
authorXing GUO <higuoxing@gmail.com>
Thu, 25 Jun 2020 00:06:56 +0000 (08:06 +0800)
committerXing GUO <higuoxing@gmail.com>
Thu, 25 Jun 2020 00:21:13 +0000 (08:21 +0800)
The 'Descriptor' field of .debug_gnu_pubnames and .debug_gnu_pubtypes
section should be 1-byte rather than 4-byte. This patch helps resolve
this issue.

llvm/lib/ObjectYAML/DWARFEmitter.cpp

index f1b46d7..4f8fa73 100644 (file)
@@ -191,7 +191,7 @@ Error DWARFYAML::emitPubSection(raw_ostream &OS,
   for (auto Entry : Sect.Entries) {
     writeInteger((uint32_t)Entry.DieOffset, OS, IsLittleEndian);
     if (Sect.IsGNUStyle)
-      writeInteger((uint32_t)Entry.Descriptor, OS, IsLittleEndian);
+      writeInteger((uint8_t)Entry.Descriptor, OS, IsLittleEndian);
     OS.write(Entry.Name.data(), Entry.Name.size());
     OS.write('\0');
   }