[llvm] r293964 - llvm-readobj: fix next note entry calculation and print unknown note types
Konstantin Zhuravlyov via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 2 15:44:50 PST 2017
Author: kzhuravl
Date: Thu Feb 2 17:44:49 2017
New Revision: 293964
URL: http://llvm.org/viewvc/llvm-project?rev=293964&view=rev
Log:
llvm-readobj: fix next note entry calculation and print unknown note types
Differential Revision: https://reviews.llvm.org/D29131
Modified:
llvm/trunk/test/CodeGen/AMDGPU/runtime-metadata.ll
llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
Modified: llvm/trunk/test/CodeGen/AMDGPU/runtime-metadata.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/runtime-metadata.ll?rev=293964&r1=293963&r2=293964&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/runtime-metadata.ll (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/runtime-metadata.ll Thu Feb 2 17:44:49 2017
@@ -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 @@ define amdgpu_kernel void @test_pointee_
; 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}
Modified: llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/ELFDumper.cpp?rev=293964&r1=293963&r2=293964&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/ELFDumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/ELFDumper.cpp Thu Feb 2 17:44:49 2017
@@ -3416,10 +3416,12 @@ void GNUStyle<ELFT>::printNotes(const EL
if (Name == "GNU") {
OS << getGNUNoteTypeName(Type) << '\n';
printGNUNote<ELFT>(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);
}
};
More information about the llvm-commits
mailing list