aboutsummaryrefslogtreecommitdiff
path: root/test/elf/initfini-options.test-1.test
blob: 2fc1c3e32bda5a7eb2a8ef226a7dd6e65612ad88 (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
# Check that if there are no -init/-fini options and _init/_fini symbols
# are undefined the linker does not emit DT_INIT/DT_FINI tags.

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

# CHECK-NOT: 0x000000000000000C INIT 0x{{[0-9A-F]+}}
# CHECK-NOT: 0x000000000000000D FINI 0x{{[0-9A-F]+}}

---
FileHeader:
  Class:           ELFCLASS64
  Data:            ELFDATA2LSB
  Type:            ET_REL
  Machine:         EM_X86_64

Sections:
  - Name:          .text
    Type:          SHT_PROGBITS
    Flags:         [ SHF_ALLOC, SHF_EXECINSTR ]
    AddressAlign:  0x04
    Size:          0x08

Symbols:
  Global:
    - Name:        _start
      Type:        STT_FUNC
      Section:     .text
      Size:        0x08
    - Name:        _init
    - Name:        _fini
...