llvm-project/lld/test/elf/initfini-options.test-1.test

34 lines
889 B
Plaintext

# 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
...