aboutsummaryrefslogtreecommitdiff
path: root/test/old-elf/Mips/rel-lit.test
blob: 19aa6872169138cc245f5ecd3a45061fef98f321 (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
# Check handling of R_MIPS_LITERAL relocation.

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

# CHECK:      Contents of section .text:
# CHECK-NEXT:  400130 0f100000
#                     ^ 0x402000 + 0x7fff - 0x408ff0 = 0x100f

# CHECK: 00402000 g   .data  00000004 D0
# CHECK: 00408ff0 g   *ABS*  00000000 _gp_disp

---
FileHeader:      
  Class:    ELFCLASS32
  Data:     ELFDATA2LSB
  Type:     ET_REL
  Machine:  EM_MIPS
  Flags:    [EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32]

Sections:        
  - Name:          .text
    Type:          SHT_PROGBITS
    Flags:         [ SHF_ALLOC, SHF_EXECINSTR ]
    AddressAlign:  16
    Content:       "ff7f0000"

  - Name:          .rel.text
    Type:          SHT_REL
    Link:          .symtab
    AddressAlign:  4
    Info:          .text
    Relocations:   
      - Offset:  0
        Symbol:  D0
        Type:    R_MIPS_LITERAL

  - Name:          .data
    Type:          SHT_PROGBITS
    Flags:         [ SHF_ALLOC, SHF_WRITE ]
    AddressAlign:  16
    Size:          4

Symbols:         
  Global:          
    - Name:     T0
      Type:     STT_FUNC
      Section:  .text
      Value:    0
      Size:     4
    - Name:     D0
      Type:     STT_OBJECT
      Section:  .data
      Value:    0
      Size:     4
...