[memprof] Remove an unused using directive (#117004)
[llvm-project.git] / lld / test / ELF / partition-notes.s
blobe8bc32da93d904e758dab78c16dd99196d604df4
1 // Test that notes (both from object files and synthetic) are duplicated into
2 // each partition.
4 // REQUIRES: x86
6 // RUN: llvm-mc %s -o %t.o -filetype=obj --triple=x86_64-unknown-linux
7 // RUN: ld.lld %t.o -o %t --shared --gc-sections --build-id=sha1
9 // RUN: llvm-objcopy --extract-main-partition %t %t0
10 // RUN: llvm-objcopy --extract-partition=part1 %t %t1
12 // RUN: llvm-readobj --all %t0 | FileCheck %s
13 // RUN: llvm-readobj --all %t1 | FileCheck %s
15 // CHECK: Type: PT_NOTE
16 // CHECK-NEXT: Offset: 0x{{0*}}[[NOTE_OFFSET:[^ ]*]]
18 // CHECK: NoteSections [
19 // CHECK-NEXT: NoteSection {
20 // CHECK-NEXT: Name: .note.obj
21 // CHECK-NEXT: Offset: 0x{{0*}}[[NOTE_OFFSET]]
22 // CHECK-NEXT: Size:
23 // CHECK-NEXT: Notes [
24 // CHECK-NEXT: {
25 // CHECK-NEXT: Owner: foo
26 // CHECK-NEXT: Data size: 0x4
27 // CHECK-NEXT: Type: NT_VERSION (version)
28 // CHECK-NEXT: Description data (
29 // CHECK-NEXT: 0000: 62617200 |bar.|
30 // CHECK-NEXT: )
31 // CHECK-NEXT: }
32 // CHECK-NEXT: ]
33 // CHECK-NEXT: }
34 // CHECK-NEXT: NoteSection {
35 // CHECK-NEXT: Name: .note.gnu.build-id
36 // CHECK-NEXT: Offset:
37 // CHECK-NEXT: Size:
38 // CHECK-NEXT: Notes [
39 // CHECK-NEXT: {
40 // CHECK-NEXT: Owner: GNU
41 // CHECK-NEXT: Data size:
42 // CHECK-NEXT: Type: NT_GNU_BUILD_ID (unique build ID bitstring)
43 // CHECK-NEXT: Build ID: d5101cb9d03b7e836ba9b64f5768a0b31980920f{{$}}
44 // CHECK-NEXT: }
45 // CHECK-NEXT: ]
46 // CHECK-NEXT: }
47 // CHECK-NEXT: ]
49 .section .llvm_sympart,"",@llvm_sympart
50 .asciz "part1"
51 .quad p1
53 .section .data.p0,"aw",@progbits
54 .globl p0
55 p0:
57 .section .data.p1,"aw",@progbits
58 .globl p1
59 p1:
61 .section .note.obj,"a",@note
62 .align 4
63 .long 2f-1f
64 .long 3f-2f
65 .long 1
66 1: .asciz "foo"
67 2: .asciz "bar"