merge-string.s
2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// REQUIRES: x86
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
// RUN: ld.lld -O 2 %t.o -o %t.so -shared
// RUN: llvm-readobj -S --section-data --symbols %t.so | FileCheck %s
// RUN: ld.lld -O 1 %t.o -o %t.so -shared
// RUN: llvm-readobj -S --section-data --symbols %t.so | FileCheck --check-prefix=NOTAIL %s
// RUN: ld.lld -O 0 %t.o -o %t.so -shared
// RUN: llvm-readobj -S --section-data --symbols %t.so | FileCheck --check-prefix=NOMERGE %s
.section .rodata1,"aMS",@progbits,1
.asciz "abc"
foo:
.ascii "a"
bar:
.asciz "bc"
.asciz "bc"
.section .rodata2,"aMS",@progbits,2
.align 2
zed:
.short 20
.short 0
// CHECK: Name: .rodata1
// CHECK-NEXT: Type: SHT_PROGBITS
// CHECK-NEXT: Flags [
// CHECK-NEXT: SHF_ALLOC
// CHECK-NEXT: SHF_MERGE
// CHECK-NEXT: SHF_STRINGS
// CHECK-NEXT: ]
// CHECK-NEXT: Address: 0x20D
// CHECK-NEXT: Offset: 0x20D
// CHECK-NEXT: Size: 4
// CHECK-NEXT: Link: 0
// CHECK-NEXT: Info: 0
// CHECK-NEXT: AddressAlignment: 1
// CHECK-NEXT: EntrySize: 1
// CHECK-NEXT: SectionData (
// CHECK-NEXT: 0000: 61626300 |abc.|
// CHECK-NEXT: )
// NOTAIL: Name: .rodata1
// NOTAIL-NEXT: Type: SHT_PROGBITS
// NOTAIL-NEXT: Flags [
// NOTAIL-NEXT: SHF_ALLOC
// NOTAIL-NEXT: SHF_MERGE
// NOTAIL-NEXT: SHF_STRINGS
// NOTAIL-NEXT: ]
// NOTAIL-NEXT: Address: 0x20D
// NOTAIL-NEXT: Offset: 0x20D
// NOTAIL-NEXT: Size: 7
// NOTAIL-NEXT: Link: 0
// NOTAIL-NEXT: Info: 0
// NOTAIL-NEXT: AddressAlignment: 1
// NOTAIL-NEXT: EntrySize: 1
// NOTAIL-NEXT: SectionData (
// NOTAIL-NEXT: 0000: 62630061 626300 |bc.abc.|
// NOTAIL-NEXT: )
// NOMERGE: Name: .rodata1
// NOMERGE-NEXT: Type: SHT_PROGBITS
// NOMERGE-NEXT: Flags [
// NOMERGE-NEXT: SHF_ALLOC
// NOMERGE-NEXT: SHF_MERGE
// NOMERGE-NEXT: SHF_STRINGS
// NOMERGE-NEXT: ]
// NOMERGE-NEXT: Address: 0x20D
// NOMERGE-NEXT: Offset: 0x20D
// NOMERGE-NEXT: Size: 11
// NOMERGE-NEXT: Link: 0
// NOMERGE-NEXT: Info: 0
// NOMERGE-NEXT: AddressAlignment: 1
// NOMERGE-NEXT: EntrySize: 1
// NOMERGE-NEXT: SectionData (
// NOMERGE-NEXT: 0000: 61626300 61626300 626300 |abc.abc.bc.|
// NOMERGE-NEXT: )
// CHECK: Name: .rodata2
// CHECK-NEXT: Type: SHT_PROGBITS
// CHECK-NEXT: Flags [
// CHECK-NEXT: SHF_ALLOC
// CHECK-NEXT: SHF_MERGE
// CHECK-NEXT: SHF_STRINGS
// CHECK-NEXT: ]
// CHECK-NEXT: Address: 0x212
// CHECK-NEXT: Offset: 0x212
// CHECK-NEXT: Size: 4
// CHECK-NEXT: Link: 0
// CHECK-NEXT: Info: 0
// CHECK-NEXT: AddressAlignment: 2
// CHECK-NEXT: EntrySize: 2
// CHECK-NEXT: SectionData (
// CHECK-NEXT: 0000: 14000000 |....|
// CHECK-NEXT: )
// CHECK: Name: bar
// CHECK-NEXT: Value: 0x20E
// CHECK: Name: foo
// CHECK-NEXT: Value: 0x20D
// CHECK: Name: zed
// CHECK-NEXT: Value: 0x212
// CHECK-NEXT: Size: 0