relocations-in-nonreloc.test
1.44 KB
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
## Check that objdump doesn't print relocations in non-relocatable object files.
# RUN: yaml2obj --docnum=1 %s -o %t1
# RUN: llvm-objdump -r %t1 | FileCheck %s -DFILE=%t1 --check-prefix=FMT --implicit-check-not={{.}}
# RUN: yaml2obj --docnum=2 %s -o %t2
# RUN: llvm-objdump -r %t2 | FileCheck %s -DFILE=%t2 --check-prefix=FMT --implicit-check-not={{.}}
# RUN: yaml2obj --docnum=3 %s -o %t3
# RUN: llvm-objdump -r %t3 | FileCheck %s -DFILE=%t3 --check-prefixes=FMT,REL --implicit-check-not={{.}}
# FMT: [[FILE]]: file format elf64-x86-64
# REL: RELOCATION RECORDS FOR []:
# REL-NEXT: OFFSET TYPE VALUE
# REL-NEXT: 0000000000000123 R_X86_64_NONE *ABS*+0x141
## Executable.
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Machine: EM_X86_64
Sections:
- Name: .rela.plt
Type: SHT_RELA
Relocations:
- Offset: 0x123
Type: R_X86_64_NONE
Addend: 321
## DSO.
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_DYN
Machine: EM_X86_64
Sections:
- Name: .rela.plt
Type: SHT_RELA
Relocations:
- Offset: 0x123
Type: R_X86_64_NONE
Addend: 321
## Relocatable.
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_X86_64
Sections:
- Name: .rela.plt
Type: SHT_RELA
Relocations:
- Offset: 0x123
Type: R_X86_64_NONE
Addend: 321