Index: llvm/trunk/tools/llvm-readobj/ELFDumper.cpp =================================================================== --- llvm/trunk/tools/llvm-readobj/ELFDumper.cpp +++ llvm/trunk/tools/llvm-readobj/ELFDumper.cpp @@ -3370,7 +3370,8 @@ template static void printGNUNote(raw_ostream &OS, uint32_t NoteType, - ArrayRef::Elf_Word> Words) { + ArrayRef::Elf_Word> Words, + size_t Size) { switch (NoteType) { default: return; @@ -3393,16 +3394,14 @@ } case ELF::NT_GNU_BUILD_ID: { OS << " Build ID: "; - ArrayRef ID(reinterpret_cast(Words.data()), - Words.size() * 4); + ArrayRef ID(reinterpret_cast(Words.data()), Size); for (const auto &B : ID) OS << format_hex_no_prefix(B, 2); break; } case ELF::NT_GNU_GOLD_VERSION: OS << " Version: " - << StringRef(reinterpret_cast(Words.data()), - Words.size() * 4); + << StringRef(reinterpret_cast(Words.data()), Size); break; } @@ -3446,7 +3445,7 @@ if (Name == "GNU") { OS << getGNUNoteTypeName(Type) << '\n'; - printGNUNote(OS, Type, Descriptor); + printGNUNote(OS, Type, Descriptor, DescriptorSize); } else if (Name == "FreeBSD") { OS << getFreeBSDNoteTypeName(Type) << '\n'; } else {