]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/elf/Mips/plt-entry-mixed-3.test
Vendor import of lld trunk r233088:
[FreeBSD/FreeBSD.git] / test / elf / Mips / plt-entry-mixed-3.test
1 # REQUIRES: mips
2
3 # Conditions:
4 # a) Object file contains microMIPS instructions.
5 # b) There is a relocation refers arbitrary symbols and requires a PLT entry.
6 # Check:
7 # a) PLT contains a compressed entry.
8
9 # Build shared library
10 # RUN: yaml2obj -format=elf -docnum 1 %s > %t.so.o
11 # RUN: lld -flavor gnu -target mipsel -shared -o %t.so %t.so.o
12
13 # Build executable
14 # RUN: yaml2obj -format=elf -docnum 2 %s > %t.o.o
15 # RUN: lld -flavor gnu -target mipsel -e T0 -o %t.exe %t.o.o %t.so
16 # RUN: llvm-objdump -s %t.exe | FileCheck %s
17
18 # FIXME (simon): Check the disassembler output when llvm-objdump starts
19 #                to support microMIPS instruction encoding.
20
21 # CHECK: Contents of section .plt:
22 # CHECK-NEXT:  400170 8079a407 23ff0000 35052525 0233feff  .y..#...5.%%.3..
23 # CHECK-NEXT:  400180 ff0df945 830f000c 0079a007 22ff0000  ...E.....y.."...
24 # CHECK-NEXT:  400190 9945020f                             .E..
25
26 # so.o
27 ---
28 FileHeader:
29   Class:   ELFCLASS32
30   Data:    ELFDATA2LSB
31   Type:    ET_REL
32   Machine: EM_MIPS
33   Flags:   [EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32]
34
35 Sections:
36   - Name:         .text
37     Type:         SHT_PROGBITS
38     Size:         0x0C
39     AddressAlign: 16
40     Flags:        [SHF_EXECINSTR, SHF_ALLOC]
41
42 Symbols:
43   Global:
44     - Name:    T1
45       Section: .text
46       Type:    STT_FUNC
47       Value:   0x0
48       Size:    4
49
50 # o.o
51 ---
52 FileHeader:
53   Class:   ELFCLASS32
54   Data:    ELFDATA2LSB
55   Type:    ET_REL
56   Machine: EM_MIPS
57   Flags:   [EF_MIPS_CPIC, EF_MIPS_ABI_O32,
58             EF_MIPS_ARCH_32R2, EF_MIPS_MICROMIPS]
59
60 Sections:
61 - Name:         .text
62   Type:         SHT_PROGBITS
63   Size:         16
64   AddressAlign: 16
65   Flags:        [SHF_EXECINSTR, SHF_ALLOC]
66
67 - Name:         .data
68   Type:         SHT_PROGBITS
69   Size:         0x08
70   AddressAlign: 16
71   Flags:        [SHF_WRITE, SHF_ALLOC]
72
73 - Name:         .rel.data
74   Type:         SHT_REL
75   Info:         .data
76   AddressAlign: 4
77   Relocations:
78     - Offset: 0x00
79       Symbol: T1
80       Type:   R_MICROMIPS_HI16
81     - Offset: 0x00
82       Symbol: T1
83       Type:   R_MICROMIPS_LO16
84
85 Symbols:
86   Global:
87     - Name:    T0
88       Section: .text
89       Type:    STT_FUNC
90       Value:   0x0
91       Size:    16
92     - Name:    D0
93       Section: .data
94       Type:    STT_OBJECT
95       Value:   0x0
96       Size:    8
97     - Name:    T1
98 ...