• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: yaml2obj %s -o %t
2
3## A non-existent symbol does not error.
4# RUN: llvm-objcopy --redefine-sym func=cnuf1234 --redefine-sym foo=ba --redefine-sym=notexist= %t %t2 2>&1 | count 0
5# RUN: llvm-readobj --symbols %t2 | FileCheck %s
6
7# RUN: echo 'func cnuf1234 #rename func' > %t.rename.txt
8# RUN: echo '  foo ba ' >> %t.rename.txt
9# RUN: echo 'notexist notexist' >> %t.rename.txt
10# RUN: llvm-objcopy --redefine-syms %t.rename.txt %t %t3 2>&1 | count 0
11# RUN: cmp %t2 %t3
12
13# CHECK:      Symbol {
14# CHECK:      Symbol {
15# CHECK:      Symbol {
16# CHECK-NEXT:   Name: cnuf1234
17# CHECK-NEXT:   Value: 0
18# CHECK-NEXT:   Section: .text (1)
19# CHECK-NEXT:   BaseType: Null (0x0)
20# CHECK-NEXT:   ComplexType: Function (0x2)
21# CHECK-NEXT:   StorageClass: External (0x2)
22# CHECK-NEXT:   AuxSymbolCount: 0
23# CHECK-NEXT: }
24# CHECK-NEXT: Symbol {
25# CHECK-NEXT:   Name: ba
26# CHECK-NEXT:   Value: 0
27# CHECK-NEXT:   Section: .rdata (2)
28# CHECK-NEXT:   BaseType: Null (0x0)
29# CHECK-NEXT:   ComplexType: Null (0x0)
30# CHECK-NEXT:   StorageClass: External (0x2)
31# CHECK-NEXT:   AuxSymbolCount: 0
32# CHECK-NEXT: }
33
34--- !COFF
35header:
36  Machine:         IMAGE_FILE_MACHINE_AMD64
37  Characteristics: [  ]
38sections:
39  - Name:            .text
40    Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
41  - Name:            .rdata
42    Characteristics: [  ]
43    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
44symbols:
45  - Name:            .text
46    Value:           0
47    SectionNumber:   1
48    SimpleType:      IMAGE_SYM_TYPE_NULL
49    ComplexType:     IMAGE_SYM_DTYPE_NULL
50    StorageClass:    IMAGE_SYM_CLASS_STATIC
51  - Name:            .rdata
52    Value:           0
53    SectionNumber:   2
54    SimpleType:      IMAGE_SYM_TYPE_NULL
55    ComplexType:     IMAGE_SYM_DTYPE_NULL
56    StorageClass:    IMAGE_SYM_CLASS_STATIC
57  - Name:            func
58    Value:           0
59    SectionNumber:   1
60    SimpleType:      IMAGE_SYM_TYPE_NULL
61    ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
62    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
63  - Name:            foo
64    Value:           0
65    SectionNumber:   2
66    SimpleType:      IMAGE_SYM_TYPE_NULL
67    ComplexType:     IMAGE_SYM_DTYPE_NULL
68    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
69...
70