aboutsummaryrefslogtreecommitdiff
path: root/test/elf/Mips/exe-dynsym-micro.test
blob: e3b00277ef6a905fe0a36f7cb9c8f5b910a6fa04 (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
# Check that symbol referenced by an entry in the global part of GOT
# has a corresponded entry in the .dynsym section. This test covers
# the case when the GOT entry created because of the R_MICROMIPS_GOT16
# relocation.

# Build executable
# RUN: yaml2obj -format=elf %s > %t.o
# RUN: lld -flavor gnu -target mipsel -e glob -o %t.exe %t.o
# RUN: llvm-readobj -dyn-symbols %t.exe | FileCheck -check-prefix=CHECK-DYN %s

# Build executabl (yaml format)e
# RUN: lld -flavor gnu -target mipsel -e glob \
# RUN:     --output-filetype=yaml -o %t.yaml %t.o
# RUN: FileCheck -check-prefix=CHECK-GOT %s < %t.yaml

# CHECK-DYN: Format: ELF32-mips
# CHECK-DYN: Arch: mipsel
# CHECK-DYN: AddressSize: 32bit
# CHECK-DYN: LoadName:
# CHECK-DYN: DynamicSymbols [
# CHECK-DYN:   Symbol {
# CHECK-DYN:     Name: @ (0)
# CHECK-DYN:     Value: 0x0
# CHECK-DYN:     Size: 0
# CHECK-DYN:     Binding: Local (0x0)
# CHECK-DYN:     Type: None (0x0)
# CHECK-DYN:     Other: 0
# CHECK-DYN:     Section: Undefined (0x0)
# CHECK-DYN:   }
# CHECK-DYN:   Symbol {
# CHECK-DYN:     Name: weakf@ (1)
# CHECK-DYN:     Value: 0x0
# CHECK-DYN:     Size: 0
# CHECK-DYN:     Binding: Weak (0x2)
# CHECK-DYN:     Type: None (0x0)
# CHECK-DYN:     Other: 0
# CHECK-DYN:     Section: Undefined (0x0)
# CHECK-DYN:   }
# CHECK-DYN: ]

# CHECK-GOT: - type:            got
# CHECK-GOT:   content:         [ 00, 00, 00, 00 ]
# CHECK-GOT:   alignment:       2^2
# CHECK-GOT:   section-choice:  custom-required
# CHECK-GOT:   section-name:    .got
# CHECK-GOT:   permissions:     rw-
# CHECK-GOT: - type:            got
# CHECK-GOT:   content:         [ 00, 00, 00, 80 ]
# CHECK-GOT:   alignment:       2^2
# CHECK-GOT:   section-choice:  custom-required
# CHECK-GOT:   section-name:    .got
# CHECK-GOT:   permissions:     rw-
# CHECK-GOT: - ref-name:        L000
# CHECK-GOT:   type:            got
# CHECK-GOT:   content:         [ 00, 00, 00, 00 ]
# CHECK-GOT:   alignment:       2^2
# CHECK-GOT:   section-choice:  custom-required
# CHECK-GOT:   section-name:    .got
# CHECK-GOT:   permissions:     rw-
# CHECK-GOT:   references:
# CHECK-GOT:     - kind:            LLD_R_MIPS_GLOBAL_GOT
# CHECK-GOT:       offset:          0
# CHECK-GOT:       target:          weakf

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_32R2, EF_MIPS_MICROMIPS ]
Sections:
  - Name:            .text
    Type:            SHT_PROGBITS
    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
    AddressAlign:    0x10
    Size:            0x04
  - Name:            .rel.text
    Type:            SHT_REL
    Link:            .symtab
    AddressAlign:    0x04
    Info:            .text
    Relocations:
      - Offset:          0x00
        Symbol:          weakf
        Type:            R_MICROMIPS_GOT16

Symbols:
  Global:
    - Name:            glob
      Section:         .text
      Other:           [ STO_MIPS_MICROMIPS ]
  Weak:
    - Name:            weakf