File: ordinals-override.test

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 (115 lines) | stat: -rw-r--r-- 4,187 bytes parent folder | download | duplicates (11)
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
106
107
108
109
110
111
112
113
114
115
# RUN: yaml2obj %s -o %t.obj
#
# RUN: lld-link /out:%t.dll /dll %t.obj
# RUN: llvm-objdump -p %t.dll | FileCheck --check-prefix=CHECK1 %s
#
# CHECK1:      Export Table:
# CHECK1:      DLL name: ordinals-override.test.tmp.dll
# CHECK1:      Ordinal base: 1
# CHECK1:      Ordinal      RVA  Name
# CHECK1-NEXT:       1   0x1010  ?bar@@YAXXZ
# CHECK1-NEXT:       2   0x1000  ?foo@@YAXXZ
# CHECK1-NEXT:       3   0x1020  baz
#
# RUN: lld-link /out:%t.dll /dll %t.obj /EXPORT:?foo@@YAXXZ,@55
# RUN: llvm-objdump -p %t.dll | FileCheck --check-prefix=CHECK2 %s
#
# CHECK2:      Export Table:
# CHECK2:      DLL name: ordinals-override.test.tmp.dll
# CHECK2:      Ordinal base: 55
# CHECK2:      Ordinal      RVA  Name
# CHECK2-NEXT:      55   0x1000  ?foo@@YAXXZ
# CHECK2-NEXT:      56   0x1010  ?bar@@YAXXZ
# CHECK2-NEXT:      57   0x1020  baz
#
# RUN: lld-link /out:%t.dll /dll %t.obj /EXPORT:?foo@@YAXXZ,@55 /EXPORT:?bar@@YAXXZ,@122
# RUN: llvm-objdump -p %t.dll | FileCheck --check-prefix=CHECK3 %s
#
# CHECK3:      Export Table:
# CHECK3:      DLL name: ordinals-override.test.tmp.dll
# CHECK3:      Ordinal base: 55
# CHECK3:      Ordinal      RVA  Name
# CHECK3-NEXT:      55   0x1000  ?foo@@YAXXZ
# CHECK3-NEXT:     122   0x1010  ?bar@@YAXXZ
# CHECK3-NEXT:     123   0x1020  baz
#
# RUN: echo "EXPORTS" > %t.def
# RUN: echo "?foo@@YAXXZ @55" >> %t.def
# RUN: echo "?bar@@YAXXZ @122" >> %t.def
# RUN: lld-link /out:%t.dll /dll %t.obj /DEF:%t.def 2>&1 | FileCheck --check-prefix=WARN --allow-empty %s
# WARN-NOT: lld-link: warning
#
# RUN: llvm-objdump -p %t.dll | FileCheck --check-prefix=CHECK3 %s
#
# RUN: lld-link /out:%t.dll /dll %t.obj /DEF:%t.def /EXPORT:?foo@@YAXXZ,@10000 2>&1 | FileCheck --check-prefix=DUPLICATED %s
# DUPLICATED: lld-link: warning: duplicate export: ?foo@@YAXXZ first seen in /export, now in /def
#
# RUN: llvm-objdump -p %t.dll | FileCheck --check-prefix=CHECK4 %s
#
# CHECK4:      Export Table:
# CHECK4:      DLL name: ordinals-override.test.tmp.dll
# CHECK4:      Ordinal base: 122
# CHECK4:      Ordinal      RVA  Name
# CHECK4-NEXT:     122   0x1010  ?bar@@YAXXZ
# CHECK4-NEXT:   10000   0x1000  ?foo@@YAXXZ
# CHECK4-NEXT:   10001   0x1020  baz

# The .drectve section below contains the following:
#
#   Linker Directives
#   -----------------
#   /export:baz=?baz@@YAXXZ
#   /EXPORT:?foo@@YAXXZ
#   /EXPORT:?bar@@YAXXZ

--- !COFF
header:
  Machine:         IMAGE_FILE_MACHINE_AMD64
  Characteristics: [  ]
sections:
  - Name:            .drectve
    Characteristics: [ IMAGE_SCN_LNK_INFO, IMAGE_SCN_LNK_REMOVE ]
    Alignment:       1
    SectionData:     2f6578706f72743a62617a3d3f62617a4040594158585a202f4558504f52543a3f666f6f4040594158585a202f4558504f52543a3f6261724040594158585a
  - Name:            '.text$mn'
    Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
    Alignment:       16
    SectionData:     C20000CCCCCCCCCCCCCCCCCCCCCCCCCCC20000CCCCCCCCCCCCCCCCCCCCCCCCCCC20000
symbols:
  - Name:            '.text$mn'
    Value:           0
    SectionNumber:   2
    SimpleType:      IMAGE_SYM_TYPE_NULL
    ComplexType:     IMAGE_SYM_DTYPE_NULL
    StorageClass:    IMAGE_SYM_CLASS_STATIC
    SectionDefinition:
      Length:          35
      NumberOfRelocations: 0
      NumberOfLinenumbers: 0
      CheckSum:        0
      Number:          0
  - Name:            _DllMainCRTStartup
    Value:           0
    SectionNumber:   2
    SimpleType:      IMAGE_SYM_TYPE_NULL
    ComplexType:     IMAGE_SYM_DTYPE_NULL
    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
  - Name:            '?foo@@YAXXZ'
    Value:           0
    SectionNumber:   2
    SimpleType:      IMAGE_SYM_TYPE_NULL
    ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
  - Name:            '?bar@@YAXXZ'
    Value:           16
    SectionNumber:   2
    SimpleType:      IMAGE_SYM_TYPE_NULL
    ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
  - Name:            '?baz@@YAXXZ'
    Value:           32
    SectionNumber:   2
    SimpleType:      IMAGE_SYM_TYPE_NULL
    ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
...