dynamic-relocations.test
1.17 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
## Check that llvm-objcopy can handle an object
## containing dynamic relocations properly.
# RUN: yaml2obj %s > %t1
# RUN: llvm-objcopy %t1 %t2
# RUN: llvm-readobj --sections --section-data %t2 | FileCheck %s
# CHECK: Name: .rela.plt
# CHECK-NEXT: Type: SHT_RELA
# CHECK-NEXT: Flags [
# CHECK-NEXT: SHF_ALLOC
# CHECK-NEXT: ]
# CHECK-NEXT: Address:
# CHECK-NEXT: Offset:
# CHECK-NEXT: Size: 24
# CHECK-NEXT: Link:
# CHECK-NEXT: Info:
# CHECK-NEXT: AddressAlignment: 8
# CHECK-NEXT: EntrySize: 24
# CHECK-NEXT: SectionData (
# CHECK-NEXT: 0000: 18202000 00000000 07000000 01000000 |. .............|
# CHECK-NEXT: 0010: 00000000 00000000 |........|
# CHECK-NEXT: )
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Machine: EM_X86_64
Sections:
- Name: .rela.plt
Type: SHT_RELA
Flags: [ SHF_ALLOC ]
Address: 0x0000000000200220
Link: 0
AddressAlign: 0x0000000000000008
Relocations:
- Offset: 0x0000000000202018
Symbol: foo
Type: R_X86_64_JUMP_SLOT
Symbols:
- Name: foo
Binding: STB_GLOBAL