]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/elf/Mips/rel-pc32.test
Vendor import of lld trunk r233088:
[FreeBSD/FreeBSD.git] / test / elf / Mips / rel-pc32.test
1 # Check handling of R_MIPS_PC32 relocation.
2 # RUN: yaml2obj -format=elf %s > %t-obj
3 # RUN: lld -flavor gnu -target mipsel -o %t-exe %t-obj
4 # RUN: llvm-objdump -s -t %t-exe | FileCheck %s
5
6 # CHECK: Contents of section .data:
7 # CHECK-NEXT: 402000 00000000 05000080 fdffff7f  ............
8 #                             ^^ data2 + 0x80000001 - data1
9 #                                      ^^ data1 + 0x80000001 - data2
10 # CHECK: SYMBOL TABLE:
11 # CHECK: 00402004 g  .data  00000004 data1
12 # CHECK: 00402008 g  .data  00000004 data2
13
14 !ELF
15 FileHeader: !FileHeader
16   Class: ELFCLASS32
17   Data: ELFDATA2LSB
18   Type: ET_REL
19   Machine: EM_MIPS
20   Flags:   [EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32]
21
22 Sections:
23 - Name: .text
24   Type: SHT_PROGBITS
25   Content: "00000000"
26   AddressAlign: 16
27   Flags: [SHF_ALLOC]
28 - Name: .data
29   Type: SHT_PROGBITS
30   Content: "000000000100008001000080"
31   AddressAlign: 16
32   Flags: [SHF_ALLOC, SHF_WRITE]
33
34 - Name: .rel.data
35   Type: SHT_REL
36   Info: .data
37   AddressAlign: 4
38   Relocations:
39     - Offset: 0x4
40       Symbol: data2
41       Type: R_MIPS_PC32
42     - Offset: 0x8
43       Symbol: data1
44       Type: R_MIPS_PC32
45
46 Symbols:
47   Global:
48     - Name: __start
49       Section: .text
50       Value: 0x0
51       Size: 4
52     - Name: data1
53       Section: .data
54       Value: 0x4
55       Size: 4
56     - Name: data2
57       Section: .data
58       Value: 0x8
59       Size: 4