]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/elf/Mips/dynlib-dynamic.test
Vendor import of lld trunk r233088:
[FreeBSD/FreeBSD.git] / test / elf / Mips / dynlib-dynamic.test
1 # Check MIPS specific tags in the dynamic table.
2
3 # Build shared library
4 # RUN: yaml2obj -format=elf %s > %t.o
5 # RUN: lld -flavor gnu -target mipsel -shared --noinhibit-exec -o %t.so %t.o
6 # RUN: llvm-readobj -dynamic-table %t.so | FileCheck %s
7
8 # CHECK: Format: ELF32-mips
9 # CHECK: Arch: mipsel
10 # CHECK: AddressSize: 32bit
11 # CHECK: LoadName:
12 # CHECK: DynamicSection [ (13 entries)
13 # CHECK:   Tag        Type                 Name/Value
14 # CHECK-NEXT:  0x00000004 HASH                 0x{{[0-9A-F]+}}
15 # CHECK-NEXT:  0x00000005 STRTAB               0x{{[0-9A-F]+}}
16 # CHECK-NEXT:  0x00000006 SYMTAB               0x{{[0-9A-F]+}}
17 # CHECK-NEXT:  0x0000000A STRSZ                17 (bytes)
18 # CHECK-NEXT:  0x0000000B SYMENT               16 (bytes)
19 # CHECK-NEXT:  0x70000001 MIPS_RLD_VERSION     1
20 # CHECK-NEXT:  0x70000005 MIPS_FLAGS           NOTPOT
21 # CHECK-NEXT:  0x70000006 MIPS_BASE_ADDRESS    0x0
22 # CHECK-NEXT:  0x7000000A MIPS_LOCAL_GOTNO     4
23 # CHECK-NEXT:  0x70000011 MIPS_SYMTABNO        4
24 # CHECK-NEXT:  0x70000013 MIPS_GOTSYM          0x2
25 # CHECK-NEXT:  0x00000003 PLTGOT               0x1000
26 # CHECK-NEXT:  0x00000000 NULL                 0x0
27 # CHECK-NEXT: ]
28
29 FileHeader:
30   Class:           ELFCLASS32
31   Data:            ELFDATA2LSB
32   Type:            ET_REL
33   Machine:         EM_MIPS
34   Flags:           [ EF_MIPS_PIC, EF_MIPS_CPIC,
35                      EF_MIPS_ABI_O32, EF_MIPS_ARCH_32 ]
36 Sections:
37   - Name:            .text
38     Type:            SHT_PROGBITS
39     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
40     AddressAlign:    0x04
41     Size:            0x18
42   - Name:            .rel.text
43     Type:            SHT_REL
44     Link:            .symtab
45     AddressAlign:    0x04
46     Info:            .text
47     Relocations:
48       - Offset:          0x00
49         Symbol:          '$.str1'
50         Type:            R_MIPS_GOT16
51       - Offset:          0x04
52         Symbol:          '$.str1'
53         Type:            R_MIPS_LO16
54       - Offset:          0x08
55         Symbol:          '$.str2'
56         Type:            R_MIPS_GOT16
57       - Offset:          0x0C
58         Symbol:          '$.str2'
59         Type:            R_MIPS_LO16
60       - Offset:          0x10
61         Symbol:          glob2
62         Type:            R_MIPS_CALL16
63       - Offset:          0x14
64         Symbol:          ext1
65         Type:            R_MIPS_CALL16
66   - Name:            .data
67     Type:            SHT_PROGBITS
68     Flags:           [ SHF_WRITE, SHF_ALLOC ]
69     AddressAlign:    0x04
70     Size:            0x00
71   - Name:            .bss
72     Type:            SHT_NOBITS
73     Flags:           [ SHF_WRITE, SHF_ALLOC ]
74     AddressAlign:    0x04
75     Size:            0x00
76   - Name:            .rodata.str1
77     Type:            SHT_PROGBITS
78     AddressAlign:    0x01
79     Size:            0x05
80   - Name:            .rodata.str2
81     Type:            SHT_PROGBITS
82     AddressAlign:    0x01
83     Size:            0x05
84
85 Symbols:
86   Local:
87     - Name:            '$.str1'
88       Section:         .rodata.str1
89     - Name:            '$.str2'
90       Section:         .rodata.str2
91     - Name:            .text
92       Type:            STT_SECTION
93       Section:         .text
94     - Name:            .data
95       Type:            STT_SECTION
96       Section:         .data
97     - Name:            .bss
98       Type:            STT_SECTION
99       Section:         .bss
100     - Name:            .rodata.str1
101       Type:            STT_SECTION
102       Section:         .rodata.str1
103     - Name:            .rodata.str2
104       Type:            STT_SECTION
105       Section:         .rodata.str2
106   Global:
107     - Name:            glob
108       Section:         .text
109     - Name:            ext1
110     - Name:            glob2