]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/elf/X86_64/reloc_r_x86_64_pc64.test
Vendor import of lld trunk r233088:
[FreeBSD/FreeBSD.git] / test / elf / X86_64 / reloc_r_x86_64_pc64.test
1 # Tests that lld can handle relocations of type R_X86_64_PC64
2 #RUN: yaml2obj -format=elf -docnum 1 %s -o %t1.o
3 #RUN: lld -flavor gnu -target x86_64 %t1.o --noinhibit-exec -o %t2.out -static
4 #RUN: llvm-objdump -s %t2.out | FileCheck %s
5 #CHECK: Contents of section .data:
6 #CHECK: 401000 0a00
7 ---
8 FileHeader:
9   Class:           ELFCLASS64
10   Data:            ELFDATA2LSB
11   OSABI:           ELFOSABI_GNU
12   Type:            ET_REL
13   Machine:         EM_X86_64
14 Sections:
15   - Name:            .text
16     Type:            SHT_PROGBITS
17     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
18     AddressAlign:    0x0000000000000004
19     Content:         ''
20   - Name:            .data
21     Type:            SHT_PROGBITS
22     Flags:           [ SHF_WRITE, SHF_ALLOC ]
23     AddressAlign:    0x0000000000000008
24     Content:         '0000'
25   - Name:            .rela.data
26     Type:            SHT_RELA
27     Link:            .symtab
28     AddressAlign:    0x0000000000000008
29     Info:            .data
30     Relocations:
31       - Offset:          0x0000000000000000
32         Symbol:          foo
33         Type:            R_X86_64_PC64
34         Addend:          8
35   - Name:            .bss
36     Type:            SHT_NOBITS
37     Flags:           [ SHF_WRITE, SHF_ALLOC ]
38     AddressAlign:    0x0000000000000004
39     Content:         ''
40 Symbols:
41   Local:
42     - Name:            .text
43       Type:            STT_SECTION
44       Section:         .text
45     - Name:            .data
46       Type:            STT_SECTION
47       Section:         .data
48     - Name:            .bss
49       Type:            STT_SECTION
50       Section:         .bss
51   Global:
52     - Name:            bar
53       Type:            STT_OBJECT
54       Section:         .data
55       Size:            0x0000000000000008
56     - Name:            foo
57       Type:            STT_OBJECT
58       Section:         .data
59       Value:           0x0000000000000002
60       Size:            0x0000000000000002
61 ...