File: relocations.test

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (90 lines) | stat: -rw-r--r-- 2,836 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
88
89
90
## Test how relocations are dumped.

# RUN: yaml2obj %s -o %t
# RUN: llvm-readobj --relocs --expand-relocs %t | \
# RUN:   FileCheck %s --strict-whitespace --check-prefixes=RELOCSEXP,NODEMANEXP
# RUN: llvm-readobj --relocs %t | \
# RUN:   FileCheck %s --strict-whitespace --check-prefixes=RELOCS,NODEMAN

# RUN: llvm-readobj --relocs --expand-relocs --no-demangle %t | \
# RUN:   FileCheck %s --strict-whitespace --check-prefixes=RELOCSEXP,NODEMANEXP
# RUN: llvm-readobj --relocs --no-demangle %t | \
# RUN:   FileCheck %s --strict-whitespace --check-prefixes=RELOCS,NODEMAN

# RUN: llvm-readobj --relocs --expand-relocs --demangle %t | \
# RUN:   FileCheck %s --strict-whitespace --check-prefixes=RELOCSEXP,DEMANEXP
# RUN: llvm-readobj --relocs --demangle %t | \
# RUN:   FileCheck %s --strict-whitespace --check-prefixes=RELOCS,DEMAN

#      RELOCSEXP:Relocations [
# RELOCSEXP-NEXT:  Section (index: 1) .text {
# RELOCSEXP-NEXT:    Relocation {
# RELOCSEXP-NEXT:      Virtual Address: 0x80
# RELOCSEXP-NEXT:      Symbol: foo (0)
# RELOCSEXP-NEXT:      IsSigned: No
# RELOCSEXP-NEXT:      FixupBitValue: 0
# RELOCSEXP-NEXT:      Length: 22
# RELOCSEXP-NEXT:      Type: R_POS (0x0)
# RELOCSEXP-NEXT:    }
# RELOCSEXP-NEXT:    Relocation {
# RELOCSEXP-NEXT:      Virtual Address: 0x100
# RELOCSEXP-NEXT:      Symbol: foo (0)
# RELOCSEXP-NEXT:      IsSigned: No
# RELOCSEXP-NEXT:      FixupBitValue: 0
# RELOCSEXP-NEXT:      Length: 21
# RELOCSEXP-NEXT:      Type: R_REL (0x2)
# RELOCSEXP-NEXT:    }
# RELOCSEXP-NEXT:  }
# RELOCSEXP-NEXT:  Section (index: 2) .data {
# RELOCSEXP-NEXT:    Relocation {
# RELOCSEXP-NEXT:      Virtual Address: 0x200
# NODEMANEXP-NEXT:     Symbol: _Z3fwpv (1)
# DEMANEXP-NEXT:       Symbol: fwp() (1)
# RELOCSEXP-NEXT:      IsSigned: No
# RELOCSEXP-NEXT:      FixupBitValue: 0
# RELOCSEXP-NEXT:      Length: 20
# RELOCSEXP-NEXT:      Type: R_TOC (0x3)
# RELOCSEXP-NEXT:    }
# RELOCSEXP-NEXT:  }
# RELOCSEXP-NEXT:]

#      RELOCS:Relocations [
# RELOCS-NEXT:  Section (index: 1) .text {
# RELOCS-NEXT:    0x80 R_POS foo(0) 0x15
# RELOCS-NEXT:    0x100 R_REL foo(0) 0x14
# RELOCS-NEXT:  }
# RELOCS-NEXT:  Section (index: 2) .data {
# NODEMAN-NEXT:  0x200 R_TOC _Z3fwpv(1) 0x13
# DEMAN-NEXT:    0x200 R_TOC fwp()(1) 0x13
# RELOCS-NEXT:  }
# RELOCS-NEXT:]

--- !XCOFF
FileHeader:
  MagicNumber: 0x01DF
Sections:
  - Name:  .text
    Flags: [ STYP_TEXT ]
    Relocations:
      - Address: 0x80
        Symbol:  0x0
        Info:    0x15
        Type:    0x0
      - Address: 0x100
        Symbol:  0x0
        Info:    0x14
        Type:    0x2
  - Name:  .data
    Flags: [ STYP_DATA ]
    Relocations:
      - Address: 0x200
        Symbol:  0x1
        Info:    0x13
        Type:    0x3
Symbols:
  - Name:    foo
    Value:   0x0
    Section: .text
  - Name:    _Z3fwpv
    Value:   0x80
    Section: .data