forked from OSchip/llvm-project
48 lines
1.2 KiB
Plaintext
48 lines
1.2 KiB
Plaintext
|
# Check that if _init/_fini symbols are defined the linker emits
|
||
|
# DT_INIT/DT_FINI tags point to these symbols.
|
||
|
|
||
|
# RUN: yaml2obj -format=elf %s > %t.o
|
||
|
# RUN: lld -flavor gnu -target x86_64 -shared -o %t.so %t.o
|
||
|
# RUN: llvm-readobj -symbols -dynamic-table %t.so | FileCheck %s
|
||
|
|
||
|
# CHECK: Name: _init (8)
|
||
|
# CHECK-NEXT: Value: 0x4001E4
|
||
|
# CHECK: Name: _fini (14)
|
||
|
# CHECK-NEXT: Value: 0x4001EB
|
||
|
#
|
||
|
# CHECK: 0x000000000000000C INIT 0x4001E4
|
||
|
# CHECK: 0x000000000000000D FINI 0x4001EB
|
||
|
|
||
|
---
|
||
|
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: 0x18
|
||
|
|
||
|
Symbols:
|
||
|
Global:
|
||
|
- Name: _start
|
||
|
Type: STT_FUNC
|
||
|
Section: .text
|
||
|
Value: 0x0
|
||
|
Size: 0x8
|
||
|
- Name: _init
|
||
|
Type: STT_FUNC
|
||
|
Section: .text
|
||
|
Value: 0x8
|
||
|
Size: 0x8
|
||
|
- Name: _fini
|
||
|
Type: STT_FUNC
|
||
|
Section: .text
|
||
|
Value: 0xF
|
||
|
Size: 0x8
|
||
|
...
|