Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / partition-notes.s
blobc5ade3a47e052828427d11e30596a3d6167cdc66
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: Notes [
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: Note {
24 // CHECK-NEXT: Owner: foo
25 // CHECK-NEXT: Data size: 0x4
26 // CHECK-NEXT: Type: NT_VERSION (version)
27 // CHECK-NEXT: Description data (
28 // CHECK-NEXT: 0000: 62617200 |bar.|
29 // CHECK-NEXT: )
30 // CHECK-NEXT: }
31 // CHECK-NEXT: }
32 // CHECK-NEXT: NoteSection {
33 // CHECK-NEXT: Name: .note.gnu.build-id
34 // CHECK-NEXT: Offset:
35 // CHECK-NEXT: Size:
36 // CHECK-NEXT: Note {
37 // CHECK-NEXT: Owner: GNU
38 // CHECK-NEXT: Data size:
39 // CHECK-NEXT: Type: NT_GNU_BUILD_ID (unique build ID bitstring)
40 // CHECK-NEXT: Build ID: d5101cb9d03b7e836ba9b64f5768a0b31980920f{{$}}
41 // CHECK-NEXT: }
42 // CHECK-NEXT: }
43 // CHECK-NEXT: ]
45 .section .llvm_sympart,"",@llvm_sympart
46 .asciz "part1"
47 .quad p1
49 .section .data.p0,"aw",@progbits
50 .globl p0
51 p0:
53 .section .data.p1,"aw",@progbits
54 .globl p1
55 p1:
57 .section .note.obj,"a",@note
58 .align 4
59 .long 2f-1f
60 .long 3f-2f
61 .long 1
62 1: .asciz "foo"
63 2: .asciz "bar"