]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/elf/Mips/got16-2.test
Vendor import of lld trunk r233088:
[FreeBSD/FreeBSD.git] / test / elf / Mips / got16-2.test
1 # Check handling of R_MIPS_GOT16 relocation against local
2 # symbols when addresses of local data cross 64 KBytes border.
3
4 # RUN: yaml2obj -format=elf %s > %t-obj
5 # RUN: lld -flavor gnu -target mipsel -e T0 -o %t-exe %t-obj
6 # RUN: llvm-objdump -s %t-exe | FileCheck %s
7
8 # CHECK:      Contents of section .got:
9 # CHECK-NEXT:  40a000 00000000 00000080 00004000 00004100  ..........@...A.
10 #                     lazy     module   0x400000 0x410000
11 #                     resolver pointer  for L1   for L2
12
13 FileHeader:
14   Class:           ELFCLASS32
15   Data:            ELFDATA2LSB
16   Type:            ET_REL
17   Machine:         EM_MIPS
18   Flags:           [ EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC,
19                      EF_MIPS_ABI_O32, EF_MIPS_ARCH_32 ]
20 Sections:
21   - Name:            .text
22     Type:            SHT_PROGBITS
23     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
24     AddressAlign:    0x04
25     Content:         '00000000000000000000000000000000'
26
27   - Name:            .rel.text
28     Type:            SHT_REL
29     Link:            .symtab
30     Info:            .text
31     AddressAlign:    0x04
32     Address:         0x1000
33     Relocations:
34       - Offset:      0
35         Symbol:      L1
36         Type:        R_MIPS_GOT16
37       - Offset:      4
38         Symbol:      L1
39         Type:        R_MIPS_LO16
40       - Offset:      8
41         Symbol:      L2
42         Type:        R_MIPS_GOT16
43       - Offset:      12
44         Symbol:      L2
45         Type:        R_MIPS_LO16
46
47   - Name:            .data
48     Type:            SHT_PROGBITS
49     Flags:           [ SHF_ALLOC ]
50     AddressAlign:    0x04
51     Size:            0x9000
52
53 Symbols:
54   Local:
55     - Name:            .text
56       Type:            STT_SECTION
57       Section:         .text
58     - Name:            L1
59       Type:            STT_OBJECT
60       Section:         .data
61       Value:           0x00
62       Size:            0x8000
63     - Name:            L2
64       Type:            STT_OBJECT
65       Section:         .data
66       Value:           0x8000
67       Size:            0x04
68
69   Global:
70     - Name:            T0
71       Type:            STT_FUNC
72       Section:         .text
73       Size:            0x04