Index: llvm/trunk/test/CodeGen/AMDGPU/runtime-metadata.ll =================================================================== --- llvm/trunk/test/CodeGen/AMDGPU/runtime-metadata.ll +++ llvm/trunk/test/CodeGen/AMDGPU/runtime-metadata.ll @@ -1,4 +1,4 @@ -; RUN: llc -mtriple=amdgcn--amdhsa -filetype=obj -o - < %s | llvm-readobj -amdgpu-runtime-metadata | FileCheck %s +; RUN: llc -mtriple=amdgcn--amdhsa -filetype=obj -o - < %s | llvm-readobj -amdgpu-runtime-metadata -elf-output-style=GNU -notes | FileCheck %s --check-prefix=NOTES ; RUN: llc -mtriple=amdgcn--amdhsa -filetype=obj -amdgpu-dump-rtmd -amdgpu-check-rtmd-parser %s -o - 2>&1 | FileCheck --check-prefix=CHECK --check-prefix=PARSER %s %struct.A = type { i8, float } @@ -341,6 +341,12 @@ ; PARSER: AMDGPU runtime metadata parser test passes. +; NOTES: Displaying notes found at file offset 0x{{[0-9]+}} +; NOTES-NEXT: Owner Data size Description +; NOTES-NEXT: AMD 0x00000008 Unknown note type: (0x00000001) +; NOTES-NEXT: AMD 0x0000001b Unknown note type: (0x00000003) +; NOTES-NEXT: AMD 0x00005196 Unknown note type: (0x00000008) + !llvm.printf.fmts = !{!100, !101} !1 = !{i32 0} Index: llvm/trunk/tools/llvm-readobj/ELFDumper.cpp =================================================================== --- llvm/trunk/tools/llvm-readobj/ELFDumper.cpp +++ llvm/trunk/tools/llvm-readobj/ELFDumper.cpp @@ -3416,10 +3416,12 @@ if (Name == "GNU") { OS << getGNUNoteTypeName(Type) << '\n'; printGNUNote(OS, Type, Descriptor); + } else { + OS << "Unknown note type: (" << format_hex(Type, 10) << ')'; } OS << '\n'; - P = P + 3 * sizeof(Elf_Word) * alignTo<4>(NameSize) + + P = P + 3 * sizeof(Elf_Word) + alignTo<4>(NameSize) + alignTo<4>(DescriptorSize); } };