aboutsummaryrefslogtreecommitdiff
path: root/test/elf/Mips/rel-64.test
blob: e05b75687038e2186728b22601a9630b52d632d4 (plain) (blame)
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
# Check handling of R_MIPS_64 relocation.

# RUN: yaml2obj -format=elf %s > %t.o
# RUN: lld -flavor gnu -target mips64el -o %t.exe %t.o
# RUN: llvm-objdump -s -t %t.exe | FileCheck %s

# CHECK: Contents of section .data:
# CHECK-NEXT: 120002000 d1010020 01000000 d0010020 01000100 ... ....... ....
#                       ^^ __start + 1 = 0x1200001d1
#                                         ^^ __start + 0x1000000000000
#                                              = 0x10001200001d0
# CHECK: SYMBOL TABLE:
# CHECK: 00000001200001d0 g .rodata 00000008 __start

FileHeader:
  Class:   ELFCLASS64
  Data:    ELFDATA2LSB
  Type:    ET_REL
  Machine: EM_MIPS
  Flags:   [EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ARCH_64]

Sections:
- Name:         .text
  Type:         SHT_PROGBITS
  Size:         0x08
  AddressAlign: 16
  Flags:        [SHF_ALLOC]
- Name:         .data
  Type:         SHT_PROGBITS
  Size:         0x10
  AddressAlign: 16
  Flags:        [SHF_ALLOC, SHF_WRITE]

- Name:         .rela.data
  Type:         SHT_RELA
  Info:         .data
  AddressAlign: 4
  Relocations:
    - Offset: 0x0
      Symbol: __start
      Type:   R_MIPS_64
      Addend: 1
    - Offset: 0x8
      Symbol: __start
      Type:   R_MIPS_64
      Addend: 0x1000000000000

Symbols:
  Global:
    - Name:    __start
      Section: .text
      Value:   0x0
      Size:    8
    - Name:    data1
      Section: .data
      Value:   0x0
      Size:    8
    - Name:    data2
      Section: .data
      Value:   0x8
      Size:    8