File: local-private-extern.yaml

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (81 lines) | stat: -rw-r--r-- 2,200 bytes parent folder | download | duplicates (21)
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
## Check that local private externs -- symbols without N_EXT but with N_PEXT set
## -- are translation-unit-scoped. These symbols may be generated by `ld -r`,
## which emits an object file. Since LLD does not yet support `-r`, we use
## yaml2obj to construct the input.

# RUN: rm -rf %t; mkdir %t
# RUN: yaml2obj %s > %t/foo.o
## No duplicate symbol conflict since _foo is not extern
# RUN: %lld -dylib %t/foo.o %t/foo.o -o %t/foo
# RUN: llvm-nm -m %t/foo | FileCheck %s

## Note that the symbols in the output are no longer marked as "was a private
## external".
# CHECK: (absolute) non-external _bar
# CHECK: (absolute) non-external _bar
# CHECK: (__DATA,__data) non-external _foo
# CHECK: (__DATA,__data) non-external _foo

--- !mach-o
FileHeader:
  magic:           0xFEEDFACF
  cputype:         0x1000007
  cpusubtype:      0x3
  filetype:        0x1
  ncmds:           2
  sizeofcmds:      208
  flags:           0x0
  reserved:        0x0
LoadCommands:
  - cmd:             LC_SEGMENT_64
    cmdsize:         152
    segname:         ''
    vmaddr:          0
    vmsize:          0
    fileoff:         272
    filesize:        0
    maxprot:         7
    initprot:        7
    nsects:          1
    flags:           0
    Sections:
      - sectname:        __data
        segname:         __DATA
        addr:            0x0
        size:            0
        offset:          0x110
        align:           0
        reloff:          0x0
        nreloc:          0
        flags:           0x0
        reserved1:       0x0
        reserved2:       0x0
        reserved3:       0x0
        content:         ''
  - cmd:             LC_SYMTAB
    cmdsize:         24
    symoff:          272
    nsyms:           2
    stroff:          304
    strsize:         16
LinkEditData:
  NameList:
    - n_strx:          2 ## _foo
      n_type:          0x1E ## N_PEXT | N_SECT
      n_sect:          1
      n_desc:          32
      n_value:         0
    - n_strx:          7 ## _bar
      n_type:          0x12 ## N_PEXT | N_ABS
      n_sect:          0
      n_desc:          0
      n_value:         291
  StringTable:
    - ' '
    - _foo
    - _bar
    - ''
    - ''
    - ''
    - ''
...