File: indirect-symbol-table-copy.s

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 995,808 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (66 lines) | stat: -rw-r--r-- 1,790 bytes parent folder | download | duplicates (23)
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: }