blob: 1a22f62e97c74576b48001ad40cd90eea21bfb64 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
# RUN: yaml2obj %s -o %t
# RUN: llvm-objcopy %t %t2
# RUN: llvm-readobj --sections %t2 | FileCheck %s
## This checks that llvm-objcopy layouts sections in the order of their offsets
## in the input file in spite of the order of section headers is different.
# CHECK: Index: 1
# CHECK-NEXT: Name: foo
# CHECK-NEXT: Type:
# CHECK-NEXT: Flags [
# CHECK-NEXT: SHF_ALLOC
# CHECK-NEXT: ]
# CHECK-NEXT: Address:
# CHECK-NEXT: Offset: 0x50
# CHECK: Index: 2
# CHECK-NEXT: Name: bar
# CHECK-NEXT: Type: SHT_PROGBITS
# CHECK-NEXT: Flags [
# CHECK-NEXT: SHF_ALLOC
# CHECK-NEXT: ]
# CHECK-NEXT: Address:
# CHECK-NEXT: Offset: 0x40
# CHECK: Index: 3
# CHECK-NEXT: Name: baz
# CHECK-NEXT: Type: SHT_PROGBITS
# CHECK-NEXT: Flags [
# CHECK-NEXT: SHF_ALLOC
# CHECK-NEXT: ]
# CHECK-NEXT: Address:
# CHECK-NEXT: Offset: 0x48
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_X86_64
Sections:
- Name: bar
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC ]
AddressAlign: 0x4
Offset: 0x40
Content: 0000000000000000
- Name: baz
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC ]
AddressAlign: 0x4
Offset: 0x48
Content: 0000000000000000
- Name: foo
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC ]
AddressAlign: 0x4
Offset: 0x50
Content: 0000000000000000
- Type: SectionHeaderTable
Sections:
## Note: the order of section headers differs from their layout.
- Name: foo
- Name: bar
- Name: baz
- Name: .shstrtab
- Name: .strtab
|