1 # RUN: yaml2obj %s -o %t
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
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
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
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
36 Machine: IMAGE_FILE_MACHINE_AMD64
40 Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
42 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
47 SimpleType: IMAGE_SYM_TYPE_NULL
48 ComplexType: IMAGE_SYM_DTYPE_NULL
49 StorageClass: IMAGE_SYM_CLASS_STATIC
53 SimpleType: IMAGE_SYM_TYPE_NULL
54 ComplexType: IMAGE_SYM_DTYPE_NULL
55 StorageClass: IMAGE_SYM_CLASS_STATIC
59 SimpleType: IMAGE_SYM_TYPE_NULL
60 ComplexType: IMAGE_SYM_DTYPE_FUNCTION
61 StorageClass: IMAGE_SYM_CLASS_EXTERNAL
65 SimpleType: IMAGE_SYM_TYPE_NULL
66 ComplexType: IMAGE_SYM_DTYPE_NULL
67 StorageClass: IMAGE_SYM_CLASS_EXTERNAL