[clang] Propagate -ftime-report to offload lto (#122143)
[llvm-project.git] / llvm / test / tools / llvm-readobj / ELF / note-core-ntfile.test
blobc318234c357c65cd98687273d35550937a8a7c8f
1 ## Test that NT_FILE sections in core files are interpreted correctly.
3 # RUN: yaml2obj %s -o %t.o
4 # RUN: llvm-readelf --notes %t.o | FileCheck %s --check-prefix=GNU
5 # RUN: llvm-readobj --notes %t.o | FileCheck %s --check-prefix=LLVM
6 # RUN: llvm-readobj --elf-output-style=JSON --pretty-print --notes %t.o | FileCheck %s --check-prefix=JSON
8 ## llvm-mc doesn't support generating ET_CORE files; the 'Content' field was
9 ## generated with the following steps:
10 # $ llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu tmp.s -o tmp.o
11 # $ bin/llvm-objcopy --dump-section=.note.foo=tmp.txt tmp.o /dev/null
12 # $ xxd -p tmp.txt | tr -d '\n'; echo
13 ## Using the following input:
14 # .section ".note.foo", "a"
15 #       .align 4
16 #       .long 5 /* namesz */
17 #       .long end - begin /* descsz */
18 #       .long 0x46494c45 /* type = NT_FILE */
19 #       .asciz "CORE"
20 #       .align 4
21 # begin:
22 #       .quad 3 /* 3 file mappings */
23 #       .quad 4096 /* page size */
24 #       .quad 0x1000 /* start #1 */
25 #       .quad 0x2000 /* end #1 */
26 #       .quad 0x3000 /* offset #1 */
27 #       .quad 0x4000 /* start #2 */
28 #       .quad 0x5000 /* end #2 */
29 #       .quad 0x6000 /* offset #2 */
30 #       .quad 0x7000 /* start #3 */
31 #       .quad 0x8000 /* end #3 */
32 #       .quad 0x9000 /* offset #3 */
33 #       .asciz "/path/to/a.out"
34 #       .asciz "/path/to/libc.so"
35 #       .asciz "[stack]"
36 #       .align 4
37 # end:
39 --- !ELF
40 FileHeader:
41   Class: ELFCLASS64
42   Data:  ELFDATA2LSB
43   Type:  ET_CORE
44 Sections:
45   - Name:        .note.foo
46     Type:        SHT_NOTE
47     Content:     0500000080000000454C4946434F524500000000030000000000000000100000000000000010000000000000002000000000000000300000000000000040000000000000005000000000000000600000000000000070000000000000008000000000000000900000000000002F706174682F746F2F612E6F7574002F706174682F746F2F6C6962632E736F005B737461636B5D00
48 ProgramHeaders:
49   - Type:     PT_NOTE
50     FirstSec: .note.foo
51     LastSec:  .note.foo
53 # GNU:      Displaying notes found
54 # GNU-NEXT:   Owner                 Data size       Description
55 # GNU-NEXT:   CORE                  0x00000080      NT_FILE (mapped files)
56 # GNU-NEXT:     Page size: 4096
57 # GNU-NEXT:                  Start                 End         Page Offset
58 # GNU-NEXT:     0x0000000000001000  0x0000000000002000  0x0000000000003000
59 # GNU-NEXT:         /path/to/a.out
60 # GNU-NEXT:     0x0000000000004000  0x0000000000005000  0x0000000000006000
61 # GNU-NEXT:         /path/to/libc.so
62 # GNU-NEXT:     0x0000000000007000  0x0000000000008000  0x0000000000009000
63 # GNU-NEXT:         [stack]
64 # GNU-EMPTY:
66 # LLVM:      NoteSections [
67 # LLVM-NEXT:   NoteSection {
68 # LLVM-NEXT:     Name: <?>
69 # LLVM-NEXT:     Offset:
70 # LLVM-NEXT:     Size:
71 # LLVM-NEXT:     Notes [
72 # LLVM-NEXT:        {
73 # LLVM-NEXT:            Owner: CORE
74 # LLVM-NEXT:            Data size: 0x80
75 # LLVM-NEXT:            Type: NT_FILE (mapped files)
76 # LLVM-NEXT:            Page Size: 4096
77 # LLVM-NEXT:            Mappings [
78 # LLVM-NEXT:                {
79 # LLVM-NEXT:                    Start: 0x1000
80 # LLVM-NEXT:                    End: 0x2000
81 # LLVM-NEXT:                    Offset: 0x3000
82 # LLVM-NEXT:                    Filename: /path/to/a.out
83 # LLVM-NEXT:                }
84 # LLVM-NEXT:                {
85 # LLVM-NEXT:                    Start: 0x4000
86 # LLVM-NEXT:                    End: 0x5000
87 # LLVM-NEXT:                    Offset: 0x6000
88 # LLVM-NEXT:                    Filename: /path/to/libc.so
89 # LLVM-NEXT:                }
90 # LLVM-NEXT:                {
91 # LLVM-NEXT:                    Start: 0x7000
92 # LLVM-NEXT:                    End: 0x8000
93 # LLVM-NEXT:                    Offset: 0x9000
94 # LLVM-NEXT:                    Filename: [stack]
95 # LLVM-NEXT:                }
96 # LLVM-NEXT:            ]
97 # LLVM-NEXT:        }
98 # LLVM-NEXT:    ]
99 # LLVM-NEXT: }
100 # LLVM-NEXT: ]
102 # JSON:      "NoteSections": [
103 # JSON-NEXT:  {
104 # JSON-NEXT:      "NoteSection": {
105 # JSON-NEXT:          "Name": "<?>",
106 # JSON-NEXT:          "Offset": 120,
107 # JSON-NEXT:          "Size": 148,
108 # JSON-NEXT:          "Notes": [
109 # JSON-NEXT:            {
110 # JSON-NEXT:                "Owner": "CORE",
111 # JSON-NEXT:                "Data size": 128,
112 # JSON-NEXT:                "Type": "NT_FILE (mapped files)",
113 # JSON-NEXT:                "Page Size": 4096,
114 # JSON-NEXT:                "Mappings": [
115 # JSON-NEXT:                    {
116 # JSON-NEXT:                        "Start": 4096,
117 # JSON-NEXT:                        "End": 8192,
118 # JSON-NEXT:                        "Offset": 12288,
119 # JSON-NEXT:                        "Filename": "/path/to/a.out"
120 # JSON-NEXT:                    },
121 # JSON-NEXT:                    {
122 # JSON-NEXT:                        "Start": 16384,
123 # JSON-NEXT:                        "End": 20480,
124 # JSON-NEXT:                        "Offset": 24576,
125 # JSON-NEXT:                        "Filename": "/path/to/libc.so"
126 # JSON-NEXT:                    },
127 # JSON-NEXT:                    {
128 # JSON-NEXT:                        "Start": 28672,
129 # JSON-NEXT:                        "End": 32768,
130 # JSON-NEXT:                        "Offset": 36864,
131 # JSON-NEXT:                        "Filename": "[stack]"
132 # JSON-NEXT:                    }
133 # JSON-NEXT:                ]
134 # JSON-NEXT:            }
135 # JSON-NEXT:        ]
136 # JSON-NEXT:      }
137 # JSON-NEXT: }
138 # JSON-NEXT: ]