aboutsummaryrefslogtreecommitdiff
path: root/test/elf/Mips/dynlib-dynamic.test
blob: 54afdec263a639260c077ddf5bd247cf9570266e (plain) (blame)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# Check MIPS specific tags in the dynamic table.

# Build shared library
# RUN: yaml2obj -format=elf %s > %t.o
# RUN: lld -flavor gnu -target mipsel -shared --noinhibit-exec -o %t.so %t.o
# RUN: llvm-readobj -dynamic-table %t.so | FileCheck %s

# CHECK: Format: ELF32-mips
# CHECK: Arch: mipsel
# CHECK: AddressSize: 32bit
# CHECK: LoadName:
# CHECK: DynamicSection [ (13 entries)
# CHECK:   Tag        Type                 Name/Value
# CHECK-NEXT:  0x00000004 HASH                 0x{{[0-9A-F]+}}
# CHECK-NEXT:  0x00000005 STRTAB               0x{{[0-9A-F]+}}
# CHECK-NEXT:  0x00000006 SYMTAB               0x{{[0-9A-F]+}}
# CHECK-NEXT:  0x0000000A STRSZ                17 (bytes)
# CHECK-NEXT:  0x0000000B SYMENT               16 (bytes)
# CHECK-NEXT:  0x70000001 MIPS_RLD_VERSION     1
# CHECK-NEXT:  0x70000005 MIPS_FLAGS           NOTPOT
# CHECK-NEXT:  0x70000006 MIPS_BASE_ADDRESS    0x0
# CHECK-NEXT:  0x7000000A MIPS_LOCAL_GOTNO     4
# CHECK-NEXT:  0x70000011 MIPS_SYMTABNO        4
# CHECK-NEXT:  0x70000013 MIPS_GOTSYM          0x2
# CHECK-NEXT:  0x00000003 PLTGOT               0x1000
# CHECK-NEXT:  0x00000000 NULL                 0x0
# CHECK-NEXT: ]

FileHeader:
  Class:           ELFCLASS32
  Data:            ELFDATA2LSB
  Type:            ET_REL
  Machine:         EM_MIPS
  Flags:           [ EF_MIPS_PIC, EF_MIPS_CPIC,
                     EF_MIPS_ABI_O32, EF_MIPS_ARCH_32 ]
Sections:
  - Name:            .text
    Type:            SHT_PROGBITS
    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
    AddressAlign:    0x04
    Size:            0x18
  - Name:            .rel.text
    Type:            SHT_REL
    Link:            .symtab
    AddressAlign:    0x04
    Info:            .text
    Relocations:
      - Offset:          0x00
        Symbol:          '$.str1'
        Type:            R_MIPS_GOT16
      - Offset:          0x04
        Symbol:          '$.str1'
        Type:            R_MIPS_LO16
      - Offset:          0x08
        Symbol:          '$.str2'
        Type:            R_MIPS_GOT16
      - Offset:          0x0C
        Symbol:          '$.str2'
        Type:            R_MIPS_LO16
      - Offset:          0x10
        Symbol:          glob2
        Type:            R_MIPS_CALL16
      - Offset:          0x14
        Symbol:          ext1
        Type:            R_MIPS_CALL16
  - Name:            .data
    Type:            SHT_PROGBITS
    Flags:           [ SHF_WRITE, SHF_ALLOC ]
    AddressAlign:    0x04
    Size:            0x00
  - Name:            .bss
    Type:            SHT_NOBITS
    Flags:           [ SHF_WRITE, SHF_ALLOC ]
    AddressAlign:    0x04
    Size:            0x00
  - Name:            .rodata.str1
    Type:            SHT_PROGBITS
    AddressAlign:    0x01
    Size:            0x05
  - Name:            .rodata.str2
    Type:            SHT_PROGBITS
    AddressAlign:    0x01
    Size:            0x05

Symbols:
  Local:
    - Name:            '$.str1'
      Section:         .rodata.str1
    - Name:            '$.str2'
      Section:         .rodata.str2
    - Name:            .text
      Type:            STT_SECTION
      Section:         .text
    - Name:            .data
      Type:            STT_SECTION
      Section:         .data
    - Name:            .bss
      Type:            STT_SECTION
      Section:         .bss
    - Name:            .rodata.str1
      Type:            STT_SECTION
      Section:         .rodata.str1
    - Name:            .rodata.str2
      Type:            STT_SECTION
      Section:         .rodata.str2
  Global:
    - Name:            glob
      Section:         .text
    - Name:            ext1
    - Name:            glob2