]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/elf/initfini-options.test-2.test
Vendor import of lld trunk r233088:
[FreeBSD/FreeBSD.git] / test / elf / initfini-options.test-2.test
1 # Check that if _init/_fini symbols are defined the linker emits
2 # DT_INIT/DT_FINI tags point to these symbols.
3
4 # RUN: yaml2obj -format=elf %s > %t.o
5 # RUN: lld -flavor gnu -target x86_64 -shared -o %t.so %t.o
6 # RUN: llvm-readobj -symbols -dynamic-table %t.so | FileCheck %s
7
8 # CHECK:      Name: _init (8)
9 # CHECK-NEXT: Value: {{[0x0-9a-f]+}}
10 # CHECK:      Name: _fini (14)
11 # CHECK-NEXT: Value: {{[0x0-9a-f]+}}
12 #
13 # CHECK: 0x000000000000000C INIT {{[0x0-9a-f]+}}
14 # CHECK: 0x000000000000000D FINI {{[0x0-9a-f]+}}
15
16 ---
17 FileHeader:
18   Class:           ELFCLASS64
19   Data:            ELFDATA2LSB
20   Type:            ET_REL
21   Machine:         EM_X86_64
22
23 Sections:
24   - Name:          .text
25     Type:          SHT_PROGBITS
26     Flags:         [ SHF_ALLOC, SHF_EXECINSTR ]
27     AddressAlign:  0x04
28     Size:          0x18
29
30 Symbols:
31   Global:
32     - Name:        _start
33       Type:        STT_FUNC
34       Section:     .text
35       Value:       0x0
36       Size:        0x8
37     - Name:        _init
38       Type:        STT_FUNC
39       Section:     .text
40       Value:       0x8
41       Size:        0x8
42     - Name:        _fini
43       Type:        STT_FUNC
44       Section:     .text
45       Value:       0xF
46       Size:        0x8
47 ...