File: adjust-vma.test

package info (click to toggle)
llvm-toolchain-17 1%3A17.0.6-22
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,799,624 kB
  • sloc: cpp: 6,428,607; ansic: 1,383,196; asm: 793,408; python: 223,504; objc: 75,364; f90: 60,502; lisp: 33,869; pascal: 15,282; sh: 9,684; perl: 7,453; ml: 4,937; awk: 3,523; makefile: 2,889; javascript: 2,149; xml: 888; fortran: 619; cs: 573
file content (136 lines) | stat: -rw-r--r-- 5,602 bytes parent folder | download | duplicates (2)
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# RUN: yaml2obj %s -o %t
# RUN: llvm-objdump --all-headers -D -z %t | FileCheck %s --check-prefixes=COMMON,NOADJUST
# RUN: llvm-objdump --all-headers -D -z --adjust-vma=0x0 %t | FileCheck %s --check-prefixes=COMMON,NOADJUST
# RUN: llvm-objdump --all-headers -D -z --adjust-vma=0x123000 %t | FileCheck %s --check-prefixes=COMMON,ADJUST

# NOADJUST:      Sections:
# NOADJUST-NEXT: Idx Name           Size     VMA              Type
# NOADJUST-NEXT:  0                 00000000 0000000000000000
# NOADJUST-NEXT:  1 .text           00000002 0000000000000000 TEXT
# NOADJUST-NEXT:  2 .debug_str      00000004 0000000000000000
# NOADJUST-NEXT:  3 .rela.debug_str 00000018 0000000000000000
# NOADJUST-NEXT:  4 .data           00000004 0000000000000000 DATA
# NOADJUST-NEXT:  5 .rela.data      00000018 0000000000000000
# NOADJUST-NEXT:  6 .symtab         {{.*}}   0000000000000000
# NOADJUST-NEXT:  7 .strtab         {{.*}}   0000000000000000
# NOADJUST-NEXT:  8 .shstrtab       0000003c 0000000000000000

# ADJUST:        Sections:
# ADJUST-NEXT:   Idx Name           Size     VMA              Type
# ADJUST-NEXT:    0                 00000000 0000000000000000
# ADJUST-NEXT:    1 .text           00000002 0000000000123000 TEXT
# ADJUST-NEXT:    2 .debug_str      00000004 0000000000000000
# ADJUST-NEXT:    3 .rela.debug_str 00000018 0000000000000000
# ADJUST-NEXT:    4 .data           00000004 0000000000123000 DATA
# ADJUST-NEXT:    5 .rela.data      00000018 0000000000000000
# ADJUST-NEXT:    6 .symtab         {{.*}}   0000000000000000
# ADJUST-NEXT:    7 .strtab         {{.*}}   0000000000000000
# ADJUST-NEXT:    8 .shstrtab       0000003c 0000000000000000

# NOADJUST:      SYMBOL TABLE:
# NOADJUST-NEXT:  0000000000000001  l F .text      0000000000000000 func
# NOADJUST-NEXT:  0000000000000000  l   .text      0000000000000000 sym
# NOADJUST-NEXT:  0000000000000000  l d .text      0000000000000000 .text
# NOADJUST-NEXT:  0000000000003333  l   *ABS*      0000000000000000 abs
# NOADJUST-NEXT:  0000000000000000  l   .debug_str 0000000000000000 debug_str_sym

# ADJUST:        SYMBOL TABLE:
# ADJUST-NEXT:    0000000000000001  l F .text      0000000000000000 func
# ADJUST-NEXT:    0000000000000000  l   .text      0000000000000000 sym
# ADJUST-NEXT:    0000000000000000  l d .text      0000000000000000 .text
# ADJUST-NEXT:    0000000000003333  l   *ABS*      0000000000000000 abs
# ADJUST-NEXT:    0000000000000000  l   .debug_str 0000000000000000 debug_str_sym

# NOADJUST:      0000000000000000 <sym>:
# NOADJUST-NEXT:   0: {{.*}}  nop
# NOADJUST:      0000000000000001 <func>:
# NOADJUST-NEXT:   1: {{.*}}  retq

# ADJUST:        0000000000123000 <sym>:
# ADJUST-NEXT:     123000: {{.*}} nop
# ADJUST:        0000000000123001 <func>:
# ADJUST-NEXT:     123001: {{.*}} retq

# NOADJUST:      0000000000000000 <debug_str_sym>:
# NOADJUST-NEXT:   0: {{.*}}  %al, (%rax)
# NOADJUST-NEXT:      0000000000000001:  R_X86_64_32  .text
# NOADJUST-NEXT:   2: {{.*}}  addb    %al, (%rax)

# ADJUST:        0000000000000000 <debug_str_sym>:
# ADJUST-NEXT:     0: {{.*}}  %al, (%rax)
# ADJUST-NEXT:        0000000000123001:  R_X86_64_32  .text
# ADJUST-NEXT:     2: {{.*}}  addb    %al, (%rax)

# COMMON:        0000000000000000    <.rela.debug_str>:
# COMMON-NEXT:     0: {{.*}}  addl %eax, (%rax)
## ... There are more lines here. We do not care.

# NOADJUST:      0000000000000000  <.data>:
# NOADJUST-NEXT:  0: {{.*}} addb    %al, (%rax)
# NOADJUST-NEXT: 0000000000000000: R_X86_64_32  .text
# NOADJUST-NEXT:  2: {{.*}} addb    %al, (%rax)

# ADJUST:        0000000000123000  <.data>:
# ADJUST-NEXT:    123000: {{.*}}  addb    %al, (%rax)
# ADJUST-NEXT:   0000000000123000: R_X86_64_32  .text
# ADJUST-NEXT:    123002: {{.*}}  addb    %al, (%rax)

# COMMON:        0000000000000000   <.rela.data>:
# COMMON-NEXT:    0: {{.*}} addb %al, (%rax)
## ... There are more lines here. We do not care.

--- !ELF
FileHeader:      
  Class:           ELFCLASS64
  Data:            ELFDATA2LSB
  Type:            ET_REL
  Machine:         EM_X86_64
Sections:        
  - Name:            .text
    Type:            SHT_PROGBITS
    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
    AddressAlign:    0x0000000000000004
    Content:         90C3
  - Name:            .debug_str
    Type:            SHT_PROGBITS
    Flags:           [ SHF_MERGE, SHF_STRINGS ]
    AddressAlign:    0x0000000000000001
    Content:         '00000000'
  - Name:            .rela.debug_str
    Type:            SHT_RELA
    Link:            .symtab
    AddressAlign:    0x0000000000000008
    Info:            .debug_str
    Relocations:     
      - Offset:          0x0000000000000001
        Symbol:          .text
        Type:            R_X86_64_32
  - Name:            .data
    Type:            SHT_PROGBITS
    Flags:           [ SHF_WRITE, SHF_ALLOC ]
    AddressAlign:    0x0000000000000001
    Content:         '00000000'
  - Name:            .rela.data
    Type:            SHT_RELA
    Link:            .symtab
    AddressAlign:    0x0000000000000008
    Info:            .data
    Relocations:     
      - Offset:      0x0000000000000000
        Symbol:      .text
        Type:        R_X86_64_32
Symbols:
  - Name:            func
    Type:            STT_FUNC
    Section:         .text
    Value:           0x0000000000000001
  - Name:            sym
    Section:         .text
  - Name:            .text
    Type:            STT_SECTION
    Section:         .text
  - Name:            abs
    Index:           SHN_ABS
    Value:           0x3333
  - Name:            debug_str_sym
    Section:         .debug_str