]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/elf/Mips/pc23-range.test
Vendor import of lld trunk r233088:
[FreeBSD/FreeBSD.git] / test / elf / Mips / pc23-range.test
1 # Check that LLD shows an error if ADDIUPC immediate is out of range.
2
3 # RUN: yaml2obj -format=elf %s > %t-obj
4 # RUN: lld -flavor gnu -target mipsel -o %t-exe %t-obj 2>&1 | FileCheck %s
5
6 # CHECK: The addiupc instruction immediate 0x02000008 is out of range
7
8 !ELF
9 FileHeader: !FileHeader
10   Class:   ELFCLASS32
11   Data:    ELFDATA2LSB
12   Type:    ET_REL
13   Machine: EM_MIPS
14   Flags:   [ EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R2,
15              EF_MIPS_MICROMIPS ]
16
17 Sections:
18 - Name:         .text
19   Type:         SHT_PROGBITS
20   Content:      "0000000080780100"
21 #                        ^ PC23: 1 << 2 = 4 => T0 + 4 - 4 = T0
22   AddressAlign: 16
23   Flags:        [ SHF_ALLOC, SHF_EXECINSTR ]
24
25 - Name:         .data
26   Type:         SHT_PROGBITS
27   Flags:        [ SHF_ALLOC ]
28   AddressAlign: 0x04
29   Size:         0x4000000
30
31 - Name: .rel.text
32   Type: SHT_REL
33   Info: .text
34   AddressAlign: 4
35   Relocations:
36     - Offset: 4
37       Symbol: T0
38       Type:   R_MICROMIPS_PC23_S2
39
40 Symbols:
41   Global:
42     - Name:    __start
43       Section: .text
44       Type:    STT_FUNC
45       Size:    8
46       Other:   [ STO_MIPS_MICROMIPS ]
47     - Name:    TZ
48       Section: .data
49       Type:    STT_FUNC
50       Value:   0
51       Size:    0x2000000
52     - Name:    T0
53       Section: .data
54       Type:    STT_FUNC
55       Value:   0x2000000
56       Size:    4