summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-readobj/note-core.test
diff options
context:
space:
mode:
authorJordan Rupprecht <rupprecht@google.com>2019-08-05 15:43:20 +0000
committerJordan Rupprecht <rupprecht@google.com>2019-08-05 15:43:20 +0000
commitd884fbde2a829ef8c78d1a0b0f2478e7e672bc0a (patch)
treeecf08db1409b8bd8ea9bda3baf3a4e592025b2a0 /llvm/test/tools/llvm-readobj/note-core.test
parent8981dc30584310dd2e1ddf5861de2a392fc459dc (diff)
downloadbcm5719-llvm-d884fbde2a829ef8c78d1a0b0f2478e7e672bc0a.tar.gz
bcm5719-llvm-d884fbde2a829ef8c78d1a0b0f2478e7e672bc0a.zip
[llvm-readelf] Fix core note descriptions
Summary: Core files have different descriptions for note values. llvm-readelf currently prints the generic note type, which is wrong when using it to read a core file. To verify the constants/strings, see: Values: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=include/elf/common.h;h=75c4fb7e9d7c0f780d635ac305f579546b7b071b;hb=HEAD#l571 Strings: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=binutils/readelf.c;h=c31a5c1266b7bb62a485895b01b49e1f832ade35;hb=HEAD#l16881 Note: this does not handle printing the note data for NT_FILE, it just fixes the descriptions. Reviewers: MaskRay Reviewed By: MaskRay Subscribers: labath, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65608 llvm-svn: 367878
Diffstat (limited to 'llvm/test/tools/llvm-readobj/note-core.test')
-rw-r--r--llvm/test/tools/llvm-readobj/note-core.test28
1 files changed, 28 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-readobj/note-core.test b/llvm/test/tools/llvm-readobj/note-core.test
new file mode 100644
index 00000000000..dd513c74504
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/note-core.test
@@ -0,0 +1,28 @@
+## Test that note values are interpreted correctly for core files.
+
+# RUN: yaml2obj %s > %t.o
+# RUN: llvm-readelf --notes %t.o 2>&1 | FileCheck %s
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_CORE
+ Machine: EM_X86_64
+Sections:
+ - Name: .note.foo
+ Type: SHT_NOTE
+ # Note: format is 0500000000000000<NT_FOO value>434F524500000000 repeated
+ Content: 050000000000000001000000434F524500000000050000000000000002000000434F524500000000050000000000000003000000434F524500000000050000000000000004000000434F524500000000050000000000000006000000434F524500000000
+ProgramHeaders:
+ - Type: PT_NOTE
+ Sections:
+ - Section: .note.foo
+
+# CHECK: Displaying notes found
+# CHECK-NEXT: Owner Data size Description
+# CHECK-NEXT: CORE 0x00000000 NT_PRSTATUS (prstatus structure)
+# CHECK-NEXT: CORE 0x00000000 NT_FPREGSET (floating point registers)
+# CHECK-NEXT: CORE 0x00000000 NT_PRPSINFO (prpsinfo structure)
+# CHECK-NEXT: CORE 0x00000000 NT_TASKSTRUCT (task structure)
+# CHECK-NEXT: CORE 0x00000000 NT_AUXV (auxiliary vector)
OpenPOWER on IntegriCloud