File: sections.test

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.8-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,388 kB
  • sloc: cpp: 7,438,767; ansic: 1,393,871; asm: 1,012,926; python: 241,728; f90: 86,635; objc: 75,411; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (87 lines) | stat: -rw-r--r-- 2,714 bytes parent folder | download | duplicates (7)
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
## 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-prefixes=SEC,SEC32 %s

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

#      SEC32:Format: aixcoff-rs6000
#      SEC64:Format: aix5coff64-rs6000
# SEC32-NEXT:Arch: powerpc
# SEC64-NEXT:Arch: powerpc64
# SEC32-NEXT:AddressSize: 32bit
# SEC64-NEXT:AddressSize: 64bit
#   SEC-NEXT:Sections [
#   SEC-NEXT:  Section {
#   SEC-NEXT:    Index: 1
#   SEC-NEXT:    Name: .text
#   SEC-NEXT:    PhysicalAddress: 0x0
#   SEC-NEXT:    VirtualAddress: 0x0
#   SEC-NEXT:    Size: 0x2
# SEC32-NEXT:    RawDataOffset: 0xB4
# SEC64-NEXT:    RawDataOffset: 0x138
#   SEC-NEXT:    RelocationPointer: 0x0
#   SEC-NEXT:    LineNumberPointer: 0x0
#   SEC-NEXT:    NumberOfRelocations: 0
#   SEC-NEXT:    NumberOfLineNumbers: 0
#   SEC-NEXT:    Type: STYP_TEXT (0x20)
#   SEC-NEXT:  }
#   SEC-NEXT:  Section {
#   SEC-NEXT:    Index: 2
#   SEC-NEXT:    Name: .data
#   SEC-NEXT:    PhysicalAddress: 0x0
#   SEC-NEXT:    VirtualAddress: 0x0
#   SEC-NEXT:    Size: 0x2
# SEC32-NEXT:    RawDataOffset: 0xB8
# SEC64-NEXT:    RawDataOffset: 0x13C
# SEC32-NEXT:    RelocationPointer: 0xC4
# SEC64-NEXT:    RelocationPointer: 0x148
#   SEC-NEXT:    LineNumberPointer: 0x0
#   SEC-NEXT:    NumberOfRelocations: 1
#   SEC-NEXT:    NumberOfLineNumbers: 0
#   SEC-NEXT:    Type: STYP_DATA (0x40)
#   SEC-NEXT:  }
#   SEC-NEXT:  Section {
#   SEC-NEXT:    Index: 3
#   SEC-NEXT:    Name: .dwabrev
#        SEC:    Type: STYP_DWARF (0x10)
#   SEC-NEXT:    DWARFSubType: SSUBTYP_DWABREV (0x60000)
#   SEC-NEXT:  }
#   SEC-NEXT:  Section {
#   SEC-NEXT:    Index: 4
#   SEC-NEXT:    Name: .dwinfo
#        SEC:    Type: STYP_DWARF (0x10)
#   SEC-NEXT:    DWARFSubType: SSUBTYP_DWINFO (0x10000)
#   SEC-NEXT:  }
#   SEC-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
  - Name:            .dwabrev
    Address:         0x0
    Size:            0x4
    Flags:           [ STYP_DWARF ]
    DWARFSectionSubtype: SSUBTYP_DWABREV
    SectionData:     01110125
  - Name:            .dwinfo
    Address:         0x0
    Size:            0x4
    Flags:           [ STYP_DWARF ]
    DWARFSectionSubtype: SSUBTYP_DWINFO
    SectionData:     00000080