1 # RUN: yaml2obj %s -o %t
2 # RUN: llvm-objcopy --redefine-sym foo=oof --redefine-sym =wasempty --redefine-sym empty= %t %t2
3 # RUN: llvm-readobj --symbols %t2 | FileCheck %s
4 # RUN: echo " bar rab #rename bar " > %t.rename1.txt
5 # RUN: echo "foo oof #rename foo " > %t.rename2.txt
6 # RUN: echo " empty ytpme #rename empty " >> %t.rename2.txt
7 # RUN: llvm-objcopy --redefine-syms %t.rename1.txt --redefine-syms %t.rename2.txt %t %t4
8 # RUN: llvm-readobj --symbols %t4 | FileCheck %s --check-prefix=MULTIPLE-FILES
19 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
21 AddressAlign: 0x0000000000000010
22 Content: "0000000000000000"
27 AddressAlign: 0x0000000000000010
28 Content: "0000000000000000"
54 #CHECK-NEXT: Value: 0x0
56 #CHECK-NEXT: Binding: Local
57 #CHECK-NEXT: Type: None
59 #CHECK-NEXT: Section: Undefined
62 #CHECK-NEXT: Name: oof
63 #CHECK-NEXT: Value: 0x1004
65 #CHECK-NEXT: Binding: Global
66 #CHECK-NEXT: Type: Function
68 #CHECK-NEXT: Section: .text
71 #CHECK-NEXT: Name: bar
72 #CHECK-NEXT: Value: 0x2000
74 #CHECK-NEXT: Binding: Global
75 #CHECK-NEXT: Type: Object
77 #CHECK-NEXT: Section: .data
80 #CHECK-NEXT: Name: (0)
81 #CHECK-NEXT: Value: 0x1008
83 #CHECK-NEXT: Binding: Global
84 #CHECK-NEXT: Type: Function
86 #CHECK-NEXT: Section: .text
89 #CHECK-NEXT: Name: wasempty
90 #CHECK-NEXT: Value: 0x2008
92 #CHECK-NEXT: Binding: Global
93 #CHECK-NEXT: Type: Object
95 #CHECK-NEXT: Section: .data
98 #MULTIPLE-FILES: Name: oof
99 #MULTIPLE-FILES-NEXT: Value: 0x1004
100 #MULTIPLE-FILES: Name: rab
101 #MULTIPLE-FILES-NEXT: Value: 0x2000
102 #MULTIPLE-FILES: Name: ytpme
103 #MULTIPLE-FILES-NEXT: Value: 0x1008
105 ## Show that it is not an error if a specified symbol is not present.
106 # RUN: llvm-objcopy %t2 %t5 --redefine-sym missing=blah
109 ## Show that --redefine-sym doesn't chain together.
110 # RUN: llvm-objcopy %t2 %t6 --redefine-sym oof=bob --redefine-sym bob=baz
111 # RUN: llvm-readobj %t6 --syms | FileCheck %s --check-prefix=CHAIN --implicit-check-not="Name: baz"