1# RUN: yaml2obj %s -o %t
2# RUN: llvm-objcopy --rename-section=.text=.text2 --rename-section=.data=.data2 --prefix-alloc-sections=.prefix %t %t2
3# RUN: llvm-readobj --sections %t2 | FileCheck %s
4
5# .text/.rel.text and .data/.rela.data are the cases when the relocation section
6# comes after/before its target section respectively. We handle them in different
7# ways to perform both --rename-section and --prefix-alloc-sections in one pass.
8
9!ELF
10FileHeader:
11  Class:           ELFCLASS64
12  Data:            ELFDATA2LSB
13  Type:            ET_REL
14  Machine:         EM_X86_64
15Sections:
16  - Name:            .text
17    Type:            SHT_PROGBITS
18    Flags:           [ SHF_ALLOC ]
19  - Name:            .rel.text
20    Type:            SHT_REL
21    Info:            .text
22  - Name:            .rela.data
23    Type:            SHT_RELA
24    Info:            .data
25  - Name:            .data
26    Type:            SHT_PROGBITS
27    Flags:           [ SHF_ALLOC ]
28
29# CHECK: Name: .prefix.text2
30# CHECK: Name: .rel.prefix.text2
31# CHECK: Name: .rela.prefix.data2
32# CHECK: Name: .prefix.data2
33