summaryrefslogtreecommitdiffstats
path: root/lld/test/elf/Mips/rel-16-overflow.test
blob: e2a73f6933611130bf7b59ae2f5667684f57bbff (plain)
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
# Check R_MIPS_16 relocation overflow handling.

# RUN: yaml2obj -format=elf %s > %t.o
# RUN: not lld -flavor old-gnu -target mipsel -e T0 -o %t.exe %t.o 2>&1 \
# RUN:       | FileCheck %s

# CHECK: Relocation out of range in file {{.*}} reference from T0+0 to T1+32767 of type 1 (R_MIPS_16)

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

Sections:
- Name:         .text
  Type:         SHT_PROGBITS
  Content:      "ff7f00000000000000000000"
#                                ^ T1
#                ^ T0 A := 0x7fff
  AddressAlign: 16
  Flags:        [ SHF_ALLOC, SHF_EXECINSTR ]

- Name:         .rel.text
  Type:         SHT_REL
  Info:         .text
  AddressAlign: 4
  Relocations:
    - Offset: 0
      Symbol: T1
      Type:   R_MIPS_16

Symbols:
  Global:
    - Name:    T0
      Section: .text
      Type:    STT_FUNC
      Value:   0
      Size:    8
    - Name:    T1
      Section: .text
      Type:    STT_FUNC
      Value:   8
      Size:    4
OpenPOWER on IntegriCloud