1# RUN: yaml2obj %s -o %t
2# RUN: llvm-objcopy --prefix-symbols prefix %t %t2
3# RUN: llvm-readobj --symbols %t2 | FileCheck %s --check-prefixes=COMMON,BASIC
4# RUN: llvm-objcopy --redefine-sym bar=baz --prefix-symbols prefix %t %t3
5# RUN: llvm-readobj --symbols %t3 | FileCheck %s --check-prefixes=COMMON,REDEF
6
7!ELF
8FileHeader:
9  Class:           ELFCLASS64
10  Data:            ELFDATA2LSB
11  Type:            ET_REL
12  Machine:         EM_X86_64
13Sections:
14  - Name:            .text
15    Type:            SHT_PROGBITS
16    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
17    Address:         0x1000
18    AddressAlign:    0x0000000000000010
19    Size:            64
20Symbols:
21  - Name:     foo
22    Type:     STT_SECTION
23    Section:  .text
24  - Name:     bar
25    Type:     STT_FILE
26    Section:  .text
27  - Name:     foobar
28    Type:     STT_FUNC
29    Section:  .text
30    Binding:  STB_GLOBAL
31
32# COMMON: Symbols [
33# COMMON-NEXT:  Symbol {
34# COMMON-NEXT:    Name:
35# COMMON-NEXT:    Value: 0x0
36# COMMON-NEXT:    Size: 0
37# COMMON-NEXT:    Binding: Local
38# COMMON-NEXT:    Type: None
39# COMMON-NEXT:    Other: 0
40# COMMON-NEXT:    Section: Undefined
41# COMMON-NEXT:  }
42# COMMON-NEXT:  Symbol {
43# COMMON-NEXT:    Name: foo
44# COMMON-NEXT:    Value: 0x0
45# COMMON-NEXT:    Size: 0
46# COMMON-NEXT:    Binding: Local
47# COMMON-NEXT:    Type: Section
48# COMMON-NEXT:    Other: 0
49# COMMON-NEXT:    Section: .text
50# COMMON-NEXT:  }
51# COMMON-NEXT:  Symbol {
52# BASIC-NEXT:    Name: prefixbar
53# REDEF-NEXT:    Name: prefixbaz
54# COMMON-NEXT:    Value: 0x0
55# COMMON-NEXT:    Size: 0
56# COMMON-NEXT:    Binding: Local
57# COMMON-NEXT:    Type: File
58# COMMON-NEXT:    Other: 0
59# COMMON-NEXT:    Section: .text
60# COMMON-NEXT:  }
61# COMMON-NEXT:  Symbol {
62# COMMON-NEXT:    Name: prefixfoobar
63# COMMON-NEXT:    Value: 0x0
64# COMMON-NEXT:    Size: 0
65# COMMON-NEXT:    Binding: Global
66# COMMON-NEXT:    Type: Function
67# COMMON-NEXT:    Other: 0
68# COMMON-NEXT:    Section: .text
69# COMMON-NEXT:  }
70# COMMON-NEXT:]
71