]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/elf/Mips/base-address.test
Vendor import of lld trunk r233088:
[FreeBSD/FreeBSD.git] / test / elf / Mips / base-address.test
1 # Check executable base address configuration. Base address should be
2 # equal to 0x400000 and the MIPS_BASE_ADDRESS dynamic tag's value should
3 # be the same.
4 # RUN: yaml2obj -format=elf %s > %t.o
5 # RUN: lld -flavor gnu -target mipsel --noinhibit-exec -o %t.exe %t.o
6 # RUN: llvm-readobj -dynamic-table -program-headers %t.exe | FileCheck %s
7
8 # CHECK: DynamicSection [ (13 entries)
9 # CHECK:   Tag        Type                 Name/Value
10 # CHECK-NEXT:   0x00000004 HASH                 0x{{[0-9A-F]+}}
11 # CHECK-NEXT:   0x00000005 STRTAB               0x{{[0-9A-F]+}}
12 # CHECK-NEXT:   0x00000006 SYMTAB               0x{{[0-9A-F]+}}
13 # CHECK-NEXT:   0x0000000A STRSZ                1 (bytes)
14 # CHECK-NEXT:   0x0000000B SYMENT               16 (bytes)
15 # CHECK-NEXT:   0x70000001 MIPS_RLD_VERSION     1
16 # CHECK-NEXT:   0x70000005 MIPS_FLAGS           NOTPOT
17 # CHECK-NEXT:   0x70000006 MIPS_BASE_ADDRESS    0x400000
18 # CHECK-NEXT:   0x7000000A MIPS_LOCAL_GOTNO     2
19 # CHECK-NEXT:   0x70000011 MIPS_SYMTABNO        1
20 # CHECK-NEXT:   0x70000013 MIPS_GOTSYM          0x1
21 # CHECK-NEXT:   0x00000003 PLTGOT               0x401000
22 # CHECK-NEXT:   0x00000000 NULL                 0x0
23 # CHECK-NEXT: ]
24
25 # CHECK: ProgramHeaders [
26 # CHECK:   ProgramHeader {
27 # CHECK:     Type: PT_PHDR (0x6)
28 # CHECK:     Offset: 0x34
29 # CHECK:     VirtualAddress: 0x{{[0-9A-F]+}}
30 # CHECK:   }
31 # CHECK:   ProgramHeader {
32 # CHECK:     Type: PT_INTERP (0x3)
33 # CHECK:     Offset: 0xF4
34 # CHECK:     VirtualAddress: 0x{{[0-9A-F]+}}
35 # CHECK:   }
36 # CHECK:   ProgramHeader {
37 # CHECK:     Type: PT_LOAD (0x1)
38 # CHECK:     Offset: 0x0
39 # CHECK:     VirtualAddress: 0x{{[0-9A-F]+}}
40 # CHECK:   }
41 # CHECK:   ProgramHeader {
42 # CHECK:     Type: PT_LOAD (0x1)
43 # CHECK:     Offset: 0x1000
44 # CHECK:     VirtualAddress: 0x{{[0-9A-F]+}}
45 # CHECK:   }
46 # CHECK:   ProgramHeader {
47 # CHECK:     Type: PT_LOAD (0x1)
48 # CHECK:     Offset: 0x2000
49 # CHECK:     VirtualAddress: 0x{{[0-9A-F]+}}
50 # CHECK:   }
51 # CHECK:   ProgramHeader {
52 # CHECK:     Type: PT_DYNAMIC (0x2)
53 # CHECK:     Offset: 0x12C
54 # CHECK:     VirtualAddress: 0x{{[0-9A-F]+}}
55 # CHECK:   }
56 # CHECK: ]
57
58 FileHeader:
59   Class:           ELFCLASS32
60   Data:            ELFDATA2LSB
61   Type:            ET_REL
62   Machine:         EM_MIPS
63   Flags:           [ EF_MIPS_ABI_O32, EF_MIPS_ARCH_32 ]
64 Sections:
65   - Name:            .text
66     Type:            SHT_PROGBITS
67     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
68     AddressAlign:    0x04
69     Size:            0x04
70   - Name:            .data
71     Type:            SHT_PROGBITS
72     Flags:           [ SHF_WRITE, SHF_ALLOC ]
73     AddressAlign:    0x04
74     Size:            0x00
75   - Name:            .bss
76     Type:            SHT_NOBITS
77     Flags:           [ SHF_WRITE, SHF_ALLOC ]
78     AddressAlign:    0x04
79     Size:            0x00
80   - Name:            .reginfo
81     Type:            SHT_MIPS_REGINFO
82     Flags:           [ SHF_ALLOC ]
83     AddressAlign:    0x01
84     Size:            0x18
85   - Name:            .MIPS.abiflags
86     Type:            SHT_MIPS_ABIFLAGS
87     Flags:           [ SHF_ALLOC ]
88     AddressAlign:    0x08
89     Content:         '000020010101000100000000000000000000000000000000'
90 Symbols:
91   Local:
92     - Name:            .text
93       Type:            STT_SECTION
94       Section:         .text
95     - Name:            .data
96       Type:            STT_SECTION
97       Section:         .data
98     - Name:            .bss
99       Type:            STT_SECTION
100       Section:         .bss
101     - Name:            .reginfo
102       Type:            STT_SECTION
103       Section:         .reginfo
104     - Name:            .MIPS.abiflags
105       Type:            STT_SECTION
106       Section:         .MIPS.abiflags
107   Global:
108     - Name:            main
109       Section:         .text