xref: /llvm-project/llvm/test/tools/llvm-readobj/ELF/note-multiple-sections.test (revision ab930ee7cad8b8bf7968bb8d0c0d72524e2313c4)
1## Test that note values are interpreted correctly for files with multiple sections.
2
3## Check NT_PRSTATUS + NT_PRPSINFO.
4# RUN: yaml2obj %s -DTYPE1=0x1 -DTYPE2=0x3 -o %t1.o
5# RUN: llvm-readelf --elf-output-style=JSON --pretty-print --notes %t1.o | FileCheck %s --check-prefix=CHECK-JSON  -DDESC1="NT_PRSTATUS (prstatus structure)" -DDESC2="NT_PRPSINFO (prpsinfo structure)"
6# CHECK-JSON:       "Size": 40,
7# CHECK-JSON-NEXT:  "Notes": [
8# CHECK-JSON-NEXT:  {
9# CHECK-JSON-NEXT:   "Owner": "CORE",
10# CHECK-JSON-NEXT:   "Data size": 0,
11# CHECK-JSON-NEXT:   "Type": "[[DESC1]]"
12# CHECK-JSON-NEXT:  },
13# CHECK-JSON-NEXT:  {
14# CHECK-JSON-NEXT:   "Owner": "CORE",
15# CHECK-JSON-NEXT:   "Data size": 0,
16# CHECK-JSON-NEXT:   "Type": "[[DESC2]]"
17# CHECK-JSON-NEXT:  }
18# CHECK-JSON-NEXT:  ]
19
20--- !ELF
21FileHeader:
22  Class: ELFCLASS64
23  Data:  ELFDATA2LSB
24  Type:  ET_CORE
25Sections:
26  - Name: .note.first
27    Type: SHT_NOTE
28    Notes:
29      - Name: CORE
30        Type: [[TYPE1]]
31  - Name: .note.second
32    Type: SHT_NOTE
33    Notes:
34      - Name: CORE
35        Type: [[TYPE2]]
36ProgramHeaders:
37  - Type:     PT_NOTE
38    FirstSec: .note.first
39    LastSec:  .note.second
40