1
+ # Show that the --output-format correctly configures both the main output file
2
+ # and DWO output.
3
+ # Note that we don't actually need any DWARF to produce the DWO file.
4
+
1
5
# RUN: yaml2obj %s > %t.o
2
6
3
- # RUN: llvm-objcopy %t.o -O elf32-i386 %t.elf32_i386.o
7
+ # Without --output-format, the format should match the input.
8
+ # RUN: llvm-objcopy %t.o %t.default.o --split-dwo=%t.default.dwo
9
+ # RUN: llvm-readobj --file-headers %t.default.o | FileCheck %s --check-prefixes=CHECK,DEFAULT,32
10
+ # RUN: llvm-readobj --file-headers %t.default.dwo | FileCheck %s --check-prefixes=CHECK,DEFAULT,32
11
+
12
+ # RUN: llvm-objcopy %t.o -O elf32-i386 %t.elf32_i386.o --split-dwo=%t.elf32_i386.dwo
4
13
# RUN: llvm-readobj --file-headers %t.elf32_i386.o | FileCheck %s --check-prefixes=CHECK,I386,32,SYSV
14
+ # RUN: llvm-readobj --file-headers %t.elf32_i386.dwo | FileCheck %s --check-prefixes=CHECK,I386,32,SYSV
15
+
16
+ # RUN: llvm-objcopy %t.o -O elf32-i386-freebsd %t.elf32_i386_freebsd.o --split-dwo=%t.elf32_i386_freebsd.dwo
17
+ # RUN: llvm-readobj --file-headers %t.elf32_i386_freebsd.o | FileCheck %s --check-prefixes=CHECK,I386,32,FREEBSD
18
+ # RUN: llvm-readobj --file-headers %t.elf32_i386_freebsd.dwo | FileCheck %s --check-prefixes=CHECK,I386,32,FREEBSD
5
19
6
- # RUN: llvm-objcopy %t.o -O elf32-powerpcle %t.elf32_ppcle.o
20
+ # RUN: llvm-objcopy %t.o -O elf32-powerpcle %t.elf32_ppcle.o --split-dwo=%t.elf32_ppcle.dwo
7
21
# RUN: llvm-readobj --file-headers %t.elf32_ppcle.o | FileCheck %s --check-prefixes=CHECK,PPC,32,SYSV
22
+ # RUN: llvm-readobj --file-headers %t.elf32_ppcle.dwo | FileCheck %s --check-prefixes=CHECK,PPC,32,SYSV
8
23
9
- # RUN: llvm-objcopy %t.o -O elf32-x86-64 %t.elf32_x86_64.o
24
+ # RUN: llvm-objcopy %t.o -O elf32-x86-64 %t.elf32_x86_64.o --split-dwo=%t.elf32_x86_64.dwo
10
25
# RUN: llvm-readobj --file-headers %t.elf32_x86_64.o | FileCheck %s --check-prefixes=CHECK,X86-64,32,SYSV
26
+ # RUN: llvm-readobj --file-headers %t.elf32_x86_64.dwo | FileCheck %s --check-prefixes=CHECK,X86-64,32,SYSV
11
27
12
- # RUN: llvm-objcopy %t.o -O elf64-powerpcle %t.elf64_ppcle.o
28
+ # RUN: llvm-objcopy %t.o -O elf64-powerpcle %t.elf64_ppcle.o --split-dwo=%t.elf64_ppcle.dwo
13
29
# RUN: llvm-readobj --file-headers %t.elf64_ppcle.o | FileCheck %s --check-prefixes=CHECK,PPC64,64,SYSV
30
+ # RUN: llvm-readobj --file-headers %t.elf64_ppcle.dwo | FileCheck %s --check-prefixes=CHECK,PPC64,64,SYSV
14
31
15
- # RUN: llvm-objcopy %t.o -O elf64-x86-64 %t.elf64_x86_64.o
32
+ # RUN: llvm-objcopy %t.o -O elf64-x86-64 %t.elf64_x86_64.o --split-dwo=%t.elf64_x86_64.dwo
16
33
# RUN: llvm-readobj --file-headers %t.elf64_x86_64.o | FileCheck %s --check-prefixes=CHECK,X86-64,64,SYSV
34
+ # RUN: llvm-readobj --file-headers %t.elf64_x86_64.dwo | FileCheck %s --check-prefixes=CHECK,X86-64,64,SYSV
17
35
18
- # RUN: llvm-objcopy %t.o -O elf64-x86-64-freebsd %t.elf64_x86_64_freebsd.o
36
+ # RUN: llvm-objcopy %t.o -O elf64-x86-64-freebsd %t.elf64_x86_64_freebsd.o --split-dwo=%t.elf64_x86_64_freebsd.dwo
19
37
# RUN: llvm-readobj --file-headers %t.elf64_x86_64_freebsd.o | FileCheck %s --check-prefixes=CHECK,X86-64,64,FREEBSD
20
-
21
- # RUN: llvm-objcopy %t.o -O elf32-i386-freebsd %t.elf32_i386_freebsd.o
22
- # RUN: llvm-readobj --file-headers %t.elf32_i386_freebsd.o | FileCheck %s --check-prefixes=CHECK,I386,32,FREEBSD
38
+ # RUN: llvm-readobj --file-headers %t.elf64_x86_64_freebsd.dwo | FileCheck %s --check-prefixes=CHECK,X86-64,64,FREEBSD
23
39
24
40
!ELF
25
41
FileHeader:
26
42
Class: ELFCLASS32
27
43
Data: ELFDATA2LSB
28
44
Type: ET_EXEC
29
- Machine: EM_386
30
- OSABI: ELFOSABI_STANDALONE # Arbitrary non-zero value.
45
+ # Arbitrary values that do not match any value we convert to via --output-format.
46
+ Machine: EM_NONE
47
+ OSABI: ELFOSABI_STANDALONE
31
48
Sections:
32
49
- Name: .text
33
50
Type: SHT_PROGBITS
@@ -50,14 +67,16 @@ Symbols:
50
67
# 32-SAME: ELF32-
51
68
# 64-SAME: ELF64-
52
69
# I386-SAME: i386
53
- # PPC-SAME: ppc
70
+ # PPC-SAME: ppc{{$}}
54
71
# PPC64-SAME: ppc64
55
72
# X86-64-SAME: x86-64
73
+ # DEFAULT-SAME: unknown
56
74
57
75
# I386-NEXT: Arch: i386
58
- # PPC-NEXT: Arch: powerpc
76
+ # PPC-NEXT: Arch: powerpc{{$}}
59
77
# PPC64-NEXT: Arch: powerpc64le
60
78
# X86-64-NEXT: Arch: x86_64
79
+ # DEFAULT-NEXT: Arch: unknown
61
80
62
81
# 32-NEXT: AddressSize: 32bit
63
82
# 64-NEXT: AddressSize: 64bit
@@ -68,11 +87,12 @@ Symbols:
68
87
69
88
# SYSV: OS/ABI: SystemV (0x0)
70
89
# FREEBSD: OS/ABI: FreeBSD (0x9)
90
+ # DEFAULT: OS/ABI: Standalone (0xFF)
71
91
72
- # I386: Machine: EM_386
73
- # PPC: Machine: EM_PPC
74
- # PPC64: Machine: EM_PPC64
75
- # X86-64: Machine: EM_X86_64
92
+ # I386: Machine: EM_386 (0x3)
93
+ # PPC: Machine: EM_PPC (0x14)
94
+ # PPC64: Machine: EM_PPC64 (0x15)
95
+ # X86-64: Machine: EM_X86_64 (0x3E)
76
96
77
97
# 32: HeaderSize: 52
78
98
# 64: HeaderSize: 64
0 commit comments