File: sections.test

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (89 lines) | stat: -rw-r--r-- 2,731 bytes parent folder | download | duplicates (9)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
## This is a general test for the --section-headers option.

# RUN: yaml2obj %s -o %t1
# RUN: llvm-readobj --section-headers %t1 | \
# RUN:   FileCheck --strict-whitespace --match-full-lines --check-prefix=SEC32 %s

#      SEC32:Format: aixcoff-rs6000
# SEC32-NEXT:Arch: powerpc
# SEC32-NEXT:AddressSize: 32bit
# SEC32-NEXT:Sections [
# SEC32-NEXT:  Section {
# SEC32-NEXT:    Index: 1
# SEC32-NEXT:    Name: .text
# SEC32-NEXT:    PhysicalAddress: 0x0
# SEC32-NEXT:    VirtualAddress: 0x0
# SEC32-NEXT:    Size: 0x4
# SEC32-NEXT:    RawDataOffset: 0x64
# SEC32-NEXT:    RelocationPointer: 0x0
# SEC32-NEXT:    LineNumberPointer: 0x0
# SEC32-NEXT:    NumberOfRelocations: 0
# SEC32-NEXT:    NumberOfLineNumbers: 0
# SEC32-NEXT:    Type: STYP_TEXT (0x20)
# SEC32-NEXT:  }
# SEC32-NEXT:  Section {
# SEC32-NEXT:    Index: 2
# SEC32-NEXT:    Name: .data
# SEC32-NEXT:    PhysicalAddress: 0x4
# SEC32-NEXT:    VirtualAddress: 0x4
# SEC32-NEXT:    Size: 0x4
# SEC32-NEXT:    RawDataOffset: 0x68
# SEC32-NEXT:    RelocationPointer: 0x6C
# SEC32-NEXT:    LineNumberPointer: 0x0
# SEC32-NEXT:    NumberOfRelocations: 1
# SEC32-NEXT:    NumberOfLineNumbers: 0
# SEC32-NEXT:    Type: STYP_DATA (0x40)
# SEC32-NEXT:  }
# SEC32-NEXT:]

--- !XCOFF
FileHeader:
  MagicNumber: [[MAGIC=0x1DF]]
Sections:
  - Name:        .text
    Flags:       [ STYP_TEXT ]
    SectionData: "1234"
  - Name:        .data
    Flags:       [ STYP_DATA ]
    SectionData: "5678"
    Relocations:
      - Address: 0x80
        Symbol:  0x21
        Info:    0x1F
        Type:    0x0

# RUN: yaml2obj -DMAGIC=0x01F7 %s -o %t2
# RUN: llvm-readobj --section-headers %t2 | \
# RUN:   FileCheck --strict-whitespace --match-full-lines --check-prefix=SEC64 %s

#      SEC64:Format: aix5coff64-rs6000
# SEC64-NEXT:Arch: powerpc64
# SEC64-NEXT:AddressSize: 64bit
# SEC64-NEXT:Sections [
# SEC64-NEXT:  Section {
# SEC64-NEXT:    Index: 1
# SEC64-NEXT:    Name: .text
# SEC64-NEXT:    PhysicalAddress: 0x0
# SEC64-NEXT:    VirtualAddress: 0x0
# SEC64-NEXT:    Size: 0x4
# SEC64-NEXT:    RawDataOffset: 0xA8
# SEC64-NEXT:    RelocationPointer: 0x0
# SEC64-NEXT:    LineNumberPointer: 0x0
# SEC64-NEXT:    NumberOfRelocations: 0
# SEC64-NEXT:    NumberOfLineNumbers: 0
# SEC64-NEXT:    Type: STYP_TEXT (0x20)
# SEC64-NEXT:  }
# SEC64-NEXT:  Section {
# SEC64-NEXT:    Index: 2
# SEC64-NEXT:    Name: .data
# SEC64-NEXT:    PhysicalAddress: 0x4
# SEC64-NEXT:    VirtualAddress: 0x4
# SEC64-NEXT:    Size: 0x4
# SEC64-NEXT:    RawDataOffset: 0xAC
# SEC64-NEXT:    RelocationPointer: 0xB0
# SEC64-NEXT:    LineNumberPointer: 0x0
# SEC64-NEXT:    NumberOfRelocations: 1
# SEC64-NEXT:    NumberOfLineNumbers: 0
# SEC64-NEXT:    Type: STYP_DATA (0x40)
# SEC64-NEXT:  }
# SEC64-NEXT:]