blob: c19a0197061ea68d42200f23b829848b943f392a [file] [log] [blame]
# Tests that a reference from a DSO to a regular object
# forces the final executable to export the symbol.
#RUN: yaml2obj -format=elf %p/Inputs/undef2-so.o.yaml -o=%t.o.so
#RUN: lld -flavor old-gnu -target x86_64 -shared %t.o.so -o %T/libundef2.so
#RUN: yaml2obj -format=elf %s -o=%t.o
#RUN: lld -flavor old-gnu -target x86_64 %t.o -L%T -lundef2 -o %t1
#RUN: llvm-readobj -dyn-symbols %t1 | FileCheck -check-prefix CHECKSYMS %s
---
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_X86_64
Sections:
- Name: .text
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
AddressAlign: 0x0000000000000001
Content: C3
- Name: .data
Type: SHT_PROGBITS
Flags: [ SHF_WRITE, SHF_ALLOC ]
AddressAlign: 0x0000000000000001
Content: ''
- Name: .bss
Type: SHT_NOBITS
Flags: [ SHF_WRITE, SHF_ALLOC ]
AddressAlign: 0x0000000000000004
Size: 4
Symbols:
Local:
- Name: .text
Type: STT_SECTION
Section: .text
- Name: .data
Type: STT_SECTION
Section: .data
- Name: .bss
Type: STT_SECTION
Section: .bss
Global:
- Name: myexportedsymbol
Type: STT_OBJECT
Section: .bss
Size: 0x0000000000000004
- Name: _start
Section: .text
Size: 0x0000000000000001
#CHECKSYMS: myexportedsymbol