indirect-symbol-table-copy.s
1.75 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
# REQUIRES: x86-registered-target
## Show that llvm-objcopy copies the indirect symbol table properly.
# RUN: llvm-mc -assemble -triple x86_64-apple-darwin9 -filetype=obj %s -o %t
# RUN: llvm-objcopy %t %t.copy
# RUN: llvm-readobj --symbols --macho-indirect-symbols %t.copy \
# RUN: | FileCheck %s
# __DATA,__nl_symbol_ptr
.non_lazy_symbol_pointer
bar:
.long 0
baz:
.long 0
.indirect_symbol bar
# __DATA,__la_symbol_ptr
.lazy_symbol_pointer
foo:
.long 0
.indirect_symbol foo
# CHECK: Symbols [
# CHECK-NEXT: Symbol {
# CHECK-NEXT: Name: bar (5)
# CHECK-NEXT: Type: Section (0xE)
# CHECK-NEXT: Section: __nl_symbol_ptr (0x2)
# CHECK-NEXT: RefType: UndefinedNonLazy (0x0)
# CHECK-NEXT: Flags [ (0x0)
# CHECK-NEXT: ]
# CHECK-NEXT: Value: 0x0
# CHECK-NEXT: }
# CHECK-NEXT: Symbol {
# CHECK-NEXT: Name: baz (1)
# CHECK-NEXT: Type: Section (0xE)
# CHECK-NEXT: Section: __nl_symbol_ptr (0x2)
# CHECK-NEXT: RefType: UndefinedNonLazy (0x0)
# CHECK-NEXT: Flags [ (0x0)
# CHECK-NEXT: ]
# CHECK-NEXT: Value: 0x4
# CHECK-NEXT: }
# CHECK-NEXT: Symbol {
# CHECK-NEXT: Name: foo (9)
# CHECK-NEXT: Type: Section (0xE)
# CHECK-NEXT: Section: __la_symbol_ptr (0x3)
# CHECK-NEXT: RefType: UndefinedNonLazy (0x0)
# CHECK-NEXT: Flags [ (0x0)
# CHECK-NEXT: ]
# CHECK-NEXT: Value: 0x8
# CHECK-NEXT: }
# CHECK-NEXT: ]
# CHECK-NEXT: Indirect Symbols {
# CHECK-NEXT: Number: 2
# CHECK-NEXT: Symbols [
# CHECK-NEXT: Entry {
# CHECK-NEXT: Entry Index: 0
# CHECK-NEXT: Symbol Index: 0x80000000
# CHECK-NEXT: }
# CHECK-NEXT: Entry {
# CHECK-NEXT: Entry Index: 1
# CHECK-NEXT: Symbol Index: 0x2
# CHECK-NEXT: }
# CHECK-NEXT: ]
# CHECK-NEXT: }